Skip to content

Commit b982087

Browse files
committed
Add Python 3 support
This change adds support for running this project with Python 3.6. It adds a new configuration to tox that runs tests against Python 3. It also modifies the Travis release script so that built wheels are universal (Python 2 and 3).
1 parent 9ef961a commit b982087

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed

.coveragerc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[run]
2+
source =
3+
ccdb5_ui
4+
5+
omit =
6+
*/wsgi.py
7+
8+
[report]
9+
exclude_lines =
10+
pragma: no cover
11+
if __name__ == .__main__.:

.travis.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
---
2-
language: node_js
2+
language: python
33
python:
4-
- "2.7"
4+
- 2.7
5+
- 3.6
56
install:
6-
- pip install --user tox
7+
- pip install tox-travis
78
script:
89
# The tox tests run the frontend build so no manual npm install is needed.
910
- tox
1011
- npm test
1112
# We don't want changes to package-lock.json to show up as local git
1213
# changes when the Python wheel tag is determined.
1314
- git checkout package-lock.json
14-
- python setup.py bdist_wheel
15+
- python setup.py bdist_wheel --universal
1516
after_script:
1617
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
1718
deploy:

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def read_file(filename):
3232
'Intended Audience :: Developers',
3333
'Programming Language :: Python',
3434
'Programming Language :: Python :: 2.7',
35+
'Programming Language :: Python :: 3.6',
3536
'Framework :: Django',
3637
'Development Status :: 4 - Beta',
3738
'Operating System :: OS Independent',

tox.ini

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
[tox]
22
skipsdist=True
3-
4-
envlist=dj{111}
3+
envlist=py{27,36}-dj{111}
54

65
[testenv]
76
install_command=pip install -e ".[testing]" -U {opts} {packages}
8-
commands=coverage run ./manage.py test
7+
commands=
8+
coverage erase
9+
coverage run ./manage.py test
10+
coverage report --skip-covered
11+
12+
basepython=
13+
py27: python2.7
14+
py36: python3.6
915

1016
deps=
1117
coverage==4.5.1

0 commit comments

Comments
 (0)