Test against Python 3.4 and multiple Twisted versions

This commit adds tox to be able to test against different dependencies
locally. We agreed that Python 3.4 should be supported across all Channels
projects, so it is also added with this commit.

Furthermore, I think it makes sense to support a broad range of Twisted
releases, as users of daphne are not unlikely to have other Twisted code
running. It's not feasible to test against all releases since 16.0, and
it would require constant maintenance to add new releases as they come
out. So I opted to keep things simple for now, and only test against the
oldest supported and the current Twisted release.

I did consider @jpic's great idea from
https://github.com/django/daphne/pull/19 to just use tox to avoid having
to duplicate the dependency matrix. But it does lead to slower test runs
as it bypasses Travis' caching, and is slightly more verbose.
This commit is contained in:
Maik Hoepfel 2017-01-30 15:39:16 +01:00
parent 71f6052fb3
commit 51ffbca62a
4 changed files with 21 additions and 4 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
__pycache__
dist/
build/
/.tox

View File

@ -1,9 +1,16 @@
sudo: false
language: python
python:
- "2.7"
- "3.4"
- "3.5"
install:
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then pip install unittest2; fi
- pip install asgiref twisted autobahn
script: if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then python -m unittest2; else python -m unittest; fi
env:
- TWISTED_RELEASE="twisted"
- TWISTED_RELEASE="twisted==16.0.0"
install: pip install $TWISTED_RELEASE -e .
script: python -m unittest discover

View File

@ -40,6 +40,7 @@ setup(
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Topic :: Internet :: WWW/HTTP',
],

8
tox.ini Normal file
View File

@ -0,0 +1,8 @@
# We test against the oldest supported Twisted release, and the current release.
[tox]
envlist = py{27,34,35}-twisted-{old,new}
[testenv]
deps =
twisted-old: twisted==16.0.0
commands = python -m unittest discover