Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / docformatter / default.nix
blob517b777735d78a388533e893ec5d2f6c07a03cc1
1 { lib
2 , buildPythonPackage
3 , pythonOlder
4 , fetchFromGitHub
5 , poetry-core
6 , charset-normalizer
7 , tomli
8 , untokenize
9 , mock
10 , pytestCheckHook
13 buildPythonPackage rec {
14   pname = "docformatter";
15   version = "1.7.5";
17   disabled = pythonOlder "3.7";
19   format = "pyproject";
21   src = fetchFromGitHub {
22     owner = "PyCQA";
23     repo = pname;
24     rev = "refs/tags/v${version}";
25     hash = "sha256-QUjeG84KwI5Y3MU1wrmjHBXU2tEJ0CuiR3Y/S+dX7Gs=";
26   };
28   patches = [
29     ./test-path.patch
30   ];
32   postPatch = ''
33     substituteInPlace pyproject.toml \
34       --replace 'charset_normalizer = "^2.0.0"' 'charset_normalizer = ">=2.0.0"'
35     substituteInPlace tests/conftest.py \
36       --subst-var-by docformatter $out/bin/docformatter
37   '';
39   nativeBuildInputs = [
40     poetry-core
41   ];
43   propagatedBuildInputs = [
44     charset-normalizer
45     tomli
46     untokenize
47   ];
49   nativeCheckInputs = [
50     mock
51     pytestCheckHook
52   ];
54   pythonImportsCheck = [ "docformatter" ];
56   meta = {
57     changelog = "https://github.com/PyCQA/docformatter/blob/${src.rev}/CHANGELOG.md";
58     description = "Formats docstrings to follow PEP 257";
59     mainProgram = "docformatter";
60     homepage = "https://github.com/myint/docformatter";
61     license = lib.licenses.mit;
62     maintainers = with lib.maintainers; [ dotlambda ];
63   };