summary refs log tree commit diff
path: root/pkgs/development/python-modules/flake8/default.nix
blob: 9d9d211dbfae1dd1c8774d75482b0a16873ab302 (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
49
50
51
52
53
54
55
56
57
{ stdenv, buildPythonPackage, fetchPypi, pythonOlder, fetchpatch
, mock, pytest, pytestrunner
, configparser, enum34, mccabe, pycodestyle, pyflakes
}:

buildPythonPackage rec {
  pname = "flake8";
  version = "3.5.0";

  src = fetchPypi {
    inherit pname version;
    sha256 = "7253265f7abd8b313e3892944044a365e3f4ac3fcdcfb4298f55ee9ddf188ba0";
  };

  # Allow newer version of pycodestyle and pyflakes
  patches = [
    (fetchpatch {
      url = https://gitlab.com/pycqa/flake8/commit/4fcbcccf381ce0987faa297173e4008b0490918f.patch;
      sha256 = "0lfsg9n92fc8whj29paqsx7ifap2szv7pxj13hy739y87gsps676";
      excludes = [ "setup.cfg" ];
    })
    (fetchpatch {
      url = https://gitlab.com/pycqa/flake8/commit/0273ca561f0ad03adff41ce5d95a1ec31b10fe5a.patch;
      sha256 = "1ziy54v1cm7gn7a551qvrl0rs16q8zpzh303xf5gn4rxxz13qnzb";
      excludes = [ "setup.cfg" ];
    })
    (fetchpatch {
      url = https://gitlab.com/pycqa/flake8/commit/85c503de32f81ed9859d902cbe20eb4d2e4e8d55.patch;
      sha256 = "0170hjaxkq5ssva9rwkcgm4whb07fnxdb0z12gzmvw5w53hkqxj4";
    })
    (fetchpatch {
      url = https://gitlab.com/pycqa/flake8/commit/68782675b7f00c5d24c24e424efd1fbcb0705224.patch;
      sha256 = "183lcw7aqv5yzm8pfisrfngq3fchc7h3j7254c5hy2hqq653v98s";
    })
    (fetchpatch {
      url = https://gitlab.com/pycqa/flake8/commit/ef1d5ceefcbfacf5dfe94534c4879ca814b130f0.patch;
      sha256 = "1j5f0l4xryfhirixwjcl1lzayjhy6vhkizkpm7w87piylim8y26y";
    })
    (fetchpatch {
      url = https://gitlab.com/pycqa/flake8/commit/527af5c214ef0eccfde3dd58d7ea15e09c483bd3.patch;
      sha256 = "1y51r78770z27d43v64lrg8zvm39ycszzhh15cx8wq8wp3b7iz5x";
      excludes = [ "setup.cfg" ];
    })
  ];

  buildInputs = [ pytest mock pytestrunner ];
  propagatedBuildInputs = [ pyflakes pycodestyle mccabe ]
    ++ stdenv.lib.optionals (pythonOlder "3.4") [ enum34 ]
    ++ stdenv.lib.optionals (pythonOlder "3.2") [ configparser ];

  meta = with stdenv.lib; {
    description = "Code checking using pep8 and pyflakes";
    homepage = https://pypi.python.org/pypi/flake8;
    license = licenses.mit;
    maintainers = with maintainers; [ garbas ];
  };
}