Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / pydocstyle / default.nix
blobd8207e37b600233e77a31c8200ae5e76615607d4
1 { lib
2 , buildPythonPackage
3 , pythonOlder
4 , fetchFromGitHub
5 , fetchpatch2
6 , poetry-core
7 , snowballstemmer
8 , tomli
9 , pytestCheckHook
12 buildPythonPackage rec {
13   pname = "pydocstyle";
14   version = "6.3.0";
15   pyproject = true;
17   disabled = pythonOlder "3.6";
19   src = fetchFromGitHub {
20     owner = "PyCQA";
21     repo = "pydocstyle";
22     rev = "refs/tags/${version}";
23     hash = "sha256-MjRrnWu18f75OjsYIlOLJK437X3eXnlW8WkkX7vdS6k=";
24   };
26   patches = [
27     # https://github.com/PyCQA/pydocstyle/pull/656
28     (fetchpatch2 {
29       name = "python312-compat.patch";
30       url = "https://github.com/PyCQA/pydocstyle/commit/306c7c8f2d863bdc098a65d2dadbd4703b9b16d5.patch";
31       hash = "sha256-bqnoLz1owzDpFqlZn8z4Z+RzKCYBsI0PqqeOtjLxnMo=";
32     })
33   ];
35   nativeBuildInputs = [
36     poetry-core
37   ];
39   postPatch = ''
40     substituteInPlace pyproject.toml \
41       --replace 'version = "0.0.0-dev"' 'version = "${version}"'
42   '';
44   propagatedBuildInputs = [
45     snowballstemmer
46   ] ++ lib.optionals (pythonOlder "3.11") [
47     tomli
48   ];
50   passthru.optional-dependencies.toml = [
51     tomli
52   ];
54   nativeCheckInputs = [
55     pytestCheckHook
56   ] ++ passthru.optional-dependencies.toml;
58   disabledTestPaths = [
59     "src/tests/test_integration.py" # runs pip install
60   ];
62   meta = with lib; {
63     description = "Python docstring style checker";
64     mainProgram = "pydocstyle";
65     homepage = "https://github.com/PyCQA/pydocstyle";
66     changelog = "https://github.com/PyCQA/pydocstyle/blob/${version}/docs/release_notes.rst";
67     license = licenses.mit;
68     maintainers = with maintainers; [ dzabraev ];
69   };