Skip to content

✨ feat(tox): bump deps inside tox.toml substitutions#228

Merged
gaborbernat merged 1 commit into
mainfrom
feat/tox-toml-substitutions
Jun 13, 2026
Merged

✨ feat(tox): bump deps inside tox.toml substitutions#228
gaborbernat merged 1 commit into
mainfrom
feat/tox-toml-substitutions

Conversation

@gaborbernat

Copy link
Copy Markdown
Owner

The tox.toml loader only bumped plain string entries, so a dependency tucked inside a native-TOML substitution table was silently left stale. 📦 Modern tox.toml files lean on these tables for conditional and parametrized dependency sets, and env_base templates were skipped entirely, leaving whole swaths of a config untouched by a bump.

Loading now walks requires and deps recursively and collects specs from every branch a substitution can fall back to: if (then/else) and posargs/env/glob (default), nested cases included. ✨ A ref is deliberately left alone because its target is bumped where it is actually defined, and substitution metadata such as a glob pattern or an env variable name is never mistaken for a requirement. Section scanning also descends into env_base templates so their deps are covered alongside env sections.

The same pass tightens typing: a recursive TomlValue alias replaces Any and object across the loader, so isinstance narrowing carries the parsed structure end to end without casts. Behavior for plain string deps is unchanged; the new coverage is purely additive.

The tox.toml loader only bumped plain string entries, so dependencies
hidden inside native-TOML substitution tables were silently left stale.
A deps list may carry inline substitutions whose specs live in fallback
branches, and env_base templates were not inspected at all.

Walk requires/deps recursively, collecting specs from every branch a
substitution can fall back to: if (then/else) and posargs/env/glob
(default), nested ones included. References are left untouched since
their target is bumped where it is defined, and metadata such as a glob
pattern or env var name is never mistaken for a spec. Section scanning
now also descends into env_base templates.

Typing was tightened in the same pass: a recursive TomlValue alias
replaces Any/object throughout, so narrowing carries the structure end
to end without casts.
@gaborbernat gaborbernat added the enhancement New feature or request label Jun 13, 2026
@gaborbernat gaborbernat merged commit 3d69a93 into main Jun 13, 2026
25 checks passed
@gaborbernat gaborbernat deleted the feat/tox-toml-substitutions branch June 13, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant