Skip to content

Commit 3c91c2e

Browse files
authored
Merge pull request #167 from asherf/tox
Switch to tox
2 parents df39e91 + 9f79935 commit 3c91c2e

File tree

3 files changed

+34
-27
lines changed

3 files changed

+34
-27
lines changed

.travis.yml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,17 @@ python:
66
- "3.7"
77
- "3.8"
88
- "2.7"
9-
env:
10-
- DJANGO_VERSION=2.1
11-
- DJANGO_VERSION=2.2
12-
- DJANGO_VERSION=1.11
139
services:
1410
- memcached
1511
- redis
1612
- mysql
1713
- postgresql
18-
matrix:
19-
exclude:
20-
- python: "2.7"
21-
env: DJANGO_VERSION=2.1
22-
- python: "2.7"
23-
env: DJANGO_VERSION=2.2
24-
- python: "3.8"
25-
env: DJANGO_VERSION=1.11
26-
- python: "3.7"
27-
env: DJANGO_VERSION=1.11
28-
- python: "3.6"
29-
env: DJANGO_VERSION=1.11
3014

3115
install:
32-
- pip install coveralls codacy-coverage
33-
- pip install -r requirements.txt
34-
- pip install -q Django==$DJANGO_VERSION
35-
- pip install --upgrade setuptools wheel
16+
- pip install tox-travis coverage coveralls codacy-coverage
3617
- mysql -e 'create database django_prometheus_1;'
3718
script:
38-
- if [[ $TRAVIS_PYTHON_VERSION == "3.7" ]]; then black --check django_prometheus/; fi
39-
- flake8 django_prometheus
40-
- isort --check-only -rc django_prometheus/
41-
- coverage run --source=django_prometheus setup.py test
42-
- pushd django_prometheus/tests/end2end && PYTHONPATH=../../.. coverage run --source=django_prometheus manage.py test && popd
43-
- python setup.py sdist bdist_wheel
19+
- tox
4420
after_success:
4521
- coverage combine .coverage django_prometheus/tests/end2end/.coverage
4622
- coveralls

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
Django>=1.11
21
django-redis>=4.8
32
black; python_version >= '3.6'
43
flake8

tox.ini

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
[tox]
2+
envlist = {py27,py35}-django{111}}-{end2end,unittests},
3+
{py35,py36,py37,py38}-django{210,220}-{end2end,unittests},py37-lint
4+
5+
[testenv]
6+
deps =
7+
django111: Django>=1.11,<2.0
8+
django210: Django>=2.1,<2.2
9+
django220: Django>=2.2,<2.3
10+
coverage
11+
-rrequirements.txt
12+
skip_missing_interpreters=true
13+
14+
changedir =
15+
end2end: {toxinidir}/django_prometheus/tests/end2end
16+
setenv =
17+
end2end: PYTHONPATH = {toxinidir}
18+
commands =
19+
end2end: coverage run --source=django_prometheus manage.py test
20+
unittests: coverage run --source=django_prometheus setup.py test
21+
unittests: python setup.py sdist bdist_wheel
22+
23+
[testenv:lint]
24+
deps =
25+
black
26+
flake8
27+
isort
28+
commands =
29+
black --check django_prometheus/
30+
flake8 django_prometheus
31+
isort --check-only -rc django_prometheus/
32+
133
[flake8]
234
ignore = E501,W503
335

0 commit comments

Comments
 (0)