1{ lib
2, aiofiles
3, buildPythonPackage
4, cached-property
5, colorama
6, fetchFromGitHub
7, git
8, pdm-pep517
9, pytestCheckHook
10, pythonOlder
11}:
12
13buildPythonPackage rec {
14 pname = "griffe";
15 version = "0.24.0";
16 format = "pyproject";
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "mkdocstrings";
22 repo = pname;
23 rev = version;
24 hash = "sha256-Gcht9pmh15dvSHRsG9y82l4HoJ7l/gxbmrRh7Jow2Bs=";
25 };
26
27 postPatch = ''
28 substituteInPlace pyproject.toml \
29 --replace 'dynamic = ["version"]' 'version = "${version}"' \
30 --replace 'license = "ISC"' 'license = {file = "LICENSE"}' \
31 --replace 'version = {source = "scm"}' 'license-expression = "ISC"'
32 '';
33
34 nativeBuildInputs = [
35 pdm-pep517
36 ];
37
38 propagatedBuildInputs = [
39 colorama
40 ] ++ lib.optionals (pythonOlder "3.8") [
41 cached-property
42 ];
43
44 checkInputs = [
45 git
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 license = licenses.isc;
63 maintainers = with maintainers; [ fab ];
64 };
65}