Skip to content

Commit

Permalink
Merge pull request #177 from Nabellaleen/fix-enum-backport-requirement
Browse files Browse the repository at this point in the history
Use enum34 backport when Enum is not available
  • Loading branch information
Nabellaleen authored Mar 29, 2019
2 parents 8a2f020 + a61580a commit 7e5c92d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ language: python
matrix:
include:
# Python 2.7
# TODO Fix enum and add back tests for py27
# See https://github.com/graphql-python/graphene-sqlalchemy/pull/177
# - env: TOXENV=py27
# python: 2.7
- env: TOXENV=py27
python: 2.7
# Python 3.5
- env: TOXENV=py34
python: 3.4
Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[aliases]
test=pytest

[flake8]
exclude = setup.py,docs/*,examples/*,tests
max-line-length = 120
Expand Down
22 changes: 14 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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: # Python < 2.7 and Python 3.3
requirements.append("enum34 >= 1.1.6")

tests_require = [
"pytest==4.3.1",
"mock==2.0.0",
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = pre-commit,py{34,35,36,37}-sql{11,12,13}
envlist = pre-commit,py{27,34,35,36,37}-sql{11,12,13}
skipsdist = true
minversion = 3.7.0

Expand Down

0 comments on commit 7e5c92d

Please sign in to comment.