summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/commonmark/default.nix
blob: 63fe33eb10b8510cbe20db63d13751a9e096f5be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  hypothesis,
  python,
}:

buildPythonPackage rec {
  pname = "commonmark";
  version = "0.9.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "readthedocs";
    repo = "commonmark.py";
    tag = version;
    hash = "sha256-Ui/G/VLdjWcm7YmVjZ5Q8h0DEEFqdDByre29g3zHUq4=";
  };

  build-system = [ setuptools ];

  nativeCheckInputs = [ hypothesis ];

  checkPhase = ''
    runHook preCheck

    ${python.interpreter} commonmark/tests/run_spec_tests.py
    ${python.interpreter} commonmark/tests/unit_tests.py

    export PATH=$out/bin:$PATH
    cmark commonmark/tests/test.md
    cmark commonmark/tests/test.md -a
    cmark commonmark/tests/test.md -aj

    runHook postCheck
  '';

  meta = {
    description = "Python CommonMark parser ";
    mainProgram = "cmark";
    homepage = "https://github.com/readthedocs/commonmark.py";
    license = lib.licenses.bsd3;
  };
}