diff --git a/.travis.yml b/.travis.yml index 2c0963b..9d36276 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,12 @@ sudo: false language: python python: - - 2.6 - - 2.7 - - 3.3 - - 3.4 - - 3.5 + - '2.6' + - '2.7' + - '3.3' + - '3.4' + - '3.5' + - '3.6' install: - pip install -U pip wheel setuptools - pip install tox tox-travis diff --git a/enumfields/enums.py b/enumfields/enums.py index 3260b21..5324071 100644 --- a/enumfields/enums.py +++ b/enumfields/enums.py @@ -1,7 +1,11 @@ import inspect -from enum import Enum as BaseEnum -from enum import EnumMeta as BaseEnumMeta -from enum import _EnumDict + +try: + from enum import Enum as BaseEnum + from enum import EnumMeta as BaseEnumMeta + from enum import _EnumDict +except ImportError: # pragma: no cover + raise ImportError('Missing the enum module. Please install enum34.') from django.utils.encoding import python_2_unicode_compatible diff --git a/setup.py b/setup.py index f581ac9..cbc3dd8 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,11 @@ #!/usr/bin/env python import os -from setuptools import setup, find_packages -from setuptools.command.test import test as TestCommand import sys +from setuptools import find_packages, setup +from setuptools.command.test import test as TestCommand + def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() @@ -25,15 +26,10 @@ def run_tests(self): errno = pytest.main(self.test_args) sys.exit(errno) -install_requires = ['six'] -try: - import enum -except ImportError: - install_requires.append('enum34') setup( name='django-enumfields', - version='0.8.2', + version='0.8.3', author='HZDG', author_email='webmaster@hzdg.com', description='Real Python Enums for Django.', @@ -55,12 +51,16 @@ def run_tests(self): "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", 'Topic :: Internet :: WWW/HTTP', ], - install_requires=install_requires, + install_requires=['six'], tests_require=[ 'pytest-django<3.0', 'Django', ], + extras_require={ + ':python_version<"3.4"': ['enum34'], + }, cmdclass={'test': PyTest}, ) diff --git a/tox.ini b/tox.ini index c0282d9..2ea6a28 100644 --- a/tox.ini +++ b/tox.ini @@ -1,27 +1,23 @@ [tox] envlist = - python35-django110, python35-django19, python35-django18 - python34-django110, python34-django19, python34-django18, python34-django17 - python33-django18, python33-django17, python33-django16 - python27-django110, python27-django19, python27-django18, python27-django17, python27-django16, python27-django15, python27-django14, - python26-django16, python26-django15, python26-django14 + py36-{django110,django19,django18} + py35-{django110,django19,django18} + py34-{django110,django19,django18,django17} + py33-{django18,django17,django16} + py27-{django110,django19,django18,django17,django16,django15,django14} + py26-{django16,django15,django14} [tox:travis] -2.6 = python26 -2.7 = python27 -3.3 = python33 -3.4 = python34 -3.5 = python35 +2.6 = py26 +2.7 = py27 +3.3 = py33 +3.4 = py34 +3.5 = py35 +3.6 = py36 [testenv] setenv = PYTHONPATH = {toxinidir} commands = python setup.py test -basepython = - python26: python2.6 - python27: python2.7 - python33: python3.3 - python34: python3.4 - python35: python3.5 deps = django14: Django>=1.4,<1.5 django15: Django>=1.5,<1.6