1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, flit-core
5, pythonOlder
6, docutils
7, jinja2
8, markdown-it-py
9, mdit-py-plugins
10, pyyaml
11, sphinx
12, typing-extensions
13, beautifulsoup4
14, pytest-param-files
15, pytest-regressions
16, sphinx-pytest
17, pytestCheckHook
18}:
19
20buildPythonPackage rec {
21 pname = "myst-parser";
22 version = "0.18.0";
23
24 disabled = pythonOlder "3.7";
25
26 src = fetchFromGitHub {
27 owner = "executablebooks";
28 repo = pname;
29 rev = "v${version}";
30 sha256 = "sha256-GEtrC7o5YnkuvBfQQfhG5P74QMiHz63Fdh1cC/r5CF0=";
31 };
32
33 postPatch = ''
34 substituteInPlace pyproject.toml \
35 --replace "docutils>=0.15,<0.19" "docutils>=0.15"
36 '';
37
38 format = "flit";
39
40 nativeBuildInputs = [ flit-core ];
41
42 propagatedBuildInputs = [
43 docutils
44 jinja2
45 mdit-py-plugins
46 markdown-it-py
47 pyyaml
48 sphinx
49 typing-extensions
50 ];
51
52 pythonImportsCheck = [ "myst_parser" ];
53
54 checkInputs = [
55 beautifulsoup4
56 pytest-param-files
57 pytest-regressions
58 sphinx-pytest
59 pytestCheckHook
60 ];
61
62 disabledTests = [
63 # AssertionError due to different files
64 "test_basic"
65 "test_footnotes"
66 "test_gettext_html"
67 "test_fieldlist_extension"
68 # docutils 0.19 expectation mismatches
69 "test_docutils_roles"
70 ];
71
72 meta = with lib; {
73 description = "Sphinx and Docutils extension to parse MyST";
74 homepage = "https://myst-parser.readthedocs.io/";
75 license = licenses.mit;
76 maintainers = with maintainers; [ loicreynier ];
77 };
78}