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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
oliversen opened this issue Nov 28, 2024 · 0 comments · Fixed by #900
Closed

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

oliversen opened this issue Nov 28, 2024 · 0 comments · Fixed by #900
Labels

Comments

@oliversen
Copy link
Contributor

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

@oliversen oliversen added the bug label Nov 28, 2024
oliversen added a commit to oliversen/nox that referenced this issue Nov 28, 2024
henryiii pushed a commit to oliversen/nox that referenced this issue Dec 13, 2024
henryiii pushed a commit to oliversen/nox that referenced this issue Jan 15, 2025
henryiii added a commit that referenced this issue Jan 17, 2025
* Use `uv python install` only with uv backend

fix #899

* fix: include encoding on Windows

* tests: indicate installing Python interp not tested

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant