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

dummy support for uv-installed pythons #842

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

saucoide
Copy link

A question more than a PR, now that uv supports bringing its own pythons, i wanted to try simplify a CI and not have to install python from other sources, but nox is currently now able to find uv-installed pythons (someone else's issue @UV about this same thing astral-sh/uv#6579 )

would it make sense to add a more fleshed out version of this? meaning passing the desired interpreter to uv venv -p {interpreter}, or should this be done by other mechanism that adds uv's python interpreters to $PATH ?

note: this is just a draft to show an example, kind of works but also breaks tests and probably breaks uv|virtualenv and other things

@henryiii
Copy link
Collaborator

henryiii commented Sep 6, 2024

I think it makes sense, especially if it's roughly this easy. :)

@saucoide
Copy link
Author

@henryiii i've updated this a bit, but there is a failing test locally test__resolved_interpreter_windows_path_and_version_fails which i dont quite understand though :/

@saucoide
Copy link
Author

im not happy about ignoring the uv-python cases for those windows tests, but i am not familiar with how nox works on windows to touch that part, so if anyone has any ideas it'll be helpful

@nugend
Copy link

nugend commented Sep 20, 2024

@saucoide Just want to express my appreciation for this PR. This has already made my life way easier!

caused problems with pypy
@saucoide
Copy link
Author

thanks but tbh i wouldn't use it just yet 😅 there is still something wrong with it, the tox-to-nox tests fails mixing up the interpreter depending on which order the tests are run, so there is something broken still

@saucoide
Copy link
Author

ok so this may be an issue with uv (or with how i thought it would behave) looks like if you run

uv python install pypy3.8 (there is a test that does it)

and then later on

uv venv -p python3.8 .venv

uv will go ahead and use the existing pypy to make the venv, will try to figure out if this is intended from uv's side or not

@henryiii
Copy link
Collaborator

I wonder if we could make pythonX -> cpythonX for uv? Just a thought.

@saucoide
Copy link
Author

I wonder if we could make pythonX -> cpythonX for uv? Just a thought.

yes I think we might have to, originally i thought passing it as-is to uv would be nice, because you can then specify the python with uv's own version syntax, and whatever versions they support e.g. 3.13t, without having to do any translation. But it looks like it it might not work out, depending on what they do here astral-sh/uv#7118

ill try to test tomorrow with replacing python/cpython

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

Successfully merging this pull request may close these issues.

3 participants