Skip to content

Commit 67fbd1f

Browse files
committed
refactor travis to use tox
1 parent 31f988b commit 67fbd1f

File tree

2 files changed

+81
-88
lines changed

2 files changed

+81
-88
lines changed

.travis.yml

Lines changed: 46 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,57 @@
11
sudo: required
22
language: python
3-
4-
python:
5-
- 2.7
6-
- 3.5
7-
- 3.6
3+
cache: pip
84

95
addons:
10-
postgresql: 9.6
6+
postgresql: '10'
117
apt:
128
packages:
13-
- postgresql-9.6-postgis-2.3
9+
- postgresql-10-postgis-2.5
10+
- postgresql-10-postgis-2.5-scripts
1411

1512
env:
1613
matrix:
17-
- DJANGO_VERSION=1.6.11 DATABASE=postgres
18-
- DJANGO_VERSION=1.6.11 DATABASE=sqlite
19-
- DJANGO_VERSION=1.7.11 DATABASE=postgres
20-
- DJANGO_VERSION=1.7.11 DATABASE=sqlite
21-
- DJANGO_VERSION=1.8.18 DATABASE=postgres
22-
- DJANGO_VERSION=1.8.18 DATABASE=sqlite
23-
- DJANGO_VERSION=1.9.13 DATABASE=postgres
24-
- DJANGO_VERSION=1.9.13 DATABASE=sqlite
25-
- DJANGO_VERSION=1.10.8 DATABASE=postgres
26-
- DJANGO_VERSION=1.10.8 DATABASE=sqlite
27-
- DJANGO_VERSION=1.11.7 DATABASE=postgres
28-
- DJANGO_VERSION=1.11.7 DATABASE=sqlite
29-
- DJANGO_VERSION=dev DATABASE=postgres
30-
- DJANGO_VERSION=dev DATABASE=sqlite
14+
- DATABASE=postgres
15+
- DATABASE=sqlite SPATIALITE_LIBRARY_PATH='mod_spatialite'
3116

3217
matrix:
33-
exclude:
34-
- python: 3.5
35-
env: DJANGO_VERSION=1.6.11 DATABASE=sqlite
36-
- python: 3.5
37-
env: DJANGO_VERSION=1.6.11 DATABASE=postgres
38-
- python: 3.5
39-
env: DJANGO_VERSION=1.7.11 DATABASE=sqlite
40-
- python: 3.5
41-
env: DJANGO_VERSION=1.7.11 DATABASE=postgres
42-
- python: 3.5
43-
env: DJANGO_VERSION=1.8.18 DATABASE=sqlite
44-
- python: 3.5
45-
env: DJANGO_VERSION=1.9.13 DATABASE=sqlite
46-
- python: 3.5
47-
env: DJANGO_VERSION=1.10.8 DATABASE=sqlite
48-
- python: 3.5
49-
env: DJANGO_VERSION=1.11.7 DATABASE=sqlite
50-
- python: 3.5
51-
env: DJANGO_VERSION=dev DATABASE=sqlite
52-
- python: 3.6
53-
env: DJANGO_VERSION=1.6.11 DATABASE=sqlite
54-
- python: 3.6
55-
env: DJANGO_VERSION=1.6.11 DATABASE=postgres
56-
- python: 3.6
57-
env: DJANGO_VERSION=1.7.11 DATABASE=sqlite
58-
- python: 3.6
59-
env: DJANGO_VERSION=1.7.11 DATABASE=postgres
60-
- python: 3.6
61-
env: DJANGO_VERSION=1.8.18 DATABASE=sqlite
62-
- python: 3.6
63-
env: DJANGO_VERSION=1.8.18 DATABASE=postgres
64-
- python: 3.6
65-
env: DJANGO_VERSION=1.9.13 DATABASE=sqlite
66-
- python: 3.6
67-
env: DJANGO_VERSION=1.9.13 DATABASE=postgres
68-
- python: 3.6
69-
env: DJANGO_VERSION=1.10.8 DATABASE=sqlite
70-
- python: 3.6
71-
env: DJANGO_VERSION=1.10.8 DATABASE=postgres
72-
- python: 3.6
73-
env: DJANGO_VERSION=1.11.7 DATABASE=sqlite
74-
- python: 2.7
75-
env: DJANGO_VERSION=dev DATABASE=sqlite
76-
- python: 2.7
77-
env: DJANGO_VERSION=dev DATABASE=postgres
18+
fast_finish: true
19+
include:
20+
- { python: "2.7", env: DJANGO=1.8 }
21+
- { python: "3.3", env: DJANGO=1.8 }
22+
- { python: "3.4", env: DJANGO=1.8 }
23+
- { python: "3.5", env: DJANGO=1.8 }
24+
25+
- { python: "2.7", env: DJANGO=1.9 }
26+
- { python: "3.4", env: DJANGO=1.9 }
27+
- { python: "3.5", env: DJANGO=1.9 }
28+
29+
- { python: "2.7", env: DJANGO=1.10 }
30+
- { python: "3.4", env: DJANGO=1.10 }
31+
- { python: "3.5", env: DJANGO=1.10 }
32+
33+
- { python: "2.7", env: DJANGO=1.11 }
34+
- { python: "3.4", env: DJANGO=1.11 }
35+
- { python: "3.5", env: DJANGO=1.11 }
36+
- { python: "3.6", env: DJANGO=1.11 }
37+
- { python: "3.7", env: DJANGO=1.11 }
38+
39+
- { python: "3.4", env: DJANGO=2.0 }
40+
- { python: "3.5", env: DJANGO=2.0 }
41+
- { python: "3.6", env: DJANGO=2.0 }
42+
- { python: "3.7", env: DJANGO=2.0 }
43+
44+
- { python: "3.5", env: DJANGO=2.1 }
45+
- { python: "3.6", env: DJANGO=2.1 }
46+
- { python: "3.7", env: DJANGO=2.1 }
47+
48+
- { python: "3.5", env: DJANGO=master }
49+
- { python: "3.6", env: DJANGO=master }
50+
- { python: "3.7", env: DJANGO=master }
51+
7852

