Skip to content

Allow open ended generative option for python interpreter #3583

@ssbarnea

Description

@ssbarnea

What's the problem this feature will solve?

The main goal is to reduce the need to update the list of python test environments when a new version of python is released.

Current situation requires updating at least env_list to include add new versions of python. Also, minimal version of python needs to be manually updated and kept in sync with requires-python.

Describe the solution you'd like

It would be very useful to have some kind of generative options that would eliminate this manual updates, maybe something like:

  • py{3.9-} which would expand to all known/available interpreters starting with 3.9. Is an extension of currently supported py3{9-13} as it was added by feat(config): Allow ranges in envlist #3503
  • {supported_pythons} which would even remove the need to set minimal one, which would be taken from requires-python`

Alternative Solutions

Additional context

We might want to allow plugins to change the behavior because while user might not have python3.14 installed on his system, tox-uv plugin might be able to install it on demand.

It would also be useful to recommend a consistent way to name tox environments as currently I seen a wide range of names:

  • py310 - probably most popular, also having the advantage of being able to use py when you just want to use your default version when running tests.
  • 3.10 - just numeric, currently used by tox, tox-uv,.. downside is there is no way to declare an expansion that refers to all python versions but no other environments. To clarify, imagine that I want to declare an environment variable only for unittest regardless the python version. How can I do this?
  • other combinations

Maybe I should add that last part into a separate ticket? If we agree on a recommended naming, it would be much easier to document it and seek to make the tox usage more consistent between projects, with less surprises regarding how environment names are named. Because tox magically allow random names, I ended with some accidents more than once, where I did run tox -e <something> that was not really supported but it did run and gave me a false positive.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions