about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/flake8/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/flake8/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/flake8/default.nix60
1 files changed, 43 insertions, 17 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/flake8/default.nix b/nixpkgs/pkgs/development/python-modules/flake8/default.nix
index e40e7e37bbbc..c707cb3caaa1 100644
--- a/nixpkgs/pkgs/development/python-modules/flake8/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/flake8/default.nix
@@ -1,35 +1,61 @@
-{ lib, buildPythonPackage, fetchPypi, pythonOlder
-, mock, pytest, pytest-runner
-, configparser, enum34, mccabe, pycodestyle, pyflakes, functools32, typing ? null, importlib-metadata
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pythonOlder
+, configparser
+, enum34
+, mccabe
+, pycodestyle
+, pyflakes
+, functools32
+, typing
+, importlib-metadata
+, mock
+, pytestCheckHook
 }:
 
 buildPythonPackage rec {
   pname = "flake8";
-  version = "3.9.2";
+  version = "4.0.1";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b6b1d78057c576b";
+    sha256 = "03c7mnk34wfz7a0m5zq0273y94awz69fy5iww8alh4a4v96h6vl0";
   };
 
-  checkInputs = [ pytest mock pytest-runner ];
-  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 ];
+  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
+  ];
 
   # Tests fail on Python 3.7 due to importlib using a deprecated interface
   doCheck = !(pythonOlder "3.8");
 
-  # fixtures fail to initialize correctly
-  checkPhase = ''
-    py.test tests --ignore=tests/integration/test_checker.py
-  '';
+  checkInputs = [
+    mock
+    pytestCheckHook
+  ];
+
+  disabled = pythonOlder "3.6";
 
   meta = with lib; {
-    description = "Code checking using pep8 and pyflakes";
-    homepage = "https://pypi.python.org/pypi/flake8";
+    description = "Flake8 is a wrapper around pyflakes, pycodestyle and mccabe.";
+    homepage = "https://github.com/pycqa/flake8";
     license = licenses.mit;
     maintainers = with maintainers; [ ];
   };