1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 importlib-metadata,
6 jinja2,
7 markdown,
8 markupsafe,
9 mkdocs,
10 mkdocs-autorefs,
11 pdm-backend,
12 pymdown-extensions,
13 pytestCheckHook,
14 pythonOlder,
15 dirty-equals,
16}:
17
18buildPythonPackage rec {
19 pname = "mkdocstrings";
20 version = "0.29.1";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "mkdocstrings";
25 repo = "mkdocstrings";
26 tag = version;
27 hash = "sha256-i3rGPKptsFD/IE4vGpWC0HTKoqAtjQ6gkVhZbfYn2bo=";
28 };
29
30 postPatch = ''
31 substituteInPlace pyproject.toml \
32 --replace-fail 'dynamic = ["version"]' 'version = "${version}"'
33 '';
34
35 build-system = [ pdm-backend ];
36
37 dependencies =
38 [
39 jinja2
40 markdown
41 markupsafe
42 mkdocs
43 mkdocs-autorefs
44 pymdown-extensions
45 ]
46 ++ lib.optionals (pythonOlder "3.10") [
47 importlib-metadata
48 ];
49
50 nativeCheckInputs = [
51 pytestCheckHook
52 dirty-equals
53 ];
54
55 pythonImportsCheck = [ "mkdocstrings" ];
56
57 disabledTestPaths = [
58 # Circular dependencies
59 "tests/test_api.py"
60 "tests/test_extension.py"
61 ];
62
63 disabledTests = [
64 # Not all requirements are available
65 "test_disabling_plugin"
66 # Circular dependency on mkdocstrings-python
67 "test_extended_templates"
68 "test_nested_autodoc[ext_markdown0]"
69 ];
70
71 meta = {
72 description = "Automatic documentation from sources for MkDocs";
73 homepage = "https://github.com/mkdocstrings/mkdocstrings";
74 changelog = "https://github.com/mkdocstrings/mkdocstrings/blob/${version}/CHANGELOG.md";
75 license = lib.licenses.isc;
76 maintainers = with lib.maintainers; [ fab ];
77 };
78}