From 0c92c39f05e68f54b9bafecf8453309aa92d4a0a Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Mon, 1 Oct 2018 16:31:40 +0200 Subject: [PATCH] Update build --- .travis.yml | 9 +++--- Dockerfile | 1 - doc8.ini | 2 ++ tox.ini | 80 +++++++++++++++++++++++++++-------------------------- 4 files changed, 48 insertions(+), 44 deletions(-) create mode 100644 doc8.ini diff --git a/.travis.yml b/.travis.yml index 990b662..ef48c3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,9 @@ jobs: - stage: lint env: TOXENV=manifest - env: TOXENV=flake8 - - env: TOXENV=pylint + - env: TOXENV=pyroma + - env: TOXENV=xenon + - env: TOXENV=vulture # docs stage - stage: docs env: TOXENV=doc8 @@ -28,9 +30,8 @@ jobs: matrix: allow_failures: - - env: TOXENV=pylint - - env: TOXENV=doc8 - - env: TOXENV=docs + - env: TOXENV=xenon + - env: TOXENV=vulture install: - sh -c 'if [ "$TOXENV" = "py" ]; then pip install tox codecov; else pip install tox; fi' diff --git a/Dockerfile b/Dockerfile index 2673419..a28b391 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,3 @@ - # 1. Build with: docker build -t bio2bel/mirbase . # 2. Run with docker run -p 5000:5000 bio2bel/mirbase (-p maps the port) FROM python:3.7.0 diff --git a/doc8.ini b/doc8.ini new file mode 100644 index 0000000..509a0a7 --- /dev/null +++ b/doc8.ini @@ -0,0 +1,2 @@ +[doc8] +max-line-length = 120 diff --git a/tox.ini b/tox.ini index 2849457..ca6a8a9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,27 +1,20 @@ -# Tox (http://tox.testrun.org/) is a tool for running tests -# in multiple virtualenvs. This configuration file will run the -# test suite on all supported python versions. To use it, "pip install tox" -# and then run "tox" from this directory. - [tox] envlist = - # always keep coverage-clean first coverage-clean - # code linters/stylers manifest flake8 - # pylint - # documentation linters/checkers - # doc8 + vulture + xenon + pyroma readme - # docs - # the actual tests + doc8 + docs py - # always keep coverage-report last coverage-report [testenv] -commands = coverage run -p -m pytest --durations=20 {posargs:tests} +commands = coverage run -p -m pytest tests {posargs} +passenv = TRAVIS CI deps = coverage pytest @@ -45,32 +38,38 @@ basepython = python3 skip_install = true deps = flake8 - flake8-bandit - flake8-colors - flake8-docstrings - flake8-import-order + flake8-docstrings>=0.2.7 + flake8-import-order>=0.9 pep8-naming + flake8-colors commands = flake8 src/bio2bel_mirbase/ tests/ setup.py -description = Run the flake8 tool with several plugins (bandit, docstrings, import order, pep8 naming). -[testenv:pylint] -basepython = python3 -deps = - pyflakes - pylint -commands = - pylint src/bio2bel_mirbase +[testenv:vulture] +deps = vulture +skip_install = true +commands = vulture src/bio2bel_mirbase/ +description = Run the vulture tool to look for dead code. -[testenv:doc8] -basepython = python3 +[testenv:xenon] +deps = xenon +skip_install = true +commands = xenon --max-average A --max-modules A --max-absolute B . +description = Run the xenon tool to monitor code complexity. + +[testenv:mypy] +deps = mypy skip_install = true +commands = mypy --ignore-missing-imports src/bio2bel_mirbase/ +description = Run the mypy tool to check static typing on the project. + +[testenv:pyroma] deps = - sphinx - doc8 -commands = - doc8 docs/source/ README.rst -description = Run the doc8 tool to check the style of the RST files in the project docs. + pygments + pyroma +skip_install = true +commands = pyroma --min=10 . +description = Run the pyroma tool to check the project's package friendliness. [testenv:readme] commands = rst-lint README.rst @@ -84,7 +83,6 @@ changedir = docs deps = sphinx sphinx_rtd_theme - sphinx-click commands = mkdir -p {envtmpdir} cp -r source {envtmpdir}/source @@ -93,6 +91,15 @@ commands = cat {envtmpdir}/build/coverage/c.txt cat {envtmpdir}/build/coverage/python.txt +[testenv:doc8] +basepython = python3 +skip_install = true +deps = + sphinx + doc8 +commands = + doc8 docs/source/ README.rst + [testenv:coverage-report] deps = coverage skip_install = true @@ -132,15 +139,10 @@ commands = [testenv:finish] basepython = python3 skip_install = true -whitelist_externals = - /bin/git - /usr/local/bin/git deps = - {[testenv:build]deps} {[testenv:release]deps} bumpversion commands = - {[testenv:build]commands} bumpversion release {[testenv:release]commands} git push