From 917ccd1f564e95595188e785959063a5ba813842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristi=20V=C3=AEjdea?= Date: Wed, 3 Jan 2018 20:30:17 +0100 Subject: [PATCH] Restructure travis & tox configuration (#34) Also removed useless python 3.7-dev build --- .travis.yml | 62 ++++++++++++++++++++++--------------------- requirements/dev.txt | 5 +--- requirements/lint.txt | 3 +++ tox.ini | 25 +++++++++-------- 4 files changed, 48 insertions(+), 47 deletions(-) create mode 100644 requirements/lint.txt diff --git a/.travis.yml b/.travis.yml index f748fdd..8a8719a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,48 +1,25 @@ language: python cache: pip + python: - - '2.7' - '3.4' - '3.5' - '3.6' - - '3.7-dev' env: - - DRF=3.7 - -install: - - pip install -r requirements/ci.txt - -before_script: - - coverage erase - -script: - - tox - -after_success: - - codecov - -branches: - only: - - master - - /^release\/.*$/ - - /^v?\d+\.\d+(\.\d+)?(-?\S+)?$/ - -notifications: - email: - on_success: always - on_failure: always + - DRF=3.7 DJANGO=2.0 jobs: - fast_finish: true - include: - stage: test + python: '2.7' + env: DRF=3.7 DJANGO=1.11 + - python: '3.5' env: TOXENV=docs - python: '2.7' - env: TOXENV=flake8 + env: TOXENV=lint - python: '3.6' env: DRF=master @@ -63,9 +40,34 @@ jobs: allow_failures: - env: TOXENV=flake8 - env: DRF=master - - python: '3.7-dev' + + fast_finish: true + +install: + - pip install -r requirements/ci.txt + +before_script: + - coverage erase + +script: + - tox + +after_success: + - codecov + +branches: + only: + - master + - /^release\/.*$/ + - /^v?\d+\.\d+(\.\d+)?(-?\S+)?$/ stages: - test - name: publish if: tag IS present + + +notifications: + email: + on_success: always + on_failure: always diff --git a/requirements/dev.txt b/requirements/dev.txt index f6c7569..e9da5e1 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -3,8 +3,5 @@ tox>=2.9.1 tox-battery>=0.5 detox>=0.11 -isort>=4.2 -flake8>=3.5.0 -flake8-isort>=2.3 - +-r lint.txt -r setup.txt diff --git a/requirements/lint.txt b/requirements/lint.txt new file mode 100644 index 0000000..ddcea2a --- /dev/null +++ b/requirements/lint.txt @@ -0,0 +1,3 @@ +isort>=4.2 +flake8>=3.5.0 +flake8-isort>=2.3 diff --git a/tox.ini b/tox.ini index d1cc1a0..64dc8ce 100644 --- a/tox.ini +++ b/tox.ini @@ -1,26 +1,26 @@ [tox] envlist = - py27-drf37, - py{34,35,36,37}-drf37, + py27-django111-drf37, + py{34,35,36}-django20-drf37, py36-drfmaster, - flake8, docs + lint, docs [travis:env] DRF = 3.7: drf37 master: drfmaster +DJANGO = + 1.11: django111 + 2.0: django20 [testenv] deps = + django111: Django>=1.11,<2.0 + django20: Django>=2.0,<2.1 + drf37: djangorestframework>=3.7.3,<3.8 - # py27 is tested with Django <2.0 (Django 2.0 no longer supports python 2) - py27: Django>=1.11,<2.0 - - # main testing configurations - py{34,35,36,37}-drf37: Django>=1.11,<2.1 - - # py3 with the latest build of Django and django-rest-framework to get early warning of compatibility issues + # test with the latest build of Django and django-rest-framework to get early warning of compatibility issues drfmaster: https://github.com/encode/django-rest-framework/archive/master.tar.gz drfmaster: https://github.com/django/django/archive/master.tar.gz @@ -35,11 +35,10 @@ commands = [testenv:py36-drfmaster] pip_pre = True -[testenv:flake8] +[testenv:lint] skip_install = true deps = - flake8 - flake8-isort + -rrequirements/lint.txt commands = flake8 src/drf_yasg testproj tests setup.py