Skip to content

Commit

Permalink
Add Python 3 support
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
chosak committed Mar 29, 2019
1 parent 97c9ea3 commit e09c2c7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
11 changes: 11 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[run]
source =
ccdb5_ui

omit =
*/wsgi.py

[report]
exclude_lines =
pragma: no cover
if __name__ == .__main__.:
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
---
language: node_js
language: python
python:
- "2.7"
- 2.7
- 3.6
install:
- pip install --user tox
- pip install tox-travis
script:
# The tox tests run the frontend build so no manual npm install is needed.
- tox
- npm test
# We don't want changes to package-lock.json to show up as local git
# changes when the Python wheel tag is determined.
- git checkout package-lock.json
- python setup.py bdist_wheel
- python setup.py bdist_wheel --universal
after_script:
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
deploy:
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def read_file(filename):
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
'Framework :: Django',
'Development Status :: 4 - Beta',
'Operating System :: OS Independent',
Expand Down
12 changes: 9 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
[tox]
skipsdist=True

envlist=dj{111}
envlist=py{27,36}-dj{111}

[testenv]
install_command=pip install -e ".[testing]" -U {opts} {packages}
commands=coverage run ./manage.py test
commands=
coverage erase
coverage run ./manage.py test
coverage report --skip-covered

basepython=
py27: python2.7
py36: python3.6

deps=
coverage==4.5.1
Expand Down

0 comments on commit e09c2c7

Please sign in to comment.