about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/flake8-polyfill/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/flake8-polyfill/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/flake8-polyfill/default.nix37
1 files changed, 26 insertions, 11 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/flake8-polyfill/default.nix b/nixpkgs/pkgs/development/python-modules/flake8-polyfill/default.nix
index 050a6d4f9c8a..60ee3558d1d4 100644
--- a/nixpkgs/pkgs/development/python-modules/flake8-polyfill/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/flake8-polyfill/default.nix
@@ -1,6 +1,12 @@
-{ lib, fetchPypi, buildPythonPackage
+{ lib
+, buildPythonPackage
+, fetchpatch
+, fetchPypi
 , flake8
-, mock, pep8, pytest }:
+, mock
+, pep8
+, pytestCheckHook
+}:
 
 buildPythonPackage rec {
   pname = "flake8-polyfill";
@@ -11,12 +17,6 @@ buildPythonPackage rec {
     sha256 = "1nlf1mkqw856vi6782qcglqhaacb23khk9wkcgn55npnjxshhjz4";
   };
 
-  postPatch = ''
-    # Failed: [pytest] section in setup.cfg files is no longer supported, change to [tool:pytest] instead.
-    substituteInPlace setup.cfg \
-      --replace pytest 'tool:pytest'
-  '';
-
   propagatedBuildInputs = [
     flake8
   ];
@@ -24,13 +24,28 @@ buildPythonPackage rec {
   checkInputs = [
     mock
     pep8
-    pytest
+    pytestCheckHook
+  ];
+
+  patches = [
+    # Skip unnecessary tests on Flake8, https://github.com/PyCQA/pep8-naming/pull/181
+    (fetchpatch {
+      name = "skip-tests.patch";
+      url = "https://github.com/PyCQA/flake8-polyfill/commit/3cf414350e82ceb835ca2edbd5d5967d33e9ff35.patch";
+      sha256 = "mElZafodq8dF3wLO/LOqwFb7eLMsPLlEjNSu5AWqets=";
+    })
   ];
 
-  checkPhase = ''
-    pytest tests
+  postPatch = ''
+    # Failed: [pytest] section in setup.cfg files is no longer supported, change to [tool:pytest] instead.
+    substituteInPlace setup.cfg \
+      --replace pytest 'tool:pytest'
   '';
 
+  pythonImportsCheck = [
+    "flake8_polyfill"
+  ];
+
   meta = with lib; {
     homepage = "https://gitlab.com/pycqa/flake8-polyfill";
     description = "Polyfill package for Flake8 plugins";