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 = "1.0.0";
23 format = "pyproject";
24
25 disabled = pythonOlder "3.7";
26
27 src = fetchFromGitHub {
28 owner = "executablebooks";
29 repo = pname;
30 rev = "refs/tags/v${version}";
31 hash = "sha256-Kewd6/4yawpRuyCe8Na0BGUMo59tr2fc97VlGbVJ8mI=";
32 };
33
34 nativeBuildInputs = [ flit-core ];
35
36 propagatedBuildInputs = [
37 docutils
38 jinja2
39 mdit-py-plugins
40 markdown-it-py
41 pyyaml
42 sphinx
43 typing-extensions
44 ];
45
46 nativeCheckInputs = [
47 beautifulsoup4
48 pytest-param-files
49 pytest-regressions
50 sphinx-pytest
51 pytestCheckHook
52 ] ++ markdown-it-py.optional-dependencies.linkify;
53
54 pythonImportsCheck = [
55 "myst_parser"
56 ];
57
58 disabledTests = [
59 # AssertionError due to different files
60 "test_basic"
61 "test_footnotes"
62 "test_gettext_html"
63 "test_fieldlist_extension"
64 # docutils 0.19 expectation mismatches
65 "test_docutils_roles"
66 # sphinx 6.0 expectation mismatches
67 "test_sphinx_directives"
68 # sphinx 5.3 expectation mismatches
69 "test_render"
70 "test_includes"
71 ];
72
73 meta = with lib; {
74 description = "Sphinx and Docutils extension to parse MyST";
75 homepage = "https://myst-parser.readthedocs.io/";
76 changelog = "https://raw.githubusercontent.com/executablebooks/MyST-Parser/v${version}/CHANGELOG.md";
77 license = licenses.mit;
78 maintainers = with maintainers; [ loicreynier ];
79 };
80}