1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, griffe
5, mkdocs-material
6, mkdocstrings
7, pdm-backend
8, pytestCheckHook
9, pythonOlder
10}:
11
12buildPythonPackage rec {
13 pname = "mkdocstrings-python";
14 version = "0.10.1";
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-VGPlOHQNtXrfmcne93xDIxN20KDGlTQrjeAKhX/L6K0=";
24 };
25
26 nativeBuildInputs = [
27 pdm-backend
28 ];
29
30 propagatedBuildInputs = [
31 griffe
32 mkdocstrings
33 ];
34
35 nativeCheckInputs = [
36 mkdocs-material
37 pytestCheckHook
38 ];
39
40 postPatch = ''
41 substituteInPlace pyproject.toml \
42 --replace 'license = "ISC"' 'license = {text = "ISC"}' \
43 '';
44
45 pythonImportsCheck = [
46 "mkdocstrings_handlers"
47 ];
48
49 meta = with lib; {
50 description = "Python handler for mkdocstrings";
51 homepage = "https://github.com/mkdocstrings/python";
52 changelog = "https://github.com/mkdocstrings/python/blob/${version}/CHANGELOG.md";
53 license = licenses.isc;
54 maintainers = with maintainers; [ fab ];
55 };
56}