Skip to content

Commit

Permalink
Update setup and testing config
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Sep 26, 2018
1 parent 915c4e7 commit 079bbb3
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 30 deletions.
30 changes: 30 additions & 0 deletions .flake8
@@ -0,0 +1,30 @@
#########################
# Flake8 Configuration #
# (.flake8) #
#########################
[flake8]
# flake8
exclude =
*.egg-info,
*.pyc,
.cache,
.eggs
.git,
.tox,
__pycache__,
build,
dist,
docs/source/conf.py,
format = ${cyan}%(path)s${reset}:${yellow_bold}%(row)d${reset}:${green_bold}%(col)d${reset}: ${red_bold}%(code)s${reset} %(text)s
ignore = S101
max-line-length = 120

# flake8-import-order
application-import-names =
bio2bel_phosphosite
bio2bel
tests
import-order-style = pycharm

# mccabe
max-complexity = 10
6 changes: 6 additions & 0 deletions .readthedocs.yml
@@ -0,0 +1,6 @@
# See: https://docs.readthedocs.io/en/latest/yaml-config.html
python:
version: 3
pip_install: true
extra_requirements:
- docs
52 changes: 33 additions & 19 deletions .travis.yml
@@ -1,28 +1,42 @@
sudo: false
cache: pip
services:
- mysql
language: python
python: 3.6
env:
global:
- BIO2BEL_CONNECTION=mysql+pymysql://travis@localhost/bio2bel?charset=utf8'
matrix:
- TOXENV=py
- TOXENV=docs
- TOXENV=manifest
- TOXENV=readme
before_install:
- pip install codecov
- pip install pymysql
- mysql -e 'CREATE DATABASE bio2bel CHARACTER SET utf8 COLLATE utf8_general_ci;'
- mysql -e "GRANT ALL PRIVILEGES ON bio2bel.* to 'travis'@'%' WITH GRANT OPTION;"
python:
- 3.6
stages:
- lint
- docs
- test
jobs:
include:
# lint stage
- stage: lint
env: TOXENV=manifest
- env: TOXENV=flake8
- env: TOXENV=vulture
- env: TOXENV=mypy
- env: TOXENV=pyroma
# docs stage
- stage: docs
env: TOXENV=doc8
- env: TOXENV=readme
- env: TOXENV=docs
# test stage
- stage: test
env: TOXENV=py
matrix:
allow_failures:
- env: TOXENV=doc8
- env: TOXENV=docs
- env: TOXENV=flake8
- env: TOXENV=vulture
- env: TOXENV=mypy
- env: TOXENV=pyroma
install:
- pip install tox
- sh -c 'if [ "$TOXENV" = "py" ]; then pip install tox codecov; else pip install tox; fi'
script:
- tox
after_success:
- tox -e coverage-report
- codecov
- sh -c 'if [ "$TOXENV" = "py" ]; then tox -e coverage-report; codecov; fi'
notifications:
slack: pybel:n2KbWKBum3musnBg3L76gGwq
2 changes: 1 addition & 1 deletion MANIFEST.in
Expand Up @@ -8,4 +8,4 @@ include docs/Makefile
global-exclude *.py[cod] __pycache__ *.so *.dylib .DS_Store *.gpickle

exclude .bumpversion.cfg
include *.rst *.txt *.yml LICENSE tox.ini .coveragerc
include *.rst *.txt *.yml *.ini LICENSE .coveragerc
107 changes: 97 additions & 10 deletions tox.ini
Expand Up @@ -2,55 +2,142 @@
envlist =
coverage-clean
manifest
flake8
readme
doc8
docs
py
coverage-report

[testenv]
commands = coverage run -p -m pytest tests {posargs}
passenv = TRAVIS CI
passenv = CI TRAVIS TRAVIS_*
deps =
coverage
pytest
pybel
flask
flask-admin
whitelist_externals =
/bin/cat
/bin/cp
/bin/mkdir
/usr/bin/git
/usr/local/bin/hub

[testenv:coverage-clean]
deps = coverage
skip_install = true
commands = coverage erase

[testenv:manifest]
deps = check-manifest
skip_install = true
commands = check-manifest

[testenv:coverage-report]
deps = coverage
skip_install = true
commands =
coverage combine
coverage report

[testenv:readme]
commands = rst-lint README.rst
[testenv:manifest]
deps = check-manifest
commands = check-manifest
skip_install = true

[testenv:vulture]
deps = vulture
skip_install = true
commands = vulture src/bio2bel_phosphosite/
description = Run the vulture tool to look for dead code.

[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_phosphosite/
description = Run the mypy tool to check static typing on the project.

[testenv:pyroma]
deps =
restructuredtext_lint
pygments
pyroma
skip_install = true
commands = pyroma --min=10 .
description = Run the pyroma tool to check the project's package friendliness.
[testenv:docs]
changedir = docs
deps =
sphinx
sphinx_rtd_theme
sphinx-rtd-theme
sphinx-autodoc-typehints
commands =
mkdir -p {envtmpdir}
cp -r source {envtmpdir}/source
sphinx-build -W -b html -d {envtmpdir}/build/doctrees {envtmpdir}/source {envtmpdir}/build/html
sphinx-build -W -b coverage -d {envtmpdir}/build/doctrees {envtmpdir}/source {envtmpdir}/build/coverage
cat {envtmpdir}/build/coverage/c.txt
cat {envtmpdir}/build/coverage/python.txt
[testenv:readme]
commands = rst-lint README.rst
skip_install = true
deps =
restructuredtext_lint
pygments
[testenv:flake8]
basepython = python3
skip_install = true
deps =
flake8
flake8-docstrings>=0.2.7
flake8-import-order>=0.9
pep8-naming
flake8-colors
commands =
flake8 src/bio2bel_phosphosite/ tests/ setup.py
[testenv:doc8]
basepython = python3
skip_install = true
deps =
sphinx
doc8
commands =
doc8 docs/source/ README.rst
[testenv:build]
basepython = python3
skip_install = true
deps =
wheel
setuptools
commands =
python setup.py -q sdist bdist_wheel
[testenv:release]
basepython = python3
skip_install = true
deps =
{[testenv:build]deps}
twine >= 1.5.0
commands =
{[testenv:build]commands}
twine upload --skip-existing dist/*
[testenv:finish]
basepython = python3
skip_install = true
deps =
{[testenv:build]deps}
{[testenv:release]deps}
bumpversion
commands =
bumpversion release
{[testenv:release]commands}
git push
bumpversion patch

0 comments on commit 079bbb3

Please sign in to comment.