7953
allow_failures:
80-
- python: 3.5
81-
env: DJANGO_VERSION=dev DATABASE=sqlite
82-
- python: 3.5
83-
env: DJANGO_VERSION=dev DATABASE=postgres
84-
- python: 3.6
85-
env: DJANGO_VERSION=dev DATABASE=sqlite
86-
- python: 3.6
87-
env: DJANGO_VERSION=dev DATABASE=postgres
54+
- env: DJANGO=master
8855

8956
before_install:
9057
- sudo apt-get update
@@ -94,19 +61,11 @@ install:
9461
- sudo apt-get update -qq
9562
- sudo apt-get install -y libproj-dev libgeos-dev
9663

97-
- if [[ $DATABASE == sqlite ]]; then sudo apt-get install -y libspatialite-dev; fi
98-
- if [ $DATABASE == sqlite ] && [ $TRAVIS_PYTHON_VERSION == 2.7 ]; then pip install pysqlite==2.8.2; fi
99-
- if [[ $DATABASE == postgres ]]; then pip install psycopg2; fi
100-
101-
# This is a dependency of our Django test script
102-
- pip install argparse
103-
- if [[ $DJANGO_VERSION == dev ]]; then pip
104-
install https://github.com/django/django/tarball/master/django.tar.gz#egg=django; else pip
105-
install -q Django==$DJANGO_VERSION; fi
106-
107-
- pip install coverage
108-
- pip install flake8
64+
- if [[ $DATABASE == sqlite ]]; then sudo apt-get install -y libspatialite-dev libsqlite3-mod-spatialite; fi
65+
- if [ $DATABASE == sqlite ] && [ $TRAVIS_PYTHON_VERSION == 2.7 ]; then pip install pysqlite==2.8.3; fi
66+
- if [[ $DATABASE == postgres ]]; then pip install psycopg2-binary; fi
10967

68+
- pip install tox tox-travis
11069
- python setup.py develop
11170
- npm install leaflet/tests/
11271

@@ -119,11 +78,10 @@ before_script:
11978
- if [[ $DATABASE == postgres ]]; then psql -c 'CREATE EXTENSION postgis;' -U postgres -d test_db; fi
12079

12180
script:
122-
- python quicktest.py leaflet --db=$DATABASE
81+
- tox
12382
- node --version
12483
- node node_modules/mocha-phantomjs/bin/mocha-phantomjs leaflet/tests/index.html
12584

12685
after_success:
127-
- coverage run quicktest.py leaflet --db=$DATABASE
12886
- pip install coveralls
12987
- coveralls

tox.ini

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[tox]
2+
envlist =
3+
{py27,py33,py34,py35}-django18,
4+
{py27,py34,py35}-django19,
5+
{py27,py34,py35}-django110,
6+
{py27,py34,py35,py36,py37}-django111,
7+
{py34,py35,py36,py37}-django20,
8+
{py35,py36,py37}-django21,
9+
{py35,py36,py37}-django22,
10+
{py35,py36,py37}-djangomaster
11+
12+
[testenv]
13+
commands = coverage run ./quicktest.py leaflet --db=$DATABASE
14+
deps =
15+
django18: Django>=1.8,<1.9
16+
django19: Django>=1.9,<1.10
17+
django110: Django>=1.10,<1.11
18+
django111: Django>=1.11,<2.0
19+
django20: Django>=2.0,<2.1
20+
django21: Django>=2.1,<2.2
21+
django22: Django>=2.2,<3.0
22+
djangomaster: https://github.com/django/django/archive/master.tar.gz
23+
argparse
24+
coverage
25+
flake8
26+
27+
[travis:env]
28+
DJANGO =
29+
1.8: django18
30+
1.9: django19
31+
1.10: django110
32+
1.11: django111
33+
2.0: django20
34+
2.1: django21
35+
master: djangomaster

0 commit comments

Comments
 (0)