Skip to content

Conversation

@marcosboger
Copy link
Contributor

Closes #3571
Partially fixes #3614 -> This PR covers the complaint about using dash syntax in deps. It does not address the complaint about nested braces syntax.

This PR refactors how expand_ranges is used when loading .ini config files. Instead of calling expand_ranges directly when expanding envs or section names, we expand it once we start finding the factor groups, in find_factor_groups() function.

This means that ranges in sections like deps and setenv will also be expanded. Before, only env_list and section names were expanded. Considered as bugfix due to the original issue classification, but could also arguably be considered a small feature.

The approach was done in this way so that we don't have to "remember" to call expand_ranges everywhere that we use the brace syntax {}. Instead, whenever we are expanding factors, transparently the ranges will be expanded.

  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

@marcosboger
Copy link
Contributor Author

Two doubts, open to input:

  • Would adding examples to the docs already be enough? Or should we add a new section explaining specifically this?
  • Should we also create a more complete parameterized test like test_env_list_expands_ranges for internal sections? Would be kinda redundant as they'll be leveraging same function for expansion, but open to hear opinions

@gaborbernat gaborbernat merged commit f8a88c1 into tox-dev:main Oct 24, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dash vs. comma format in bracketed section names in .ini is either broken or needs better docs Braced range expansion in tox.envlist vs testenv

2 participants