Skip to content

Commit c49e858

Browse files
authored
Merge pull request #71 from akx/py36
Python 3.6 compatibility
2 parents 8cb2a3d + 96a8cb6 commit c49e858

File tree

4 files changed

+34
-33
lines changed

4 files changed

+34
-33
lines changed

.travis.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
sudo: false
22
language: python
33
python:
4-
- 2.6
5-
- 2.7
6-
- 3.3
7-
- 3.4
8-
- 3.5
4+
- '2.6'
5+
- '2.7'
6+
- '3.3'
7+
- '3.4'
8+
- '3.5'
9+
- '3.6'
910
install:
1011
- pip install -U pip wheel setuptools
1112
- pip install tox tox-travis

enumfields/enums.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import inspect
2-
from enum import Enum as BaseEnum
3-
from enum import EnumMeta as BaseEnumMeta
4-
from enum import _EnumDict
2+
3+
try:
4+
from enum import Enum as BaseEnum
5+
from enum import EnumMeta as BaseEnumMeta
6+
from enum import _EnumDict
7+
except ImportError: # pragma: no cover
8+
raise ImportError('Missing the enum module. Please install enum34.')
59

610
from django.utils.encoding import python_2_unicode_compatible
711

setup.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/usr/bin/env python
22

33
import os
4-
from setuptools import setup, find_packages
5-
from setuptools.command.test import test as TestCommand
64
import sys
75

6+
from setuptools import find_packages, setup
7+
from setuptools.command.test import test as TestCommand
8+
89

910
def read(fname):
1011
return open(os.path.join(os.path.dirname(__file__), fname)).read()
@@ -25,15 +26,10 @@ def run_tests(self):
2526
errno = pytest.main(self.test_args)
2627
sys.exit(errno)
2728

28-
install_requires = ['six']
29-
try:
30-
import enum
31-
except ImportError:
32-
install_requires.append('enum34')
3329

3430
setup(
3531
name='django-enumfields',
36-
version='0.8.2',
32+
version='0.8.3',
3733
author='HZDG',
3834
author_email='[email protected]',
3935
description='Real Python Enums for Django.',
@@ -55,12 +51,16 @@ def run_tests(self):
5551
"Programming Language :: Python :: 3.3",
5652
"Programming Language :: Python :: 3.4",
5753
"Programming Language :: Python :: 3.5",
54+
"Programming Language :: Python :: 3.6",
5855
'Topic :: Internet :: WWW/HTTP',
5956
],
60-
install_requires=install_requires,
57+
install_requires=['six'],
6158
tests_require=[
6259
'pytest-django<3.0',
6360
'Django',
6461
],
62+
extras_require={
63+
':python_version<"3.4"': ['enum34'],
64+
},
6565
cmdclass={'test': PyTest},
6666
)

tox.ini

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
11
[tox]
22
envlist =
3-
python35-django110, python35-django19, python35-django18
4-
python34-django110, python34-django19, python34-django18, python34-django17
5-
python33-django18, python33-django17, python33-django16
6-
python27-django110, python27-django19, python27-django18, python27-django17, python27-django16, python27-django15, python27-django14,
7-
python26-django16, python26-django15, python26-django14
3+
py36-{django110,django19,django18}
4+
py35-{django110,django19,django18}
5+
py34-{django110,django19,django18,django17}
6+
py33-{django18,django17,django16}
7+
py27-{django110,django19,django18,django17,django16,django15,django14}
8+
py26-{django16,django15,django14}
89

910
[tox:travis]
10-
2.6 = python26
11-
2.7 = python27
12-
3.3 = python33
13-
3.4 = python34
14-
3.5 = python35
11+
2.6 = py26
12+
2.7 = py27
13+
3.3 = py33
14+
3.4 = py34
15+
3.5 = py35
16+
3.6 = py36
1517

1618
[testenv]
1719
setenv = PYTHONPATH = {toxinidir}
1820
commands = python setup.py test
19-
basepython =
20-
python26: python2.6
21-
python27: python2.7
22-
python33: python3.3
23-
python34: python3.4
24-
python35: python3.5
2521
deps =
2622
django14: Django>=1.4,<1.5
2723
django15: Django>=1.5,<1.6

0 commit comments

Comments
 (0)