2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pythonOlder
|
|
|
|
, configparser
|
|
|
|
, enum34
|
|
|
|
, mccabe
|
|
|
|
, pycodestyle
|
|
|
|
, pyflakes
|
|
|
|
, functools32
|
|
|
|
, typing
|
|
|
|
, importlib-metadata
|
|
|
|
, mock
|
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "flake8";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "4.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "03c7mnk34wfz7a0m5zq0273y94awz69fy5iww8alh4a4v96h6vl0";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace "pyflakes >= 2.3.0, < 2.4.0" "pyflakes >= 2.3.0, < 2.5.0"
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pyflakes
|
|
|
|
pycodestyle
|
|
|
|
mccabe
|
|
|
|
] ++ lib.optionals (pythonOlder "3.2") [
|
|
|
|
configparser
|
|
|
|
functools32
|
|
|
|
] ++ lib.optionals (pythonOlder "3.4") [
|
|
|
|
enum34
|
|
|
|
] ++ lib.optionals (pythonOlder "3.5") [
|
|
|
|
typing
|
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-17 02:12:59 +00:00
|
|
|
# Tests fail on Python 3.7 due to importlib using a deprecated interface
|
|
|
|
doCheck = !(pythonOlder "3.8");
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
checkInputs = [
|
|
|
|
mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-12-06 16:07:01 +00:00
|
|
|
description = "Flake8 is a wrapper around pyflakes, pycodestyle and mccabe.";
|
|
|
|
homepage = "https://github.com/pycqa/flake8";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ];
|
|
|
|
};
|
|
|
|
}
|