about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pep8-naming/default.nix
blob: a23cce431a099b1510e7f434f7e07adeece4a7be (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
48
{ lib
, fetchPypi
, fetchpatch
, buildPythonPackage
, flake8
, flake8-polyfill
, python
}:

buildPythonPackage rec {
  pname = "pep8-naming";
  version = "0.11.1";

  src = fetchPypi {
    inherit pname version;
    sha256 = "0937rnk3c2z1jkdmbw9hfm80p5k467q7rqhn6slfiprs4kflgpd1";
  };

  patches = [
    (fetchpatch {
      # Fix tests by setting extended-default-ignore to an empty list
      url = "https://github.com/PyCQA/pep8-naming/commit/6d62db81d7967e123e29673a4796fefec6f06d26.patch";
      sha256 = "1jpr2dga8sphksik3izyzq9hiszyki691mwnh2rjzd2vpgnv8cxf";
    })
  ];

  propagatedBuildInputs = [
    flake8
    flake8-polyfill
  ];

  checkPhase = ''
    runHook preCheck
    ${python.interpreter} run_tests.py
    runHook postCheck
  '';

  pythonImportsCheck = [
    "pep8ext_naming"
  ];

  meta = with lib; {
    homepage = "https://github.com/PyCQA/pep8-naming";
    description = "Check PEP-8 naming conventions, plugin for flake8";
    license = licenses.mit;
    maintainers = with maintainers; [ eadwu ];
  };
}