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

Fix uv venv handling when VIRTUAL_ENV refers to an non-existant environment #4073

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Jun 5, 2024

Closes #4072

This was an accidental change in #4029 in which I had updated the pull request to support virtual environments as requested in review and forgot to revert it.

Separately, we shouldn't fail if VIRTUAL_ENV points to an empty directory and SystemPython::Allowed is used, will address that separately.

@zanieb zanieb added the bug Something isn't working label Jun 5, 2024
@zanieb
Copy link
Member Author

zanieb commented Jun 5, 2024

❯  VIRTUAL_ENV=/tmp/venv uv venv
  × failed to canonicalize path `/tmp/venv/bin/python3`
  ╰─▶ No such file or directory (os error 2)

❯ VIRTUAL_ENV=/tmp/venv cargo run -- venv -v
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.13s
     Running `target/debug/uv venv -v`
DEBUG Searching for Python interpreter in search path
DEBUG Found CPython 3.9.6 at `/usr/bin/python3` (search path)
Using Python 3.9.6 interpreter at: /Library/Developer/CommandLineTools/usr/bin/python3
Creating virtualenv at: .venv
INFO Removing existing directory
Activate with: source .venv/bin/activate

@zanieb zanieb enabled auto-merge (squash) June 5, 2024 20:49
@zanieb zanieb merged commit bacde42 into main Jun 5, 2024
46 checks passed
@zanieb zanieb deleted the zb/fix-venv branch June 5, 2024 20:50
zanieb added a commit that referenced this pull request Jun 6, 2024
For #4073

Demonstrated to fail without those changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with uv@0.2.7 in Dockerfile + venv
2 participants