Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
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.25.1";
16 format = "pyproject";
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "mkdocstrings";
22 repo = pname;
23 rev = "refs/tags/${version}";
24 hash = "sha256-DBjwqQ7tmvpHa0FZYS6Jsb/wQ7cnoynhybBWl9PNejs=";
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 changelog = "https://github.com/mkdocstrings/griffe/blob/${version}/CHANGELOG.md";
63 license = licenses.isc;
64 maintainers = with maintainers; [ fab ];
65 };
66}