1{ lib
2, aiofiles
3, buildPythonPackage
4, cached-property
5, colorama
6, fetchFromGitHub
7, git
8, jsonschema
9, pdm-backend
10, pytestCheckHook
11, pythonOlder
12}:
13
14buildPythonPackage rec {
15 pname = "griffe";
16 version = "0.29.0";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "mkdocstrings";
23 repo = pname;
24 rev = "refs/tags/${version}";
25 hash = "sha256-WZJogwxhSScJpTFVJaMn6LyIyZtOAxTnY3232NW0bds=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace 'license = "ISC"' 'license = {file = "LICENSE"}' \
31 '';
32
33 nativeBuildInputs = [
34 pdm-backend
35 ];
36
37 propagatedBuildInputs = [
38 colorama
39 ] ++ lib.optionals (pythonOlder "3.8") [
40 cached-property
41 ];
42
43 nativeCheckInputs = [
44 git
45 jsonschema
46 pytestCheckHook
47 ];
48
49 passthru.optional-dependencies = {
50 async = [
51 aiofiles
52 ];
53 };
54
55 pythonImportsCheck = [
56 "griffe"
57 ];
58
59 meta = with lib; {
60 description = "Signatures for entire Python programs";
61 homepage = "https://github.com/mkdocstrings/griffe";
62 changelog = "https://github.com/mkdocstrings/griffe/blob/${version}/CHANGELOG.md";
63 license = licenses.isc;
64 maintainers = with maintainers; [ fab ];
65 };
66}