diff options
author | Robert Schütz <dev@schuetz-co.de> | 2021-07-01 08:54:54 +0200 |
---|---|---|
committer | Jonathan Ringer <jonringer@users.noreply.github.com> | 2021-07-05 12:34:02 -0700 |
commit | 87f6a8dde588084963e0b6e724e2a4e09db46a39 (patch) | |
tree | bc3b7041967046d94e40e7676879937afc6c612f /pkgs/development/python-modules/flake8-future-import | |
parent | f019d3adb27c2754f1c122ea945aa51ea4347819 (diff) | |
download | nixpkgs-87f6a8dde588084963e0b6e724e2a4e09db46a39.tar nixpkgs-87f6a8dde588084963e0b6e724e2a4e09db46a39.tar.gz nixpkgs-87f6a8dde588084963e0b6e724e2a4e09db46a39.tar.bz2 nixpkgs-87f6a8dde588084963e0b6e724e2a4e09db46a39.tar.lz nixpkgs-87f6a8dde588084963e0b6e724e2a4e09db46a39.tar.xz nixpkgs-87f6a8dde588084963e0b6e724e2a4e09db46a39.tar.zst nixpkgs-87f6a8dde588084963e0b6e724e2a4e09db46a39.zip |
python39Packages.flake8-future-import: fix tests
Diffstat (limited to 'pkgs/development/python-modules/flake8-future-import')
-rw-r--r-- | pkgs/development/python-modules/flake8-future-import/default.nix | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/pkgs/development/python-modules/flake8-future-import/default.nix b/pkgs/development/python-modules/flake8-future-import/default.nix index 661b7c71c33..41e9680937d 100644 --- a/pkgs/development/python-modules/flake8-future-import/default.nix +++ b/pkgs/development/python-modules/flake8-future-import/default.nix @@ -1,4 +1,12 @@ -{ lib, isPy27, isPy38, fetchFromGitHub, buildPythonPackage, pythonOlder, fetchpatch, flake8, importlib-metadata, six }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonAtLeast +, isPy27 +, flake8 +, six +, python +}: buildPythonPackage rec { pname = "flake8-future-import"; @@ -12,16 +20,22 @@ buildPythonPackage rec { sha256 = "00q8n15xdnvqj454arn7xxksyrzh0dw996kjyy7g9rdk0rf8x82z"; }; - propagatedBuildInputs = [ flake8 six ] - ++ lib.optionals (pythonOlder "3.8") [ - importlib-metadata - ]; + patches = lib.optionals (pythonAtLeast "3.8") [ + ./fix-annotations-version.patch + ] ++ lib.optionals isPy27 [ + # Upstream disables this test case naturally on python 3, but it also fails + # inside NixPkgs for python 2. Since it's going to be deleted, we just skip it + # on py2 as well. + ./skip-test.patch + ]; - # Upstream disables this test case naturally on python 3, but it also fails - # inside NixPkgs for python 2. Since it's going to be deleted, we just skip it - # on py2 as well. - patches = lib.optionals isPy38 [ ./fix-annotations-version.patch ] - ++ lib.optionals isPy27 [ ./skip-test.patch ]; + propagatedBuildInputs = [ flake8 ]; + + checkInputs = [ six ]; + + checkPhase = '' + ${python.interpreter} -m test_flake8_future_import + ''; meta = with lib; { description = "A flake8 extension to check for the imported __future__ modules to make it easier to have a consistent code base"; |