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