File python37.patch of Package python-flake8-future-import

From cace194a44d3b95c9c1ed96640bae49183acca04 Mon Sep 17 00:00:00 2001
From: Mario Rodas <marsam@users.noreply.github.com>
Date: Wed, 5 Dec 2018 19:15:58 -0500
Subject: [PATCH] Add "annotation" feature

Python 3.7 introduced "annotations" feature. See
https://docs.python.org/3/whatsnew/3.7.html#pep-563-postponed-evaluation-of-annotations
---
 flake8_future_import.py      | 3 ++-
 test_flake8_future_import.py | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/flake8_future_import.py b/flake8_future_import.py
index 7bd1bbe..2c4b918 100755
--- a/flake8_future_import.py
+++ b/flake8_future_import.py
@@ -76,11 +76,12 @@ def add_arguments(cls, parser):
 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))
 
 
 # Order important as it defines the error code
 ALL_FEATURES = (DIVISION, ABSOLUTE_IMPORT, WITH_STATEMENT, PRINT_FUNCTION,
-                UNICODE_LITERALS, GENERATOR_STOP, NESTED_SCOPES, GENERATORS)
+                UNICODE_LITERALS, GENERATOR_STOP, NESTED_SCOPES, GENERATORS, ANNOTATIONS)
 FEATURES = dict((feature.name, feature) for feature in ALL_FEATURES)
 FEATURE_NAMES = frozenset(feature.name for feature in ALL_FEATURES)
 # Make sure the features aren't messed up
diff --git a/test_flake8_future_import.py b/test_flake8_future_import.py
index 1083ea4..84fde59 100644
--- a/test_flake8_future_import.py
+++ b/test_flake8_future_import.py
@@ -135,14 +135,14 @@ def test_mandatory_and_unavailable(self):
         """Do not care about already mandatory or not yet available features."""
         self.run_checker(
             (2, 6, 0),
-            set(['nested_scopes', 'generators', 'with_statement', 'generator_stop']),
+            set(['nested_scopes', 'generators', 'with_statement', 'generator_stop', 'annotations']),
             ('unicode_literals', ))
 
     def test_use_of_unavailable(self):
         """Use an import which is to new for the minimum version."""
         self.run_checker(
             (2, 6, 0),
-            set(['nested_scopes', 'generators', 'with_statement']),
+            set(['nested_scopes', 'generators', 'with_statement', 'annotations']),
             ('generator_stop', ))
 
 
openSUSE Build Service is sponsored by