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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable session's Python version display in the output of --list #733

Open
paduszyk opened this issue Aug 1, 2023 · 0 comments
Open

Enable session's Python version display in the output of --list #733

paduszyk opened this issue Aug 1, 2023 · 0 comments

Comments

@paduszyk
Copy link

paduszyk commented Aug 1, 2023

How would this feature be useful?

Having a session using different versions of Python, it would be nice (as I think, of course 馃槃) to have those printed by nox --list.

For example, for a session like this:

@nox.session(python=["3.9", "3.10", "3.11"])
def tests(session):
    """Run tests."""
    pass

printing the list result in:

- tests-3.9 -> Run tests.
- tests-3.10 -> Run tests.
- tests-3.11 -> Run tests.

Desired output would be:

- tests-3.9 -> Run tests (Python 3.9).
- tests-3.10 -> Run tests (Python 3.10).
- tests-3.11 -> Run tests (Python 3.11).

In tox, the solution was quite easy as one could interpolate env description using {basepython} variable.

Describe the solution you'd like

I think it's quite easy to implement. Updated must be:

https://github.com/paduszyk/nox/blob/274df9be1b977d7f4a6323f2dcb7ace6e49bf0bd/nox/sessions.py#L712-L718

Let me know if it makes sense. If so, I think I can open the respective PR.

Describe alternatives you've considered

No response

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant