Skip to content

Commit f7d0dfa

Browse files
build(tox): migrate from pip to uv via tox-uv
Replace pip-backed virtualenv environments with uv using the tox-uv plugin. - [tox] requires: swap virtualenv<20.26.3 pin for tox-uv; the virtualenv pin existed solely to prevent pip 24.1 being seeded into envs, which is irrelevant once uv manages all installs - setenv: remove py3.14t VIRTUALENV_PIP=24.1 (virtualenv-specific, no-op with tox-uv's uv venv) - commands: remove bare 'pip install' workaround lines; tox-uv does not seed pip into venvs so these would fail - deps: add flask v1 compat packages (itsdangerous, markupsafe, jinja2) as factor-conditional deps to replace the removed pip install commands; the urllib3<2.0.0 boto3 pin was already present in the auto-generated deps - CI templates updated (test_group.jinja); run scripts/generate-test-files.sh to regenerate the .github/workflows/test-integrations-*.yml files Test matrix (envlist, Python versions, deps) is unchanged. Note: Python 3.6 container handling is deferred; see plan canvas for the recommended approach of running tox under a modern Python host. Co-authored-by: Neel Shah <neel.shah@sentry.io> --- [View Session in Sentry](https://sentry.sentry.io/traces/?project=4510944073809921&query=gen_ai.conversation.id%3A%22slack%3AC02T4BB83AS%3A1779437966.628249%22)
1 parent b1e999d commit f7d0dfa

3 files changed

Lines changed: 21 additions & 21 deletions

File tree

scripts/populate_tox/tox.jinja

100755100644
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414

1515
[tox]
1616
requires =
17-
# This version introduced using pip 24.1 which does not work with older Celery and HTTPX versions.
18-
virtualenv<20.26.3
17+
tox-uv
1918
envlist =
2019
# === Common ===
2120
{py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14,py3.14t}-common
@@ -167,14 +166,20 @@ deps =
167166

168167
{% endfor %}
169168

169+
# === Compatibility overrides ===
170+
# These replace the old `pip install` workaround commands that pip-backed tox used.
171+
# tox-uv does not seed pip into venvs, so all installs must go through deps.
172+
173+
; https://github.com/pallets/flask/issues/4455
174+
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: itsdangerous>=0.24,<2.0
175+
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: markupsafe<2.0.0
176+
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: jinja2<3.1.1
177+
170178
setenv =
171179
PYTHONDONTWRITEBYTECODE=1
172180
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
173181
COVERAGE_FILE=.coverage-sentry-{envname}
174182
py3.6: COVERAGE_RCFILE=.coveragerc36
175-
# Lowest version to support free-threading
176-
# https://discuss.python.org/t/announcement-pip-24-1-release/56281
177-
py3.14t: VIRTUALENV_PIP=24.1
178183

179184
django: DJANGO_SETTINGS_MODULE=tests.integrations.django.myapp.settings
180185
spark-v{3.0.3,3.5.6}: JAVA_HOME=/usr/lib/jvm/temurin-11-jdk-amd64
@@ -237,11 +242,6 @@ basepython =
237242
ruff: python3.14
238243

239244
commands =
240-
{py3.7,py3.8}-boto3: pip install urllib3<2.0.0
241-
242-
; https://github.com/pallets/flask/issues/4455
243-
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: pip install "itsdangerous>=0.24,<2.0" "markupsafe<2.0.0" "jinja2<3.1.1"
244-
245245
; Running `pytest` as an executable suffers from an import error
246246
; when loading tests in scenarios. In particular, django fails to
247247
; load the settings from the test module.

scripts/split_tox_gh_actions/templates/test_group.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969

7070
- name: Setup Test Env
7171
run: |
72-
pip install "coverage[toml]" tox
72+
python -m pip install "coverage[toml]" tox tox-uv
7373
- name: Erase coverage
7474
run: |
7575
coverage erase

tox.ini

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414

1515
[tox]
1616
requires =
17-
# This version introduced using pip 24.1 which does not work with older Celery and HTTPX versions.
18-
virtualenv<20.26.3
17+
tox-uv
1918
envlist =
2019
# === Common ===
2120
{py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14,py3.14t}-common
@@ -942,16 +941,22 @@ deps =
942941
typer-v0.25.1: typer==0.25.1
943942
typer-latest: typer==0.25.1
944943

944+
# === Compatibility overrides ===
945+
# These replace the old `pip install` workaround commands that pip-backed tox used.
946+
# tox-uv does not seed pip into venvs, so all installs must go through deps.
947+
948+
; https://github.com/pallets/flask/issues/4455
949+
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: itsdangerous>=0.24,<2.0
950+
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: markupsafe<2.0.0
951+
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: jinja2<3.1.1
952+
945953

946954

947955
setenv =
948956
PYTHONDONTWRITEBYTECODE=1
949957
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
950958
COVERAGE_FILE=.coverage-sentry-{envname}
951959
py3.6: COVERAGE_RCFILE=.coveragerc36
952-
# Lowest version to support free-threading
953-
# https://discuss.python.org/t/announcement-pip-24-1-release/56281
954-
py3.14t: VIRTUALENV_PIP=24.1
955960

956961
django: DJANGO_SETTINGS_MODULE=tests.integrations.django.myapp.settings
957962
spark-v{3.0.3,3.5.6}: JAVA_HOME=/usr/lib/jvm/temurin-11-jdk-amd64
@@ -1070,11 +1075,6 @@ basepython =
10701075
ruff: python3.14
10711076

10721077
commands =
1073-
{py3.7,py3.8}-boto3: pip install urllib3<2.0.0
1074-
1075-
; https://github.com/pallets/flask/issues/4455
1076-
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: pip install "itsdangerous>=0.24,<2.0" "markupsafe<2.0.0" "jinja2<3.1.1"
1077-
10781078
; Running `pytest` as an executable suffers from an import error
10791079
; when loading tests in scenarios. In particular, django fails to
10801080
; load the settings from the test module.

0 commit comments

Comments
 (0)