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-04-12 12:48:02 +00:00
|
|
|
version = "1.6.0";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
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-04-12 12:48:02 +00:00
|
|
|
hash = "sha256-CzfJk8EkUKPGIJwaDC/IT4CDCJpQI7XEZFnH+RahURI=";
|
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";
|
|
|
|
homepage = "https://github.com/myint/docformatter";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|