Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update testing matrix #20

Merged
merged 8 commits into from
Jan 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
sudo: false
language: python
python:
- "2.7"
- "3.4"
python: 2.7
# This only controls the version of Python used to run tox, the
# versions used for the tests are handled by tox itself. Python 3.5
# is only installed if we explicitly request it, so we have to use
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we still need to list each individual version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know if you saw the commit message for that change? :-)
https://github.com/edmorley/hawkrest/commit/ecddb7df8de3813b2b6d352bb0018acd567d648e

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tox controls the Python versions tested, so we only need one Python
version specified at the Travis level

This isn't entirely true. I think what you mean is that tox controls the virtualenv for each Python. The machine still needs each version of Python installed otherwise tox won't be able to find an executable for it. I think the tests were working before (with the duplicate entry typo) because travis makes some versions available by default. I'd rather see those versions declared explicitly for when travis removes old versions in the defaults.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This unfortunately won't work. Every entry under the 'python' key creates another matrix of tests. If I added both Python 3.5 and 2.7 here we'd run the tests twice, duplicating them (since both Travis and Tox would be doing all the permutations). See:
https://docs.travis-ci.com/user/customizing-the-build/#Build-Matrix

(And yeah Travis makes python2.7, python3.4 available by default)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clearer: we can either control the python version at the Travis level, or the tox level, but not both. I'm open to doing either :-)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, weird! Can you just put a comment above this line then? Something like "we aren't explicitly declaring all versions needed by tox because ...". I think this is a weird assumption by Travis. A comment will prevent someone from trying to fix it later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The language versions are intended to be used for a testing matrix, rather than "these are the list of versions I want installed in the same image", but I agree sometimes the Travis testing matrix isn't very flexible. Treeherder has to go to some great contortions to get the exact environment we need for each test suite (we abuse the matrix include option quite horrifically: link).

# it as the base, so that it's available to tox. Python 2.7 and 3.4
# are available in the Travis images by default. See:
# https://github.com/travis-ci/travis-ci/issues/4794#issuecomment-143758799
python: "3.5"
env:
- TOX_ENV=docs
- TOX_ENV=py27-django1.6-drf3.0
- TOX_ENV=py27-django1.6-drf3.1
- TOX_ENV=py27-django1.6-drf3.2
- TOX_ENV=py27-django1.7-drf3.0
- TOX_ENV=py27-django1.7-drf3.1
- TOX_ENV=py27-django1.7-drf3.2
- TOX_ENV=py27-django1.8-drf3.0
- TOX_ENV=py27-django1.8-drf3.1
- TOX_ENV=py27-django1.7-drf3.3
- TOX_ENV=py27-django1.8-drf3.2
- TOX_ENV=py34-django1.6-drf3.0
- TOX_ENV=py34-django1.6-drf3.1
- TOX_ENV=py34-django1.6-drf3.2
- TOX_ENV=py34-django1.7-drf3.0
- TOX_ENV=py34-django1.7-drf3.1
- TOX_ENV=py34-django1.7-drf3.2
- TOX_ENV=py34-django1.8-drf3.0
- TOX_ENV=py34-django1.8-drf3.1
- TOX_ENV=py27-django1.8-drf3.3
- TOX_ENV=py27-django1.9-drf3.3
- TOX_ENV=py34-django1.8-drf3.2
- TOX_ENV=py34-django1.8-drf3.3
- TOX_ENV=py34-django1.9-drf3.3
- TOX_ENV=py35-django1.8-drf3.2
- TOX_ENV=py35-django1.8-drf3.3
- TOX_ENV=py35-django1.9-drf3.3
matrix:
allow_failures:
# Remove when test failures under Django 1.9 are fixed.
- env: TOX_ENV=py27-django1.9-drf3.3
- env: TOX_ENV=py34-django1.9-drf3.3
- env: TOX_ENV=py35-django1.9-drf3.3
fast_finish: true
install:
- pip install tox
Expand Down
7 changes: 5 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ Installation

Requirements:

* Python 2.7+ or 3.3+
* `Django Rest Framework`_
* Python 2.7+ or 3.4+
* `Django`_ 1.6, 1.7 or 1.8 (NB: hawkrest is not yet compatible with Django 1.9)
* `Django Rest Framework`_ 3.2 or 3.3
* `mohawk`_
(Older versions of these libraries may work, but support is not guaranteed.)

Using `pip`_, install the module like this::

Expand All @@ -63,6 +65,7 @@ You'll most likely put this in a `requirements`_ file within your Django app.

The source code is available at https://github.com/kumar303/hawkrest

.. _`Django`: https://www.djangoproject.com/
.. _`Django Rest Framework`: http://django-rest-framework.org/
.. _`mohawk`: http://mohawk.readthedocs.org/
.. _`pip`: http://www.pip-installer.org/
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I always forget about these

'Topic :: Internet :: WWW/HTTP',
],
packages=find_packages(exclude=['tests']),
Expand Down
16 changes: 9 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
# When updating the envlist, be sure to also update TOX_ENV in .travis.yml
envlist =
docs,
{py27,py34}-django{1.6,1.7,1.8}-drf{3.0,3.1,3.2}
py27-django1.6-drf3.2,
py27-django1.7-drf{3.2,3.3},
{py27,py34,py35}-django{1.8,1.9}-drf{3.2,3.3}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To add a single combo as I mentioned earlier, you would add a new line to this section, like:

py27-django1.6-drf3.3

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, do you want Django 1.7 or both 1.6 and 1.7?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(django-rest-framework 3.3 doesn't support Django 1.6)


[testenv]
commands = {envpython} runtests.py []
deps =
django1.6: Django==1.6.3
django1.7: Django==1.7.10
django1.8: Django==1.8.4
drf3.0: djangorestframework==3.0.5
drf3.1: djangorestframework==3.1.3
drf3.2: djangorestframework==3.2.2
django1.6: Django>=1.6,<1.7
django1.7: Django>=1.7,<1.8
django1.8: Django>=1.8,<1.9
django1.9: Django>=1.9,<1.10
drf3.2: djangorestframework>=3.2,<3.3
drf3.3: djangorestframework>=3.3,<3.4
-r{toxinidir}/requirements/dev.txt
setenv =
PYTHONDONTWRITEBYTECODE=1
Expand Down