From 50c2d71a80555eea2a42244b9e8e3ac1718a884b Mon Sep 17 00:00:00 2001 From: Ryan P Kilby Date: Mon, 16 Jan 2017 08:51:07 -0500 Subject: [PATCH] tox/travis maintenance (#4811) * Use py36 on travis * Remove basepython from tox * Use py27 on travis * Use version ranges for dependencies * Use tox-travis to sync python/env factors * Add toxenv/django env vars to codecov build vars * Use raw string to fix py36 invalid escape sequence --- .travis.yml | 49 +++++++++++++++++++------------------- rest_framework/__init__.py | 2 +- tox.ini | 32 +++++++++++++------------ 3 files changed, 43 insertions(+), 40 deletions(-) diff --git a/.travis.yml b/.travis.yml index d9b2406a5..7bd52fcbc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,46 +1,47 @@ language: python python: + - "2.7" + - "3.3" + - "3.4" - "3.5" sudo: false env: - - TOX_ENV=py27-lint - - TOX_ENV=py27-docs - - TOX_ENV=py35-django19 - - TOX_ENV=py34-django19 - - TOX_ENV=py27-django19 - - TOX_ENV=py35-django18 - - TOX_ENV=py34-django18 - - TOX_ENV=py33-django18 - - TOX_ENV=py27-django18 - - TOX_ENV=py27-django110 - - TOX_ENV=py35-django110 - - TOX_ENV=py34-django110 - - TOX_ENV=py27-djangomaster - - TOX_ENV=py34-djangomaster - - TOX_ENV=py35-djangomaster - - TOX_ENV=py36-djangomaster + - DJANGO=1.8 + - DJANGO=1.9 + - DJANGO=1.10 + - DJANGO=master matrix: fast_finish: true + include: + - python: "3.6" + env: DJANGO=master + - python: "2.7" + env: TOXENV="lint" + - python: "2.7" + env: TOXENV="docs" + exclude: + - python: "3.3" + env: DJANGO=1.9 + - python: "3.3" + env: DJANGO=1.10 + - python: "3.3" + env: DJANGO=master allow_failures: - - env: TOX_ENV=py27-djangomaster - - env: TOX_ENV=py34-djangomaster - - env: TOX_ENV=py35-djangomaster - - env: TOX_ENV=py36-djangomaster + - env: DJANGO=master install: - # Virtualenv < 14 is required to keep the Python 3.2 builds running. - - pip install tox virtualenv + - pip install tox tox-travis script: - - tox -e $TOX_ENV + - tox after_success: - pip install codecov - - codecov -e TOX_ENV + - codecov -e TOXENV,DJANGO notifications: email: false diff --git a/rest_framework/__init__.py b/rest_framework/__init__.py index 795b84e95..d9aa7718c 100644 --- a/rest_framework/__init__.py +++ b/rest_framework/__init__.py @@ -1,4 +1,4 @@ -""" +r""" ______ _____ _____ _____ __ | ___ \ ___/ ___|_ _| / _| | | | |_/ / |__ \ `--. | | | |_ _ __ __ _ _ __ ___ _____ _____ _ __| |__ diff --git a/tox.ini b/tox.ini index 9867038e9..e2813f269 100644 --- a/tox.ini +++ b/tox.ini @@ -3,11 +3,17 @@ addopts=--tb=short [tox] envlist = - py27-{lint,docs}, {py27,py33,py34,py35}-django18, - {py27,py34,py35}-django19, - {py27,py34,py35}-django110, - {py27,py34,py35,py36}-django{master} + {py27,py34,py35}-django{19,110}, + {py27,py34,py35,py36}-djangomaster, + lint,docs + +[travis:env] +DJANGO = + 1.8: django18 + 1.9: django19 + 1.10: django110 + master: djangomaster [testenv] commands = ./runtests.py --fast {posargs} --coverage -rw @@ -15,26 +21,22 @@ setenv = PYTHONDONTWRITEBYTECODE=1 PYTHONWARNINGS=once deps = - django18: Django==1.8.17 - django19: Django==1.9.12 - django110: Django==1.10.5 + django18: Django>=1.8,<1.9 + django19: Django>=1.9,<.1.10 + django110: Django>=1.10,<1.11 djangomaster: https://github.com/django/django/archive/master.tar.gz -rrequirements/requirements-testing.txt -rrequirements/requirements-optionals.txt -basepython = - py36: python3.6 - py35: python3.5 - py34: python3.4 - py33: python3.3 - py27: python2.7 -[testenv:py27-lint] +[testenv:lint] +basepython = python2.7 commands = ./runtests.py --lintonly deps = -rrequirements/requirements-codestyle.txt -rrequirements/requirements-testing.txt -[testenv:py27-docs] +[testenv:docs] +basepython = python2.7 commands = mkdocs build deps = -rrequirements/requirements-testing.txt