diff --git a/.travis.yml b/.travis.yml index 87b3d11..e1a75f9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,67 +1,31 @@ +sudo: false language: python python: # test various python versions (Django Support for various python versions is described within the exclude: section) - "2.7" - "3.4" - "3.5" - "3.6" - - "3.7-dev" - "pypy" # PyPy2 - "pypy3" # PyPy3 - - "nightly" # currently points to 3.7-dev env: - matrix: - ##################################################### - # Test against the initial releaes # - ##################################################### - - DJANGO_VERSION=1.8 DJANGO_REST_VERSION=3.4 - - DJANGO_VERSION=1.8 DJANGO_REST_VERSION=3.5 - - DJANGO_VERSION=1.11 DJANGO_REST_VERSION=3.4 - - DJANGO_VERSION=1.11 DJANGO_REST_VERSION=3.5 - - DJANGO_VERSION=1.11 DJANGO_REST_VERSION=3.6 - - DJANGO_VERSION=2.0 DJANGO_REST_VERSION=3.7 - - DJANGO_VERSION=2.0 DJANGO_REST_VERSION=3.8 - ##################################################### - # Test against the latest minor/patch releases # - ##################################################### - - DJANGO_VERSION=1.8.* DJANGO_REST_VERSION=3.4.* - - DJANGO_VERSION=1.8.* DJANGO_REST_VERSION=3.5.* - - DJANGO_VERSION=1.11.* DJANGO_REST_VERSION=3.4.* - - DJANGO_VERSION=1.11.* DJANGO_REST_VERSION=3.5.* - - DJANGO_VERSION=1.11.* DJANGO_REST_VERSION=3.6.* - - DJANGO_VERSION=1.11.* DJANGO_REST_VERSION=3.7.* - - DJANGO_VERSION=1.11.* DJANGO_REST_VERSION=3.8.* - - DJANGO_VERSION=2.0.* DJANGO_REST_VERSION=3.7.* - - DJANGO_VERSION=2.0.* DJANGO_REST_VERSION=3.8.* + - DJANGO=1.8 + - DJANGO=1.11 + - DJANGO=2.0 + - DJANGO=master matrix: exclude: - # Django 2.0 does not support Python2.7/PyPy2 anymore - - { python: "2.7", env: DJANGO_VERSION=2.0 } - - { python: "pypy", env: DJANGO_VERSION=2.0 } - - { python: "2.7", env: DJANGO_VERSION=2.0.* } - - { python: "pypy", env: DJANGO_VERSION=2.0.* } - # Django 1.8 might not support newer versions of python - - { python: "3.6", env: DJANGO_VERSION=1.8 } - - { python: "3.7", env: DJANGO_VERSION=1.8 } - - { python: "pypy3", env: DJANGO_VERSION=1.8 } - - { python: "nightly", env: DJANGO_VERSION=1.8 } - - { python: "3.6", env: DJANGO_VERSION=1.8.* } - - { python: "3.7", env: DJANGO_VERSION=1.8.* } - - { python: "pypy3", env: DJANGO_VERSION=1.8.* } - - { python: "nightly", env: DJANGO_VERSION=1.8.* } + # Django >= 2.0 does not support Python2.7/PyPy2 anymore + - { python: "2.7", env: DJANGO=2.0 } + - { python: "pypy", env: DJANGO=2.0 } + - { python: "2.7", env: DJANGO=master } + - { python: "pypy", env: DJANGO=master } allow_failures: # newer python versions aswell as pypy may also always break our build - - python: "3.7-dev" - python: "pypy" - python: "pypy3" - - python: "nightly" + - env: DJANGO=master cache: directories: - $HOME/.cache/pip -install: - - pip install -q Django==$DJANGO_VERSION # install custom django version - - pip install -q djangorestframework==$DJANGO_REST_VERSION # install custom django rest framework version - - pip install -q mock==2.0.0 # install unittest mocks -script: - - python setup.py install - - cd tests/ - - python manage.py test # just need to run normal tests for now +install: pip install tox-travis +script: tox diff --git a/README.md b/README.md index 5aacd60..998efc6 100644 --- a/README.md +++ b/README.md @@ -63,10 +63,8 @@ unit tests. Use this code snippet to run tests: ```bash -pip install -r requirements_test.txt -python setup.py install -cd tests -python manage.py test +pip install tox +tox ``` ## Cache Backend diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..81e25fa --- /dev/null +++ b/tox.ini @@ -0,0 +1,31 @@ +[tox] +envlist = + {py27,py34,py35,pypy,pypy3}-django18-{drf35,drf36}, + {py27,py34,py35,py36,pypy,pypy3}-django111-{drf35,drf36,drf37,drf38}, + {py34,py35,py36,pypy3}-django20-{drf37,drf38}, + {py35,py36,pypy3}-djangomaster-{drf38} + +[travis:env] +DJANGO = + 1.8: django18 + 1.11: django111 + 2.0: django20 + master: djangomaster + +[testenv] +changedir = tests +commands = python manage.py test +envdir = {toxworkdir}/venvs/{envname} +setenv = + PYTHONDONTWRITEBYTECODE=1 + PYTHONWARNINGS=once +deps = + mock==2.0 + drf35: djangorestframework>=3.5,<3.6 + drf36: djangorestframework>=3.6,<3.7 + drf37: djangorestframework>=3.7,<3.8 + drf38: djangorestframework>=3.8,<3.9 + django18: Django>=1.8,<1.9 + django111: Django>=1.11,<2.0 + django20: Django>=2.0,<2.1 + djangomaster: https://github.com/django/django/archive/master.tar.gz