about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pep8-naming/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pep8-naming/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/pep8-naming/default.nix29
1 files changed, 25 insertions, 4 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pep8-naming/default.nix b/nixpkgs/pkgs/development/python-modules/pep8-naming/default.nix
index 5f6ef894d8ff..a23cce431a09 100644
--- a/nixpkgs/pkgs/development/python-modules/pep8-naming/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/pep8-naming/default.nix
@@ -1,6 +1,10 @@
-{ lib, fetchPypi, buildPythonPackage, pythonOlder
+{ lib
+, fetchPypi
+, fetchpatch
+, buildPythonPackage
+, flake8
 , flake8-polyfill
-, importlib-metadata
+, python
 }:
 
 buildPythonPackage rec {
@@ -12,10 +16,27 @@ buildPythonPackage rec {
     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
-  ] ++ lib.optionals (pythonOlder "3.8") [
-    importlib-metadata
+  ];
+
+  checkPhase = ''
+    runHook preCheck
+    ${python.interpreter} run_tests.py
+    runHook postCheck
+  '';
+
+  pythonImportsCheck = [
+    "pep8ext_naming"
   ];
 
   meta = with lib; {