1{ stdenv, buildPythonPackage, fetchPypi, pythonOlder, fetchpatch
2, mock, pytest, pytestrunner
3, configparser, enum34, mccabe, pycodestyle, pyflakes
4}:
5
6buildPythonPackage rec {
7 pname = "flake8";
8 version = "3.5.0";
9
10 src = fetchPypi {
11 inherit pname version;
12 sha256 = "7253265f7abd8b313e3892944044a365e3f4ac3fcdcfb4298f55ee9ddf188ba0";
13 };
14
15 # Allow newer version of pycodestyle and pyflakes
16 patches = [
17 (fetchpatch {
18 url = https://gitlab.com/pycqa/flake8/commit/4fcbcccf381ce0987faa297173e4008b0490918f.patch;
19 sha256 = "0lfsg9n92fc8whj29paqsx7ifap2szv7pxj13hy739y87gsps676";
20 excludes = [ "setup.cfg" ];
21 })
22 (fetchpatch {
23 url = https://gitlab.com/pycqa/flake8/commit/0273ca561f0ad03adff41ce5d95a1ec31b10fe5a.patch;
24 sha256 = "1ziy54v1cm7gn7a551qvrl0rs16q8zpzh303xf5gn4rxxz13qnzb";
25 excludes = [ "setup.cfg" ];
26 })
27 (fetchpatch {
28 url = https://gitlab.com/pycqa/flake8/commit/85c503de32f81ed9859d902cbe20eb4d2e4e8d55.patch;
29 sha256 = "0170hjaxkq5ssva9rwkcgm4whb07fnxdb0z12gzmvw5w53hkqxj4";
30 })
31 (fetchpatch {
32 url = https://gitlab.com/pycqa/flake8/commit/68782675b7f00c5d24c24e424efd1fbcb0705224.patch;
33 sha256 = "183lcw7aqv5yzm8pfisrfngq3fchc7h3j7254c5hy2hqq653v98s";
34 })
35 (fetchpatch {
36 url = https://gitlab.com/pycqa/flake8/commit/ef1d5ceefcbfacf5dfe94534c4879ca814b130f0.patch;
37 sha256 = "1j5f0l4xryfhirixwjcl1lzayjhy6vhkizkpm7w87piylim8y26y";
38 })
39 (fetchpatch {
40 url = https://gitlab.com/pycqa/flake8/commit/527af5c214ef0eccfde3dd58d7ea15e09c483bd3.patch;
41 sha256 = "1y51r78770z27d43v64lrg8zvm39ycszzhh15cx8wq8wp3b7iz5x";
42 excludes = [ "setup.cfg" ];
43 })
44 ];
45
46 buildInputs = [ pytest mock pytestrunner ];
47 propagatedBuildInputs = [ pyflakes pycodestyle mccabe ]
48 ++ stdenv.lib.optionals (pythonOlder "3.4") [ enum34 ]
49 ++ stdenv.lib.optionals (pythonOlder "3.2") [ configparser ];
50
51 meta = with stdenv.lib; {
52 description = "Code checking using pep8 and pyflakes";
53 homepage = https://pypi.python.org/pypi/flake8;
54 license = licenses.mit;
55 maintainers = with maintainers; [ garbas ];
56 };
57}