Skip to content

Commit

Permalink
Merge pull request #71 from akx/py36
Browse files Browse the repository at this point in the history
Python 3.6 compatibility
  • Loading branch information
akx authored Mar 27, 2017
2 parents 8cb2a3d + 96a8cb6 commit c49e858
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 33 deletions.
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 7 additions & 3 deletions enumfields/enums.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
18 changes: 9 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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='[email protected]',
description='Real Python Enums for Django.',
Expand All @@ -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},
)
28 changes: 12 additions & 16 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit c49e858

Please sign in to comment.