-
Notifications
You must be signed in to change notification settings - Fork 23
/
tox.ini
93 lines (84 loc) · 2.31 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
[tox]
skipsdist = true
envlist = clean, py{36,37}, flake8, black, mypy, manifest, docs
# Linters
[testenv:flake8]
skip_install = true
deps = flake8
commands = flake8 bookstore --count --ignore=E,C,W,F401,F403,F811,F821,F841,E402,I100,I101,D400 --max-complexity=23 --max-line-length=104 --show-source --statistics
[testenv:black]
skip_install = true
deps = black
commands = black --check --verbose .
# Typing
[testenv:mypy]
skip_install = true
deps = mypy==0.660
commands = mypy bookstore --ignore-missing-imports
# Manifest
[testenv:manifest]
skip_install = true
deps = check-manifest
commands = check-manifest
# Docs
[testenv:docs]
description = invoke sphinx-build to build the HTML docs
deps = .[docs]
commands =
sphinx-build -d "{toxworkdir}/docs_doctree" docs/source "{toxworkdir}/docs_out" --color -bhtml {posargs}
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'
# Distro
[testenv:dist]
skip_install = true
setenv =
SKIP_PIP_CHECK = 1
# Have to use /bin/bash or the `*` will cause that argument to get quoted by the tox command line...
commands =
python setup.py sdist --dist-dir={distdir} bdist_wheel --dist-dir={distdir}
/bin/bash -c 'python -m pip install -U --force-reinstall {distdir}/bookstore*.whl'
/bin/bash -c 'python -m pip install -U --force-reinstall --no-deps {distdir}/bookstore*.tar.gz'
[testenv]
# disable Python's hash randomization for tests that stringify dicts, etc
setenv =
PYTHONHASHSEED = 0
AWS_ACCESS_KEY_ID=foobar_key
AWS_SECRET_ACCESS_KEY=foobar_secret
passenv =
*
TOXENV
CI
TRAVIS
TRAVIS_*
CODECOV_*
basepython =
py36: python3.6
py37: python3.7
flake8: python3.6
black: python3.6
mypy: python3.6
manifest: python3.6
dist: python3.6
docs: python3.6
clean: python3.6
deps =
.[test]
pytest
depends =
py36: clean
commands =
pytest -v --maxfail=2 --cov-config=.coveragerc --cov=bookstore -W always bookstore/tests/
py36: coverage report
py36: coverage html
commands_post =
py36: codecov -e TOXENV
[testenv:clean]
deps = coverage
skip_install = true
commands = coverage erase
[pytest]
python_files = test_*.py
env =
AWS_SECRET_ACCESS_KEY=foobar_secret
AWS_ACCESS_KEY_ID=foobar_key
markers =
asyncio