python39Packages.flake8-future-import: fix tests

This commit is contained in:
Robert Schütz 2021-07-01 08:54:54 +02:00 committed by Jonathan Ringer
parent f019d3adb2
commit 87f6a8dde5

View file

@ -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 { buildPythonPackage rec {
pname = "flake8-future-import"; pname = "flake8-future-import";
@ -12,16 +20,22 @@ buildPythonPackage rec {
sha256 = "00q8n15xdnvqj454arn7xxksyrzh0dw996kjyy7g9rdk0rf8x82z"; sha256 = "00q8n15xdnvqj454arn7xxksyrzh0dw996kjyy7g9rdk0rf8x82z";
}; };
propagatedBuildInputs = [ flake8 six ] patches = lib.optionals (pythonAtLeast "3.8") [
++ lib.optionals (pythonOlder "3.8") [ ./fix-annotations-version.patch
importlib-metadata ] ++ 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 propagatedBuildInputs = [ flake8 ];
# inside NixPkgs for python 2. Since it's going to be deleted, we just skip it
# on py2 as well. checkInputs = [ six ];
patches = lib.optionals isPy38 [ ./fix-annotations-version.patch ]
++ lib.optionals isPy27 [ ./skip-test.patch ]; checkPhase = ''
${python.interpreter} -m test_flake8_future_import
'';
meta = with lib; { meta = with lib; {
description = "A flake8 extension to check for the imported __future__ modules to make it easier to have a consistent code base"; description = "A flake8 extension to check for the imported __future__ modules to make it easier to have a consistent code base";