Skip to content

Conversation

Preocts
Copy link
Owner

@Preocts Preocts commented Aug 13, 2025

Per the official documentation of uv, uv tool run or uvx purposely ignore configuration files that select the python version to use.

This leads to complications when using nox, not wanting nox as a required dev dependency, and wanting to leverage uvx nox or using nox as an installed tool.

Solution: Reapply the python=False arguements for all sessions. For the test session which is expected to be run on multiple versions; check for the existance of UV_PYTHON and add that requirement to the cli flags as needed. For all other sessions, default to the .python-version pinned interpreter.

It was overlooked in #216 that uvx does not follow the configuration files for python versions. In my lack of awareness, I attributed the behavior to a successful solution. Instead, seeing 3.10 being used was nothing more than coincidence that my system's default python is also 3.10.

Per the official documentation of uv, `uv tool run` or `uvx` purposely
ignore configuration files that select the python version to use.

This leads to complications when using nox, not wanting nox as a
required dev dependency, and wanting to leverage `uvx nox` or using
`nox` as an installed tool.

Solution: Reapply the `python=False` arguements for all sessions. For
the `test` session which is expected to be run on multiple versions;
check for the existance of `UV_PYTHON` and add that requirement to the
cli flags as needed. For all other sessions, default to the
`.python-version` pinned interpreter.
@Preocts Preocts self-assigned this Aug 13, 2025
@Preocts Preocts marked this pull request as ready for review August 13, 2025 20:37
@Preocts Preocts merged commit 5335cfc into main Aug 13, 2025
8 checks passed
@Preocts Preocts deleted the uv-rework branch August 13, 2025 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant