Skip to content

Commit

Permalink
Fix django-model-utils version for running tests in Travis CI; refact…
Browse files Browse the repository at this point in the history
…or setup.py
  • Loading branch information
Dmytro Litvinov committed Feb 14, 2020
1 parent 679764d commit cf3c011
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,25 @@
version = __import__('moderation').__version__

tests_require = [
'unittest2py3k',
'django>=1.11,<2.3',
'django-webtest',
'webtest',
'mock',
'pillow',
]

# ipython>2 is only supported on Python 2.7+
if sys.hexversion < 0x02070000:
tests_require = ['ipython>=0.10,<2'] + tests_require
install_requires = [
'django>=1.11,<2.3',
'django-model-utils'
]

if sys.hexversion >= 0x03000000:
tests_require = ['unittest2py3k'] + tests_require
else:
tests_require = ['unittest2'] + tests_require
# override django-model-utils version in requirements file if DJANGO_VERSION is set
DJANGO_ENV = os.environ.get("DJANGO")
if DJANGO_ENV == 'Django>=1.11,<2.0':
install_requires = [
"django-model-utils<4" if r == "django-model-utils" else r for r in install_requires
]

setup(
name='django-moderation',
Expand Down Expand Up @@ -54,9 +58,6 @@
include_package_data=True,
tests_require=tests_require,
test_suite='runtests.runtests',
install_requires=[
'django>=1.11,<2.3',
'django-model-utils',
],
install_requires=install_requires,
zip_safe=False,
)

0 comments on commit cf3c011

Please sign in to comment.