-
Notifications
You must be signed in to change notification settings - Fork 2
/
tox.ini
61 lines (55 loc) · 1.84 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
[tox]
requires =
tox ~= 4.6
env_list = ruffregression, ruff, mypy, pytest, build
[testenv:ruff]
description = run ruff linting
basepython = py39
deps =
ruff ~= 0.0.272
commands = ruff --ignore=C90,I,N,D,UP,ANN,BLE,A,COM,EM,PIE,T20,Q,RET,SIM,PTH,TD,ERA,PL,TRY,RUF,W291,W293,E722,ARG002,ARG003,E501,E713,B006,E714,E402,S110,S112,B904,SLF001,F401,B018 .
[testenv:black]
description = run black formatter
basepython = py39
deps =
black ~= 23.3.0
commands = black --check .
[testenv:mypy]
description = run mypy type checking
basepython = py39
deps =
mypy ~= 1.3.0
pytest ~= 7.3.2
extras = typed
commands = mypy --disable-error-code=no-untyped-call --disable-error-code=no-untyped-def .
[testenv:pytest]
description = run unit tests
basepython = py39
deps =
pytest ~= 7.3.2
# test_import.py must be tested separately, as it requires to import pysweepme at the exact moment
commands =
pytest tests/test_import.py
pytest tests --ignore tests/test_import.py
[testenv:ruffregression]
description = compare strict ruff failures to master
basepython = py39
deps =
ruff ~= 0.0.272
allowlist_externals = git, cmd
commands =
cmd /c "(if exist .tox\reference rmdir /S /Q .tox\reference) && mkdir .tox\reference"
git fetch origin main
git --work-tree=.tox/reference restore --source=origin/main -- .
cmd /c "cd .tox\reference && python -m venv .venv && .venv\Scripts\activate.bat && python -m pip install -e .[dev]"
cmd /c "copy pyproject.toml .tox\reference\pyproject.toml"
cmd /c "cd .tox\reference && .venv\Scripts\activate.bat && ruff --format=json . > ..\..\ref.json & exit 0"
cmd /c "ruff --format=json . > ruff.json & exit 0"
python .github\compare_ruff_output.py
[testenv:build]
description = create pysweepme wheel
basepython = py39
skip_install = True
deps =
build ~= 0.10.0
commands = python -m build --wheel