1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, griffe
5, mkdocs-material
6, mkdocstrings
7, pdm-pep517
8, pytestCheckHook
9, pythonOlder
10}:
11
12buildPythonPackage rec {
13 pname = "mkdocstrings-python";
14 version = "0.8.0";
15 format = "pyproject";
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "mkdocstrings";
21 repo = "python";
22 rev = version;
23 hash = "sha256-KAVBK0ZR1R27cWH99DVOYNFWKa4ubBXzgM0hVpGRIpE=";
24 };
25
26 nativeBuildInputs = [
27 pdm-pep517
28 ];
29
30 propagatedBuildInputs = [
31 griffe
32 mkdocstrings
33 ];
34
35 checkInputs = [
36 mkdocs-material
37 pytestCheckHook
38 ];
39
40 postPatch = ''
41 substituteInPlace pyproject.toml \
42 --replace 'license = "ISC"' 'license = {text = "ISC"}' \
43 --replace 'dynamic = ["version"]' 'version = "${version}"'
44 '';
45
46 pythonImportsCheck = [
47 "mkdocstrings_handlers"
48 ];
49
50 meta = with lib; {
51 description = "Python handler for mkdocstrings";
52 homepage = "https://github.com/mkdocstrings/python";
53 license = licenses.isc;
54 maintainers = with maintainers; [ fab ];
55 };
56}