Merge pull request #643 from geigerzaehler/tox-flake8-travis

Use tox to test on travis and add docs and flake8
This commit is contained in:
Adrian Sampson 2014-04-02 20:39:22 -07:00
commit c4be9c273f
4 changed files with 46 additions and 15 deletions

1
.gitignore vendored
View file

@ -29,4 +29,5 @@ dist/*
beets.egg-info/*
build/*
docs/_build/*
man

View file

@ -1,29 +1,33 @@
language: python
python:
- "2.7"
- "2.6"
- "pypy"
python: 2.7
branches:
only:
- master
env:
- TOX_ENV=py26
- TOX_ENV=py27
- TOX_ENV=pypy
- TOX_ENV=docs
- TOX_ENV=flake8
matrix:
allow_failures:
- env: TOX_ENV=flake8
install:
- travis_retry pip install .
- travis_retry pip install pylast flask responses
# unittest backport on Python < 2.7
- "[[ $TRAVIS_PYTHON_VERSION == '2.6' ]] && pip install unittest2 || true"
- travis_retry sudo apt-get update
- travis_retry sudo apt-get install -qq bash-completion
- travis_retry pip install tox sphinx
- "[[ $TOX_ENV == 'py27' ]] && pip install coveralls || true"
script: nosetests --with-coverage --cover-package=beets
script: tox -e $TOX_ENV
# coveralls.io reporting, using https://github.com/coagulant/coveralls-python
# Only report coverage for one version.
before_script:
- "[[ $TRAVIS_PYTHON_VERSION == '2.7' ]] && pip install coveralls || true"
after_success:
- "[[ $TRAVIS_PYTHON_VERSION == '2.7' ]] && coveralls || true"
- "[[ $TOX_ENV == 'py27' ]] && coveralls || true"
notifications:
irc:

View file

@ -1,3 +1,8 @@
[nosetests]
verbosity=1
logging-clear-handlers=1
[flake8]
# F401 module imported but unused
# E231 missing whitespace after ',' (used to align visually)
ignore=F401,E241

27
tox.ini
View file

@ -4,17 +4,38 @@
# and then run "tox" from this directory.
[tox]
envlist = py26, py27, pypy
envlist = py27,docs,flake8
[testenv]
commands =
nosetests
deps =
nose
pylast
flask
responses
commands =
nosetests
[testenv:py26]
deps =
{[testenv]deps}
unittest2
[testenv:py27]
deps =
{[testenv]deps}
coverage
commands =
nosetests
[testenv:docs]
changedir = docs
deps =
sphinx
commands =
sphinx-build -W -b html . {envtmpdir}/html
[testenv:flake8]
deps =
{[testenv]deps}
flake8
commands = flake8 beets beetsplug beet test setup.py docs