Skip to content

Commit 7e5c92d

Browse files
authored
Merge pull request #177 from Nabellaleen/fix-enum-backport-requirement
Use enum34 backport when Enum is not available
2 parents 8a2f020 + a61580a commit 7e5c92d

File tree

4 files changed

+20
-13
lines changed

4 files changed

+20
-13
lines changed

.travis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ language: python
22
matrix:
33
include:
44
# Python 2.7
5-
# TODO Fix enum and add back tests for py27
6-
# See https://github.com/graphql-python/graphene-sqlalchemy/pull/177
7-
# - env: TOXENV=py27
8-
# python: 2.7
5+
- env: TOXENV=py27
6+
python: 2.7
97
# Python 3.5
108
- env: TOXENV=py34
119
python: 3.4

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[aliases]
2+
test=pytest
3+
14
[flake8]
25
exclude = setup.py,docs/*,examples/*,tests
36
max-line-length = 120

setup.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@
1010
ast.literal_eval(_version_re.search(f.read().decode("utf-8")).group(1))
1111
)
1212

13+
requirements = [
14+
# To keep things simple, we only support newer versions of Graphene
15+
"graphene>=2.1.3,<3",
16+
# Tests fail with 1.0.19
17+
"SQLAlchemy>=1.1,<2",
18+
"six>=1.10.0,<2",
19+
"singledispatch>=3.4.0.3,<4",
20+
]
21+
try:
22+
import enum
23+
except ImportError: # Python < 2.7 and Python 3.3
24+
requirements.append("enum34 >= 1.1.6")
25+
1326
tests_require = [
1427
"pytest==4.3.1",
1528
"mock==2.0.0",
@@ -42,14 +55,7 @@
4255
],
4356
keywords="api graphql protocol rest relay graphene",
4457
packages=find_packages(exclude=["tests"]),
45-
install_requires=[
46-
# To keep things simple, we only support newer versions of Graphene
47-
"graphene>=2.1.3,<3",
48-
# Tests fail with 1.0.19
49-
"SQLAlchemy>=1.1,<2",
50-
"six>=1.10.0,<2",
51-
"singledispatch>=3.4.0.3,<4",
52-
],
58+
install_requires=requirements,
5359
extras_require={
5460
"dev": [
5561
"tox==3.7.0", # Should be kept in sync with tox.ini

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = pre-commit,py{34,35,36,37}-sql{11,12,13}
2+
envlist = pre-commit,py{27,34,35,36,37}-sql{11,12,13}
33
skipsdist = true
44
minversion = 3.7.0
55

0 commit comments

Comments
 (0)