Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Commit

Permalink
Add travis-ci support (and clean up tox)
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed Aug 24, 2016
1 parent 9a1f0cc commit 5837ef4
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 17 deletions.
30 changes: 30 additions & 0 deletions .coveragerc
@@ -0,0 +1,30 @@
[run]
branch = True
source =
.
omit =
.tox/*
/usr/*
*/tmp*
setup.py
# Don't complain if non-runnable code isn't run
*/__main__.py

[report]
exclude_lines =
# Have to re-enable the standard pragma
\#\s*pragma: no cover

# Don't complain if tests don't hit defensive assertion code:
^\s*raise AssertionError\b
^\s*raise NotImplementedError\b
^\s*return NotImplemented\b
^\s*raise$

# Don't complain if non-runnable code isn't run:
^if __name__ == ['"]__main__['"]:$
[html]
directory = coverage-html
# vim:ft=dosini
14 changes: 14 additions & 0 deletions .travis.yml
@@ -0,0 +1,14 @@
language: python
python: 3.5
env: # These should match the tox env list
- TOXENV=py27
- TOXENV=py34
- TOXENV=py35
- TOXENV=pypy
install: pip install coveralls tox
script: tox
after_success: coveralls
cache:
directories:
- $HOME/.cache/pip
- $HOME/.pre-commit
2 changes: 1 addition & 1 deletion requirements-dev.txt
@@ -1,8 +1,8 @@
-r requirements.txt
coverage==4.2
flake8==2.5.0
pytest==2.9.2
mock==2.0.0
pre-commit==0.7.6
pytest-cov==2.2.0
sphinx==1.4.1
sphinxcontrib-programoutput==0.8
23 changes: 7 additions & 16 deletions tox.ini
@@ -1,5 +1,5 @@
[tox]
envlist = py27,py34
envlist = py27,py34,py35,pypy
indexserver =
default = https://pypi.python.org/simple

Expand All @@ -11,28 +11,19 @@ commands =
coverage run -m pytest --strict {posargs:tests}
coverage report -m --show-missing

[flake8]
exclude = .git,.tox,venv
filename = *.py
max-line-length = 131

[testenv:pre-commit]
basepython = python2.7
deps = pre-commit>=0.2.10
commands = pre-commit {posargs}

[testenv:cover]
deps =
{[testenv]deps}
coverage
commands =
coverage erase
coverage run -m pytest -v tests
coverage combine
coverage report --omit=.tox/*,tests/*,/usr/share/pyshared/*,/usr/lib/pymodules/* -m

[testenv:docs]
basepython = python2.7
deps =
{[testenv]deps}
commands =
sphinx-build -b html -d docs/build/doctrees docs/source docs/build/html

[flake8]
exclude = .git,.tox,venv
filename = *.py
max-line-length = 131

0 comments on commit 5837ef4

Please sign in to comment.