-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
82 lines (75 loc) · 2.68 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
[tox]
envlist =
py{38,39,310,311},
docs,
linters,
packaging,
migrations
skip_missing_interpreters = True
minversion = 4.0.0
isolated_build = true
# Configure special Tox environment used for isolated building of the source
# package.
[testenv:.package]
# Use the default Python 3 version available on the system.
# NOTE: This makes it portable to CI systems where only one particular Python 3
# version is installed.
basepython = python3
[testenv]
basepython =
docs,linters,packaging,migrations: python3.11
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11
extras =
docs: docs
!docs: test
passenv =
# Pass environment variables controlling project's tests.
py{38,39,310,311},migrations: TOXENV,ROLCA_*
whitelist_externals =
migrations: bash
ignore_errors =
!linters: false
# Run all linters to see their output even if one of them fails.
linters: true
commands_pre =
# Verify installed packages have compatible dependencies.
# NOTE: Running 'pip check' after installation is necessary since pip
# currently lacks dependency resolution which means it can silently create
# broken installations.
# For more details, see: https://github.com/pypa/pip/issues/988.
pip check
commands =
# General tests commands:
# Run tests.
# NOTE: PyTest is run as python module to use tha fact that Python adds
# the root directory to the system path.
py{38,39,310,311}: python -m pytest --cov=src/rolca {env:TEST_SUITE:src/rolca}
# Docs commands:
# Build documentation.
docs: python setup.py build_sphinx --fresh-env --warning-is-error
# Linter commands:
# Check documentation formatting (PEP 257).
linters: pydocstyle src/rolca
# Run PyFglakes and Ned Batchelder's McCabe script.
linters: flake8 src/rolca
# Check order of imports.
linters: isort --recursive --check-only --diff src/rolca
# Check code formatting.
linters: black --check src/rolca
# Packaging commands:
# Confirm that items checked into git are in sdist.
packaging: check-manifest
# Verify package metadata and confirm the long_description will render
# correctly on PyPI.
packaging: python setup.py check --metadata --strict
# Verify that long description will render correctly on PyPI.
packaging: python setup.py bdist_wheel sdist --quiet \
packaging: --dist-dir {toxworkdir}/packaging-test-dist
packaging: twine check {toxworkdir}/packaging-test-dist/*
# Migrations commands:
migrations: python tests/manage.py migrate
migrations: bash -c '[[ $(./tests/manage.py makemigrations --dry-run) = '\
migrations: '"No changes detected" ]] || exit 1'