-
Notifications
You must be signed in to change notification settings - Fork 2
/
tox.ini
55 lines (47 loc) · 1.53 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
[tox]
min_version = 4.0
isolated_build = True
# python 3.11 and 3.12 test ok on Linux but fail on Windows due to Pillow
# Currently used Pillow 9.0.1 only supports Python 3.10 according to
# https://pillow.readthedocs.io/en/latest/installation.html#python-support
envlist = py{38,39,310,311,312}, docs, lint, format-check
[testenv]
allowlist_externals = poetry
skip_install = True
passenv = *
py_folders = examples libpdf tests
commands=
poetry install
py.test -n auto --tb=long
[testenv:py312]
# Generate coverage report only for latest Python
commands=
poetry install
poetry run py.test -n auto --tb=long --cov=libpdf --cov-fail-under=80
[testenv:docs]
basepython = python3.12
changedir = docs
commands =
poetry install
poetry run sphinx-build -W -b html . _build/html
[testenv:lint]
basepython = python3.12
commands=
poetry install --no-root
poetry run ruff format --check {[testenv]py_folders}
# the custom ruff config file makes different file lists for formatting and linting possible;
# ruff linting is extended over time to more and more files that get touched in new PRs
poetry run ruff --config ruff-lint.toml --output-format=concise
[testenv:format-check]
basepython = python3.12
commands=
poetry install --no-root
poetry run ruff format --check {[testenv]py_folders}
[testenv:format]
basepython = python3.12
commands=
poetry install --no-root
poetry run ruff format {[testenv]py_folders}
poetry run ruff check --fix --exit-zero --silent {[testenv]py_folders}
[pytest]
testpaths = tests