-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtox.ini
57 lines (52 loc) · 2.15 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]
env_list = py{36,37,38,39,310,311,312},pylint,ruff-check,ruff-format,ruff-format-check
skipsdist = true
isolated_build=true
[testenv]
unit_tests = {toxinidir}/tests/
module_files =
{toxinidir}/hotkdump
allowlist_externals =
py36: bash
setenv =
# (mkg): The latest pip in these environments fail to clone
# ubuntu-dev-tools on Bionic with the following message:
# "error: Server does not allow request for unadvertised
# object b7f368591bd45b02523356071943d1223822d8db"
# Pinning the pip version meanwhile.
py36: VIRTUALENV_PIP=20.3.4
py37: VIRTUALENV_PIP=20.3.4
py38: VIRTUALENV_PIP=20.3.4
description = run the test suite with pytest
deps =
# Note that this is awkwardly installs the package
# itself and not only [optional-dependencies.testing].
# see: https://github.com/pypa/pip/issues/11440
py{36,37,38,39,310,311,312},pylint,ruff-check,ruff-format-check,ruff-format: .[testing] # Install & test dependencies
commands =
py36: pip3 install toml
py36: bash -c "pip3 install $(python extras/py36-all-requirements.py)"
pytest {posargs}
[testenv:pylint]
commands =
pylint --recursive=y -v {posargs:{[testenv]module_files}}
# It's fine for unit tests to not have docstrings. Also, pytest does not like static test cases.
pylint --recursive=y -v {posargs:{[testenv]unit_tests}} --disable=missing-function-docstring,missing-class-docstring,no-self-use
[testenv:ruff-check]
# ruff is not compatible with py36 atm.
basepython = py37,py38,py39,py310,py311,py312
commands =
ruff check {posargs:{[testenv]module_files}}
ruff check {posargs:{[testenv]unit_tests}}
[testenv:ruff-format]
# ruff is not compatible with py36 atm.
basepython = py37,py38,py39,py310,py311,py312
commands =
ruff format --target-version=py37 {posargs:{[testenv]module_files}}
ruff format --target-version=py37 {posargs:{[testenv]unit_tests}}
[testenv:ruff-format-check]
# ruff is not compatible with py36 atm.
basepython = py37,py38,py39,py310,py311,py312
commands =
ruff format --target-version=py37 --diff {posargs:{[testenv]module_files}}
ruff format --target-version=py37 --diff {posargs:{[testenv]unit_tests}}