From d3528e22ec618dcea946fab4ff0539734a900e81 Mon Sep 17 00:00:00 2001 From: "Markus S. Wamser" Date: Thu, 4 Nov 2021 20:45:08 +0100 Subject: [PATCH] pythonPackages.flake8-future-import: fix build on Python 3.10 --- .../python-modules/flake8-future-import/default.nix | 10 +++++++--- ...rsion.patch => fix-annotations-version-10.patch} | 0 .../fix-annotations-version-11.patch | 13 +++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) rename pkgs/development/python-modules/flake8-future-import/{fix-annotations-version.patch => fix-annotations-version-10.patch} (100%) create mode 100644 pkgs/development/python-modules/flake8-future-import/fix-annotations-version-11.patch diff --git a/pkgs/development/python-modules/flake8-future-import/default.nix b/pkgs/development/python-modules/flake8-future-import/default.nix index 41e9680937db..699d37770a36 100644 --- a/pkgs/development/python-modules/flake8-future-import/default.nix +++ b/pkgs/development/python-modules/flake8-future-import/default.nix @@ -1,8 +1,10 @@ { lib , buildPythonPackage , fetchFromGitHub -, pythonAtLeast , isPy27 +, isPy38 +, isPy39 +, pythonAtLeast , flake8 , six , python @@ -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 diff --git a/pkgs/development/python-modules/flake8-future-import/fix-annotations-version.patch b/pkgs/development/python-modules/flake8-future-import/fix-annotations-version-10.patch similarity index 100% rename from pkgs/development/python-modules/flake8-future-import/fix-annotations-version.patch rename to pkgs/development/python-modules/flake8-future-import/fix-annotations-version-10.patch diff --git a/pkgs/development/python-modules/flake8-future-import/fix-annotations-version-11.patch b/pkgs/development/python-modules/flake8-future-import/fix-annotations-version-11.patch new file mode 100644 index 000000000000..7cbb5e562c33 --- /dev/null +++ b/pkgs/development/python-modules/flake8-future-import/fix-annotations-version-11.patch @@ -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