2022-07-14 12:49:19 +00:00
|
|
|
{ lib
|
|
|
|
, aiofiles
|
2022-10-30 15:09:59 +00:00
|
|
|
, buildPythonPackage
|
2022-07-14 12:49:19 +00:00
|
|
|
, cached-property
|
2022-11-21 17:40:18 +00:00
|
|
|
, colorama
|
2022-07-14 12:49:19 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, git
|
|
|
|
, pdm-pep517
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
}:
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
buildPythonPackage rec {
|
2022-07-14 12:49:19 +00:00
|
|
|
pname = "griffe";
|
2023-02-22 10:55:15 +00:00
|
|
|
version = "0.25.5";
|
2022-07-14 12:49:19 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mkdocstrings";
|
|
|
|
repo = pname;
|
2022-11-27 09:42:12 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-02-22 10:55:15 +00:00
|
|
|
hash = "sha256-0+n5v93ERcQDKNtXxSZYfCUMTRzcbtQEXl023KSxfrE=";
|
2022-07-14 12:49:19 +00:00
|
|
|
};
|
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'dynamic = ["version"]' 'version = "${version}"' \
|
|
|
|
--replace 'license = "ISC"' 'license = {file = "LICENSE"}' \
|
|
|
|
--replace 'version = {source = "scm"}' 'license-expression = "ISC"'
|
|
|
|
'';
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pdm-pep517
|
|
|
|
];
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
colorama
|
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
2022-07-14 12:49:19 +00:00
|
|
|
cached-property
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-07-14 12:49:19 +00:00
|
|
|
git
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
passthru.optional-dependencies = {
|
|
|
|
async = [
|
|
|
|
aiofiles
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"griffe"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Signatures for entire Python programs";
|
|
|
|
homepage = "https://github.com/mkdocstrings/griffe";
|
2022-11-27 09:42:12 +00:00
|
|
|
changelog = "https://github.com/mkdocstrings/griffe/blob/${version}/CHANGELOG.md";
|
2022-07-14 12:49:19 +00:00
|
|
|
license = licenses.isc;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|