-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
134 lines (124 loc) · 3.48 KB
/
Copy pathtox.ini
File metadata and controls
134 lines (124 loc) · 3.48 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
[tox]
env_list =
pre-commit
py{311,312,313,314}
py311-min
bench
cargo-test
docs
labels =
unit = py311, py311-min, py312, py313, py314
# Minimum coverage thresholds (percent).
min_coverage = 70
[testenv]
runner = uv-venv-lock-runner
package = wheel
extras = full
dependency_groups = test
changedir = {envtmpdir}
set_env =
# Concurrent Rust wheel builds can hold uv's shared source-distribution
# cache lock long enough for another Windows tox environment to time out.
UV_CACHE_DIR = {envtmpdir}{/}.uv-cache
commands =
pytest -n=12 {toxinidir}/tests/
[testenv:pre-commit]
package = skip
changedir = {toxinidir}
passenv = SKIP
set_env =
UV_NO_SYNC = 1
UV_PROJECT_ENVIRONMENT = {envdir}
commands_pre =
dependency_groups = pre-commit, lint, test, docs, coverage
commands =
pre-commit run --all-files --show-diff-on-failure
[testenv:py314]
commands =
pytest \
-n=12 \
--cov=backtide \
--cov-report=xml:{toxinidir}/coverage.xml \
--cov-fail-under={[tox]min_coverage} \
{toxinidir}/tests/
[testenv:python-test]
# Build into tox instead of the source tree so a running Backtide process
# cannot lock the extension under test on Windows.
base_python = py314
package = skip
changedir = {toxinidir}
dependency_groups = test, coverage
passenv = PATH, LD_LIBRARY_PATH, LIBRARY_PATH, PYO3_PYTHON
set_env =
CARGO_BUILD_JOBS = 12
PYO3_PYTHON = {envpython}
allowlist_externals = uv
commands_pre =
{envpython} {toxinidir}/scripts/run_cargo.py \
{envpython} -m maturin build \
--profile dev \
--interpreter {envpython} \
--out {envtmpdir}{/}wheel
uv pip install \
--python {envpython} \
--reinstall \
--no-deps \
--no-index \
--find-links {envtmpdir}{/}wheel \
backtide
commands =
pytest -n=12 {posargs:{toxinidir}{/}tests{/}}
[testenv:py311-min]
# Test against the oldest compatible versions of direct runtime dependencies.
runner = uv-venv-runner
base_python = py311
allowlist_externals = uv
commands =
uv pip install \
--python {envpython} \
--resolution lowest-direct \
--reinstall \
-e {toxinidir}
pytest -n=12 {toxinidir}/tests/
[testenv:bench]
package = skip
changedir = {toxinidir}
commands_pre =
passenv = PATH, LD_LIBRARY_PATH, LIBRARY_PATH, PYO3_PYTHON
set_env =
PYO3_PYTHON = {envpython}
allowlist_externals = cargo
commands =
{envpython} {toxinidir}/scripts/run_cargo.py \
cargo bench \
--manifest-path src/backtide_core/Cargo.toml \
--no-default-features
[testenv:cargo-test]
# Merge native and Python integration coverage for the Rust extension.
package = skip
changedir = {toxinidir}
dependency_groups = test, coverage
passenv = PATH, LD_LIBRARY_PATH, LIBRARY_PATH, PYO3_PYTHON
set_env =
PYO3_PYTHON = {envpython}
allowlist_externals = cargo, rustup, uv
commands_pre =
rustup component add llvm-tools-preview
cargo install cargo-llvm-cov --locked
commands =
{envpython} {toxinidir}/scripts/run_cargo.py \
{envpython} {toxinidir}/scripts/rust_coverage.py \
--manifest {toxinidir}/src/backtide_core/Cargo.toml \
--fail-under {[tox]min_coverage} \
--workers 12 \
--output {toxinidir}/rust-coverage.info
[testenv:docs]
base_python = py313
package = editable
changedir = {toxinidir}
commands_pre =
dependency_groups = docs
set_env =
PYTHONPATH = {toxinidir}
commands =
mkdocs build --strict