2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
2022-09-30 11:47:45 +00:00
|
|
|
, fetchFromGitHub
|
2023-02-09 11:40:11 +00:00
|
|
|
, poetry-core
|
|
|
|
, charset-normalizer
|
|
|
|
, tomli
|
2022-06-16 17:23:12 +00:00
|
|
|
, untokenize
|
2022-09-30 11:47:45 +00:00
|
|
|
, mock
|
2022-06-16 17:23:12 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "docformatter";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.7.5";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
format = "pyproject";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PyCQA";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-QUjeG84KwI5Y3MU1wrmjHBXU2tEJ0CuiR3Y/S+dX7Gs=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
patches = [
|
|
|
|
./test-path.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'charset_normalizer = "^2.0.0"' 'charset_normalizer = ">=2.0.0"'
|
|
|
|
substituteInPlace tests/conftest.py \
|
|
|
|
--subst-var-by docformatter $out/bin/docformatter
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
propagatedBuildInputs = [
|
2023-02-09 11:40:11 +00:00
|
|
|
charset-normalizer
|
|
|
|
tomli
|
2022-06-16 17:23:12 +00:00
|
|
|
untokenize
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-09-30 11:47:45 +00:00
|
|
|
mock
|
2022-06-16 17:23:12 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "docformatter" ];
|
|
|
|
|
|
|
|
meta = {
|
2023-02-09 11:40:11 +00:00
|
|
|
changelog = "https://github.com/PyCQA/docformatter/blob/${src.rev}/CHANGELOG.md";
|
2022-06-16 17:23:12 +00:00
|
|
|
description = "Formats docstrings to follow PEP 257";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "docformatter";
|
2022-06-16 17:23:12 +00:00
|
|
|
homepage = "https://github.com/myint/docformatter";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|