Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions scripts/populate_tox/tox.jinja
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

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

{% endfor %}

# === Compatibility overrides ===
# These replace the old `pip install` workaround commands that pip-backed tox used.
# tox-uv does not seed pip into venvs, so all installs must go through deps.

; https://github.com/pallets/flask/issues/4455
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: itsdangerous>=0.24,<2.0
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: markupsafe<2.0.0
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: jinja2<3.1.1

Check failure on line 176 in scripts/populate_tox/tox.jinja

View check run for this annotation

@sentry/warden / warden: find-bugs

Flask v1 compat deps use wrong factor selector and will never be installed

The condition `flask-v{1}` expands to the factor `flask-v1`, but the only Flask v1 environments in the envlist are named `flask-v1.1.4` (factor `v1.1.4`). Tox factor matching requires an exact match of each dash-separated component, so `v1 ≠ v1.1.4` — the `itsdangerous`, `markupsafe`, and `jinja2` compat deps will never be installed, leaving `py3.6/7/8-flask-v1.1.4` environments broken. The condition should be `flask-v1.1.4` and should include `py3.6`.
Comment on lines +174 to +176
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flask v1 compat deps use wrong factor selector and will never be installed

The condition flask-v{1} expands to the factor flask-v1, but the only Flask v1 environments in the envlist are named flask-v1.1.4 (factor v1.1.4). Tox factor matching requires an exact match of each dash-separated component, so v1 ≠ v1.1.4 — the itsdangerous, markupsafe, and jinja2 compat deps will never be installed, leaving py3.6/7/8-flask-v1.1.4 environments broken. The condition should be flask-v1.1.4 and should include py3.6.

Evidence
  • Envlist (tox.ini:295) defines only {py3.6,py3.7,py3.8}-flask-v1.1.4; no env with factor v1 exists.
  • flask-v{1} in a tox deps condition generates the compound factor selector flask-v1, which requires both flask and v1 to be present as dash-split factors in the env name.
  • Env py3.7-flask-v1.1.4 has factors py3.7, flask, v1.1.4v1 is absent, so the condition never fires.
  • By contrast, the existing flask-v1.1.4: markupsafe<2.1.0 (tox.ini:804) correctly uses the full versioned factor and does match.
  • The generated tox.ini (lines 949–951) reproduces the same broken selector verbatim, confirming the template is the source of truth.

Suggested fix: Replace flask-v{1} with flask-v1.1.4 and add the missing py3.6 factor to match the actual envlist entry.

Suggested change
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: itsdangerous>=0.24,<2.0
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: markupsafe<2.0.0
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: jinja2<3.1.1
{py3.6,py3.7,py3.8}-flask-v1.1.4: itsdangerous>=0.24,<2.0
{py3.6,py3.7,py3.8}-flask-v1.1.4: markupsafe<2.0.0
{py3.6,py3.7,py3.8}-flask-v1.1.4: jinja2<3.1.1
Also found at 1 additional location
  • tox.ini:949-951

Identified by Warden find-bugs · KJA-VQJ


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

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

commands =
{py3.7,py3.8}-boto3: pip install urllib3<2.0.0

; https://github.com/pallets/flask/issues/4455
{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"

; Running `pytest` as an executable suffers from an import error
; when loading tests in scenarios. In particular, django fails to
; load the settings from the test module.
Expand Down
2 changes: 1 addition & 1 deletion scripts/split_tox_gh_actions/templates/test_group.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

- name: Setup Test Env
run: |
pip install "coverage[toml]" tox
python -m pip install "coverage[toml]" tox tox-uv
- name: Erase coverage
run: |
coverage erase
Expand Down
20 changes: 10 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

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

# === Compatibility overrides ===
# These replace the old `pip install` workaround commands that pip-backed tox used.
# tox-uv does not seed pip into venvs, so all installs must go through deps.

; https://github.com/pallets/flask/issues/4455
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: itsdangerous>=0.24,<2.0
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: markupsafe<2.0.0
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: jinja2<3.1.1

Check failure on line 951 in tox.ini

View check run for this annotation

@sentry/warden / warden: find-bugs

[KJA-VQJ] Flask v1 compat deps use wrong factor selector and will never be installed (additional location)

The condition `flask-v{1}` expands to the factor `flask-v1`, but the only Flask v1 environments in the envlist are named `flask-v1.1.4` (factor `v1.1.4`). Tox factor matching requires an exact match of each dash-separated component, so `v1 ≠ v1.1.4` — the `itsdangerous`, `markupsafe`, and `jinja2` compat deps will never be installed, leaving `py3.6/7/8-flask-v1.1.4` environments broken. The condition should be `flask-v1.1.4` and should include `py3.6`.



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

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

commands =
{py3.7,py3.8}-boto3: pip install urllib3<2.0.0

; https://github.com/pallets/flask/issues/4455
{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"

; Running `pytest` as an executable suffers from an import error
; when loading tests in scenarios. In particular, django fails to
; load the settings from the test module.
Expand Down
Loading