From b62d7f3e84cc648dbfca070c61831f4a650b74c9 Mon Sep 17 00:00:00 2001 From: Florian Briand Date: Mon, 26 Nov 2018 10:44:43 +0100 Subject: [PATCH] Use enum34 backport when Enum is not available --- setup.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index cfbae111..175bd20f 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,19 @@ ast.literal_eval(_version_re.search(f.read().decode("utf-8")).group(1)) ) +requirements = [ + # To keep things simple, we only support newer versions of Graphene + "graphene>=2.1.3,<3", + # Tests fail with 1.0.19 + "SQLAlchemy>=1.1,<2", + "six>=1.10.0,<2", + "singledispatch>=3.4.0.3,<4", +] +try: + import Enum +except ImportError: + requirements.append("enum34 >= 1.1.6") + tests_require = [ "pytest==4.3.1", "mock==2.0.0", @@ -42,14 +55,7 @@ ], keywords="api graphql protocol rest relay graphene", packages=find_packages(exclude=["tests"]), - install_requires=[ - # To keep things simple, we only support newer versions of Graphene - "graphene>=2.1.3,<3", - # Tests fail with 1.0.19 - "SQLAlchemy>=1.1,<2", - "six>=1.10.0,<2", - "singledispatch>=3.4.0.3,<4", - ], + install_requires=requirements, extras_require={ "dev": [ "tox==3.7.0", # Should be kept in sync with tox.ini