-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
57 lines (47 loc) · 1.42 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
[tox]
isolated_build = True
envlist = py38,py39,py310
[testenv]
# Define the test environment and its configurations
# means we'll run the equivalent of `pip install .[dev]`, also installing pytest
# and the linters from pyproject.toml
extras = dev
# Enable package caching
package_cache = .tox/cache
commands =
black --check src # Run black to check code formatting in the 'src' directory
isort --check src # Run isort to check import sorting in the 'src' directory
flake8 --config={toxinidir}/tox.ini src # Run flake8 linter using 'tox.ini' configuration in the 'src' directory
pytest
pydocstyle src
[tox.ini]
# Configuration for GitHub Actions
# maps the python version specified in a gh-action to an environment specified in envlist
# e.g. '3.8' python version is installed in the environment named 'py38', while '3.9' in the py39.
[gh-actions]
python =
3.8: py38 # Use 'py38' test environment for Python 3.8
3.9: py39 # Use 'py39' test environment for Python 3.9
3.10: py310 # Use 'py310' test environment for Python 3.10
# Define the flake8 linter configurations
[flake8]
max-complexity = 10
max-line-length = 100
exclude = '''
((\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.md
| \.toml
| \.cfg
| \.txt
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| examples
| __init__.py # Exclude __init__.py files
))'''