✨ feat(tox): bump deps inside tox.toml substitutions#228
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
tox.tomlloader only bumped plain string entries, so a dependency tucked inside a native-TOML substitution table was silently left stale. 📦 Moderntox.tomlfiles lean on these tables for conditional and parametrized dependency sets, andenv_basetemplates were skipped entirely, leaving whole swaths of a config untouched by a bump.Loading now walks
requiresanddepsrecursively and collects specs from every branch a substitution can fall back to:if(then/else) andposargs/env/glob(default), nested cases included. ✨ Arefis deliberately left alone because its target is bumped where it is actually defined, and substitution metadata such as aglobpattern or anenvvariable name is never mistaken for a requirement. Section scanning also descends intoenv_basetemplates so their deps are covered alongsideenvsections.The same pass tightens typing: a recursive
TomlValuealias replacesAnyandobjectacross the loader, soisinstancenarrowing carries the parsed structure end to end without casts. Behavior for plain string deps is unchanged; the new coverage is purely additive.