summary refs log tree commit diff
path: root/pkgs/development/python-modules/pycodestyle/default.nix
blob: cdbec277008068dd4395368acfd509875dbb015d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ buildPythonPackage
, pythonOlder
, fetchPypi
, lib
, python
}:

buildPythonPackage rec {
  pname = "pycodestyle";
  version = "2.10.0";

  disabled = pythonOlder "3.6";

  format = "setuptools";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-NHGHvbR2Mp2Y9pXCE9cpWoRtEVL/T+m6y4qVkLjucFM=";
  };

  patches = [
    # https://github.com/PyCQA/pycodestyle/issues/1151
    # Applies a modified version of an upstream patch that only applied
    # to Python 3.12.
    ./python-3.11.4-compat.patch
  ];

  # https://github.com/PyCQA/pycodestyle/blob/2.10.0/tox.ini#L13
  checkPhase = ''
    ${python.interpreter} -m pycodestyle --statistics pycodestyle.py
    ${python.interpreter} -m pycodestyle --max-doc-length=72 --testsuite testsuite
    ${python.interpreter} -m pycodestyle --max-doc-length=72 --doctest
    ${python.interpreter} -m unittest discover testsuite -vv
  '';

  pythonImportsCheck = [ "pycodestyle" ];

  meta = with lib; {
    changelog = "https://github.com/PyCQA/pycodestyle/blob/${version}/CHANGES.txt";
    description = "Python style guide checker";
    homepage = "https://pycodestyle.pycqa.org/";
    license = licenses.mit;
    maintainers = with maintainers; [
      kamadorueda
    ];
  };
}