✨ feat(toml): add generative env_list via product dict#3797
✨ feat(toml): add generative env_list via product dict#3797gaborbernat merged 1 commit intotox-dev:mainfrom
Conversation
TOML users had to manually enumerate environment matrices while INI had concise curly-brace expansion. This adds a TOML-native syntax using arrays and dicts that leverages TOML's type system and brings a capability INI lacks: exclusions. Product dicts compute the cartesian product of factor groups joined with dashes. Range dicts generate sequential factor lists with open-ended bounds matching INI's behavior. Documentation updated across all four Diataxis dimensions with TOML shown first in all tab pairs.
457f562 to
36da817
Compare
|
The tox.ini syntax was compact and understandable. Why not allow that same syntax in .toml? This dictionary seems cumbersome. |
I think this is one of those cases where it was understandable for people who knew. I was constantly reminded when talking to people unfamiliar with the project that they have no idea what's happening. Furthermore learning from the mistakes of various string markers being very difficult to compose I purposefully wanted to not use any string level information and have this schema be fully type safe via native toml. See how now we have a concrete IDE automatically validated schema generated and published. |
TOML users have had to manually enumerate every environment in
env_listwhen they need a test matrix, while INI users could write concise expressions likepy3{12,13}-django{42,50}. This gap made TOML configuration verbose and error-prone for projects with large matrices, and was one of the most visible feature disparities between the two formats.✨ This introduces a TOML-native
productdict syntax that leverages TOML's type system instead of mimicking INI's string-based brace expansion. Factor groups are expressed as arrays of strings or range dicts, and tox computes the Cartesian product joining combinations with-. Range dicts ({ prefix = "py3", start = 12, stop = 14 }) generate sequential factors, with open-ended bounds matching INI'spy3{10-}behavior. Anexcludekey allows skipping specific combinations — a capability not available in INI at all.Documentation has been updated across all four Diataxis dimensions (tutorial, how-to, reference, explanation) with TOML shown first in all tab pairs. The "TOML feature gaps" section has been renamed to "Format comparison" since generative
env_listwas the last major functional gap — only generative section names remain INI-exclusive. The JSON schema has been extended to validateproductdicts with their factor groups and optionalexcludearrays.