1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, fetchpatch 5, flit-core 6, pythonOlder 7, docutils 8, jinja2 9, markdown-it-py 10, mdit-py-plugins 11, pyyaml 12, sphinx 13, typing-extensions 14, beautifulsoup4 15, pytest-param-files 16, pytest-regressions 17, sphinx-pytest 18, pytestCheckHook 19}: 20 21buildPythonPackage rec { 22 pname = "myst-parser"; 23 version = "2.0.0"; 24 format = "pyproject"; 25 26 disabled = pythonOlder "3.7"; 27 28 src = fetchFromGitHub { 29 owner = "executablebooks"; 30 repo = pname; 31 rev = "refs/tags/v${version}"; 32 hash = "sha256-1BW7Z+0rs5Up+VZ3vDygnhLzE9Y2BqEMnTnflboweu0="; 33 }; 34 35 patches = [ 36 (fetchpatch { 37 name = "myst-parser-sphinx7.2-compat.patch"; 38 url = "https://github.com/executablebooks/MyST-Parser/commit/4f670fc04c438b57a9d4014be74e9a62cc0deba4.patch"; 39 hash = "sha256-FCvFSsD7qQwqWjSW7R4Gx+E2jaGkifSZqaRbAglt9Yw="; 40 }) 41 ]; 42 43 nativeBuildInputs = [ flit-core ]; 44 45 propagatedBuildInputs = [ 46 docutils 47 jinja2 48 mdit-py-plugins 49 markdown-it-py 50 pyyaml 51 sphinx 52 typing-extensions 53 ]; 54 55 nativeCheckInputs = [ 56 beautifulsoup4 57 pytest-param-files 58 pytest-regressions 59 sphinx-pytest 60 pytestCheckHook 61 ] ++ markdown-it-py.optional-dependencies.linkify; 62 63 pythonImportsCheck = [ 64 "myst_parser" 65 ]; 66 67 disabledTests = [ 68 # AssertionError due to different files 69 "test_basic" 70 "test_footnotes" 71 "test_gettext_html" 72 "test_fieldlist_extension" 73 # docutils 0.19 expectation mismatches 74 "test_docutils_roles" 75 # sphinx 6.0 expectation mismatches 76 "test_sphinx_directives" 77 # sphinx 5.3 expectation mismatches 78 "test_render" 79 "test_includes" 80 ]; 81 82 meta = with lib; { 83 description = "Sphinx and Docutils extension to parse MyST"; 84 homepage = "https://myst-parser.readthedocs.io/"; 85 changelog = "https://raw.githubusercontent.com/executablebooks/MyST-Parser/v${version}/CHANGELOG.md"; 86 license = licenses.mit; 87 maintainers = with maintainers; [ loicreynier ]; 88 }; 89}