forked from OCA/pylint-odoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
61 lines (56 loc) · 1.88 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]
envlist =
lint,
update-readme,
build,
py38,
py39,
py310,
py311,
py312
[testenv]
parallel_show_output=true
setenv =
PYTHONPATH={toxinidir}/tests
PYTHONUNBUFFERED=yes
# Compatible with "tox --parallel" to avoid concurrency
COVERAGE_FILE={toxinidir}/.coverage.{envname}
COVERAGE_CONTEXT={envname}
passenv =
*
deps = -r{toxinidir}/test-requirements.txt
usedevelop = true
commands =
pytest -s --cov --cov-report=term-missing --cov-report=html -vv {posargs:}
[testenv:update-readme]
basepython = {env:TOXPYTHON:python3.10}
setenv =
{[testenv]setenv}
BUILD_README=true
usedevelop = true
commands =
{posargs:pytest -svvk test_build_docstring}
deps =
{[testenv]deps}
[testenv:lint]
skip_install = true
commands =
pre-commit run --all-files --show-diff-on-failure --color=always
[testenv:build]
skip_install = true
deps =
{[testenv]deps}
commands =
python -m build --sdist --wheel --outdir dist_wo_pbr/
python -c "import shutil;shutil.rmtree('dist/', ignore_errors=True)"
python -m build --no-isolation --sdist --wheel --outdir dist/ # Generate ChangeLog with pbr
python -m twine check --strict dist/*
bump2version patch --allow-dirty --no-commit --no-tag --dry-run --verbose
# Install packages from binaries to test if all files were already included in the compressed file
python -c '''import sys,pip,os,glob;os.chdir("dist");sys.argv = ["", "install", "-U", "--force-reinstall", glob.glob("*.tar.gz")[-1], "--use-feature=no-binary-enable-wheel-cache"];pip.main()'''
# Testing the package is importing the dependencies well
python -c '''from pylint.lint import Run;import os;os.chdir("dist");res = Run(["--load-plugins=pylint_odoo", "-c", "non-exists.cfg", "--disable=all", "--enable=odoolint", "--list-msgs-enabled"])'''
[testenv:clean]
commands = coverage erase
skip_install = true
deps = coverage