Skip to content

Commit

Permalink
Add py3.6 and django 1.10-1.11 to tox; fail if
Browse files Browse the repository at this point in the history
coverage with branching is less than 77%.
  • Loading branch information
andreif committed Feb 22, 2017
1 parent 8b71f2b commit 43ffcb1
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 25 deletions.
42 changes: 29 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
sudo: false
language: python

cache: pip

# Tox cannot install pythons, so we set 3.5 as default, use 3.4 already
# available in container and then include 3.6 in matrix.
python:
- 3.5

env:
- TOXENV=py34-django18
- TOXENV=py34-django19
- TOXENV=py34-django110
- TOXENV=py34-django111

- TOXENV=py35-django18
- TOXENV=py35-django19
- TOXENV=py35-django110
- TOXENV=py35-django111

- TOXENV=lint
- TOXENV=coverage

matrix:
include:
- python: 3.4
env: TOXENV=py34-django18
- python: 3.4
env: TOXENV=py34-django19
- python: 3.5
env: TOXENV=py35-django18
- python: 3.5
env: TOXENV=py35-django19
- python: 3.5
env: TOXENV=flake8
- python: 3.5
env: TOXENV=coverage
- python: 3.6
env: TOXENV=py36-django110
- python: 3.6
env: TOXENV=py36-django111

install:
- pip install tox
Expand All @@ -23,4 +36,7 @@ script:
- tox

after_success:
- coveralls
- if [ "$TOXENV" == "coverage" ]; then
pip install --quiet python-coveralls;
coveralls --ignore-errors;
fi
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
.PHONY: test
test:
python setup.py test

flake8:
.PHONY: lint
lint:
flake8 bananas

.PHONY: install
install:
python setup.py install

.PHONY: develop
develop:
python setup.py develop

.PHONY: coverage
coverage:
coverage run --source bananas setup.py test
coverage run setup.py test
coverage report

.PHONY: clean
clean:
rm -rf dist/ *.egg *.egg-info .coverage
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ django-bananas is on PyPI, so just run:

Currently tested only for

- Django 1.8 and 1.9 under Python 3.4 and 3.5
- Django 1.8-1.11b1 under Python 3.4-3.6

pull requests welcome!

Expand Down
14 changes: 14 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,17 @@
max-line-length = 110
exclude = .tox,.git,docs,migrations
max-complexity = 14

[coverage:run]
source = bananas
branch = True

[coverage:report]
fail_under = 77
skip_covered = True
show_missing = True

# Regex expressions for lines excluded from report
exclude_lines =
pragma: no cover
if __name__ == .__main__.:
20 changes: 11 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,27 @@
# and then run "tox" from this directory.

[tox]
envlist = py{34,35}-django{18,19}
envlist = py{34,35}-django{18,19,110,111}
py36-django{110,111}


[testenv]
commands = python setup.py test
install_command = pip install --no-binary Django --pre {opts} {packages}
commands = make test
install_command = pip install --no-binary --pre {opts} {packages}
deps = django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
django110: Django>=1.10,<1.11
django111: Django>=1.11b1,<1.12


[testenv:coverage]
basepython = python3.4
commands = coverage run --omit=migrations,south_migrations --source bananas setup.py test
commands = make coverage
deps = coverage
python-coveralls
Django>=1.8,<1.9
Django


[testenv:flake8]
commands =
flake8 bananas
[testenv:lint]
commands = make lint
deps =
flake8

0 comments on commit 43ffcb1

Please sign in to comment.