nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build-system
8 flit-core,
9
10 # dependencies
11 docutils,
12 jinja2,
13 markdown-it-py,
14 mdit-py-plugins,
15 pyyaml,
16 sphinx,
17 typing-extensions,
18
19 # tests
20 beautifulsoup4,
21 defusedxml,
22 pytest-param-files,
23 pytest-regressions,
24 pytestCheckHook,
25 sphinx-pytest,
26}:
27buildPythonPackage (finalAttrs: {
28 pname = "myst-parser";
29 version = "5.0.0";
30 pyproject = true;
31
32 disabled = pythonOlder "3.11";
33
34 src = fetchFromGitHub {
35 owner = "executablebooks";
36 repo = "myst-parser";
37 tag = "v${finalAttrs.version}";
38 hash = "sha256-0lGejdGVVvZar3sPBbvThXzJML7PcR5+shyDHTTtVEY=";
39 };
40
41 build-system = [ flit-core ];
42
43 pythonRelaxDeps = [
44 "markdown-it-py"
45 ];
46 dependencies = [
47 docutils
48 jinja2
49 markdown-it-py
50 mdit-py-plugins
51 pyyaml
52 sphinx
53 typing-extensions
54 ];
55
56 nativeCheckInputs = [
57 beautifulsoup4
58 defusedxml
59 pytest-param-files
60 pytest-regressions
61 pytestCheckHook
62 sphinx-pytest
63 ]
64 ++ markdown-it-py.optional-dependencies.linkify;
65
66 disabledTestPaths = [
67 # outdated sphinx fixtures
68 "tests/test_renderers/test_fixtures_sphinx.py"
69 ];
70
71 pythonImportsCheck = [ "myst_parser" ];
72
73 meta = {
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/${finalAttrs.src.tag}/CHANGELOG.md";
77 license = lib.licenses.mit;
78 maintainers = with lib.maintainers; [ loicreynier ];
79 };
80})