2020-10-14 23:48:59 +00:00
|
|
|
{ lib, isPy27, isPy38, fetchFromGitHub, buildPythonPackage, pythonOlder, fetchpatch, flake8, importlib-metadata, six }:
|
2017-09-20 14:53:04 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "flake8-future-import";
|
2020-03-23 01:04:17 +00:00
|
|
|
version = "0.4.6";
|
2018-04-17 15:23:52 +00:00
|
|
|
|
2017-09-20 14:53:04 +00:00
|
|
|
# PyPI tarball doesn't include the test suite
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xZise";
|
|
|
|
repo = "flake8-future-import";
|
|
|
|
rev = version;
|
2020-03-23 01:04:17 +00:00
|
|
|
sha256 = "00q8n15xdnvqj454arn7xxksyrzh0dw996kjyy7g9rdk0rf8x82z";
|
2017-09-20 14:53:04 +00:00
|
|
|
};
|
2017-09-23 15:39:04 +00:00
|
|
|
|
2020-06-08 19:46:02 +00:00
|
|
|
propagatedBuildInputs = [ flake8 six ]
|
|
|
|
++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
|
|
|
];
|
2018-04-17 15:23:52 +00:00
|
|
|
|
2020-03-23 01:04:17 +00:00
|
|
|
# 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.
|
2020-10-14 23:48:59 +00:00
|
|
|
patches = lib.optionals isPy38 [ ./fix-annotations-version.patch ]
|
|
|
|
++ lib.optionals isPy27 [ ./skip-test.patch ];
|
2020-03-23 01:04:17 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2017-09-20 14:53:04 +00:00
|
|
|
description = "A flake8 extension to check for the imported __future__ modules to make it easier to have a consistent code base";
|
2020-03-23 01:04:17 +00:00
|
|
|
homepage = "https://github.com/xZise/flake8-future-import";
|
|
|
|
license = licenses.mit;
|
2017-09-20 14:53:04 +00:00
|
|
|
};
|
|
|
|
}
|