diff --git a/.gitignore b/.gitignore index 692a4ecf3..74f6912b7 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,5 @@ dist/* beets.egg-info/* build/* docs/_build/* +man diff --git a/.travis.yml b/.travis.yml index 6eda6e736..fbef76f77 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/setup.cfg b/setup.cfg index acd86dbcf..8feeb8301 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/tox.ini b/tox.ini index ff9166464..32b291be6 100644 --- a/tox.ini +++ b/tox.ini @@ -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