Skip to content

Support version specifiers in nox's Python definition #814

@chrysle

Description

@chrysle

How would this feature be useful?

I think it would really spare some work to not have to hard-code the Python versions to use in nox's session decorator or elsewhere. Version specifiers are a clean and efficient way to specify version ranges and exclude versions. packaging could handle the parsing of the specifier set, as it's also already a dependency of nox. This might also be useful regarding what #811 proposes.

Describe the solution you'd like

Being able to specify something like the following in the end:

@nox.session(python=">=3.8,<=3.12,!=3.9")
def tests(session):
    pass

Describe alternatives you've considered

Working with the Python specification syntax that exists currently, which isn't too tedious.

Anything else?

No response

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