Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow ranges in generative environment list #3502

Open
mimre25 opened this issue Mar 20, 2025 · 1 comment
Open

Allow ranges in generative environment list #3502

mimre25 opened this issue Mar 20, 2025 · 1 comment

Comments

@mimre25
Copy link
Contributor

mimre25 commented Mar 20, 2025

What's the problem this feature will solve?

When supporting multiple versions, eg python 3.8 to python 3.13, I noticed myself always going with an environment definition a la:

[tox]
env_list = py3{8,9,10,11,12,13}

Which is a bit tedious and wordy.

Describe the solution you'd like

Before typing the above, I usually go with

[tox]
env_list = py3{8-13}

just to find out that this doesn't work.

I'd really like to have these ranges in there if possible.
It is terser and follows the natural reading flow of "from python 3.8 to python 3.13" instead of "python 3.8, python 3.9, python 3.10 ...".

Additional context

Happy to contribute a PR if I get a go-ahead. 🙂

@gaborbernat
Copy link
Member

Go ahead.

mimre25 added a commit to mimre25/tox that referenced this issue Mar 21, 2025
Implements tox-dev#3502. Now it is possible to use ranges within the {} of an
env specifier such as py3{10-13}.
I chose to implement it as a pre-processing string replacement that just
replaces the range with a literal enumeration of the range members.
This is mainly to avoid more in-depth handling of these ranges when it
coto generative environment lists.

Also moves CircularChainError from `of_type` to `types` to avoid a
circular import error. (kinda ironic :D)
mimre25 added a commit to mimre25/tox that referenced this issue Mar 21, 2025
Implements tox-dev#3502. Now it is possible to use ranges within the {} of an
env specifier such as py3{10-13}.
I chose to implement it as a pre-processing string replacement that just
replaces the range with a literal enumeration of the range members.
This is mainly to avoid more in-depth handling of these ranges when it
coto generative environment lists.

Also moves CircularChainError from `of_type` to `types` to avoid a
circular import error. (kinda ironic :D)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants