Skip to content

Nox installs Python using uv with non-uv backend #899

@oliversen

Description

@oliversen

Current Behavior

Nox installs Python using uv with non-uv backend. If uv is installed on the system.

Expected Behavior

Don't use uv to install Python with non-uv backend.

Steps To Reproduce

noxfile.py:

import nox

@nox.session(python="3.8")
def lint(session):
    ...

Invoke nox -s lint.

If Python 3.8 is not installed globally:

nox > Running session lint
Installed Python 3.8.20 in 2m 20s
 + cpython-3.8.20-windows-x86_64-none
nox > Creating virtual environment (virtualenv) using python3.8 in .nox\lint
nox > Command ...\.venv\Scripts\python.exe -m virtualenv '...\.nox\lint' -p python3.8 failed with exit code 1:
RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3.8'
nox > Session lint failed.

If Python 3.8 is installed globally.

nox > Running session lint
Installed Python 3.8.20 in 3m 55s
 + cpython-3.8.20-windows-x86_64-none
nox > Creating virtual environment (virtualenv) using python3.8 in .nox\lint
nox > Session lint was successful.

Nox installed Python using uv. But the Nox session virtual environment uses the globally installed version of Python. Because virtualenv is not compatible with uv.

Environment

- OS: Windows 10
- Python: 3.11
- Nox: 2024.10.9

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions