Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python310Packages.flake8-future-import: fix build #144650

Merged
merged 4 commits into from
Nov 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions pkgs/development/python-modules/flake8-future-import/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonAtLeast
, isPy27
, isPy38
, isPy39
, pythonAtLeast
, flake8
, six
, python
Expand All @@ -20,8 +22,10 @@ buildPythonPackage rec {
sha256 = "00q8n15xdnvqj454arn7xxksyrzh0dw996kjyy7g9rdk0rf8x82z";
};

patches = lib.optionals (pythonAtLeast "3.8") [
./fix-annotations-version.patch
patches = lib.optionals (pythonAtLeast "3.10") [
./fix-annotations-version-11.patch
] ++ lib.optionals (isPy38 || isPy39) [
./fix-annotations-version-10.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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/flake8_future_import.py b/flake8_future_import.py
index 92c3fda..27a1a66 100755
--- a/flake8_future_import.py
+++ b/flake8_future_import.py
@@ -76,7 +76,7 @@ UNICODE_LITERALS = Feature(4, 'unicode_literals', (2, 6, 0), (3, 0, 0))
GENERATOR_STOP = Feature(5, 'generator_stop', (3, 5, 0), (3, 7, 0))
NESTED_SCOPES = Feature(6, 'nested_scopes', (2, 1, 0), (2, 2, 0))
GENERATORS = Feature(7, 'generators', (2, 2, 0), (2, 3, 0))
-ANNOTATIONS = Feature(8, 'annotations', (3, 7, 0), (4, 0, 0))
+ANNOTATIONS = Feature(8, 'annotations', (3, 7, 0), (3, 11, 0))


# Order important as it defines the error code
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/flake8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

buildPythonPackage rec {
pname = "flake8";
version = "3.9.2";
version = "4.0.1";

src = fetchPypi {
inherit pname version;
sha256 = "07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b6b1d78057c576b";
sha256 = "03c7mnk34wfz7a0m5zq0273y94awz69fy5iww8alh4a4v96h6vl0";
};

postPatch = ''
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/pycodestyle/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

buildPythonPackage rec {
pname = "pycodestyle";
version = "2.7.0";
version = "2.8.0";

src = fetchPypi {
inherit pname version;
sha256 = "c389c1d06bf7904078ca03399a4816f974a1d590090fecea0c63ec26ebaf1cef";
sha256 = "0zxyrg8029lzjhima6l5nk6y0z6lm5wfp9qchz3s33j3xx3mipgd";
};

dontUseSetuptoolsCheck = true;
Expand Down
12 changes: 11 additions & 1 deletion pkgs/development/python-modules/pytest-flake8/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{lib, buildPythonPackage, fetchPypi, pytest, flake8}:
{lib, buildPythonPackage, fetchPypi, pythonOlder, fetchpatch, pytest, flake8}:

buildPythonPackage rec {
pname = "pytest-flake8";
version = "1.0.7";

disabled = pythonOlder "3.5";

# although pytest is a runtime dependency, do not add it as
# propagatedBuildInputs in order to allow packages depend on another version
# of pytest more easily
Expand All @@ -15,6 +17,14 @@ buildPythonPackage rec {
sha256 = "f0259761a903563f33d6f099914afef339c085085e643bee8343eb323b32dd6b";
};

# see https://github.com/tholo/pytest-flake8/pull/82/commits
patches = [
(fetchpatch {
url = "https://github.com/tholo/pytest-flake8/commit/eda4ef74c0f25b856fe282742ea206b21e94c24c.patch";
sha256 = "001ciy19dhsqa88rhb2b51g5sb0k4s3pz0zk2a191rnib65ll07x";
})
];

checkPhase = ''
pytest .
'';
Expand Down