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

Inconsistent uv python find error message #8075

Closed
potoo0 opened this issue Oct 10, 2024 · 2 comments · Fixed by #8086
Closed

Inconsistent uv python find error message #8075

potoo0 opened this issue Oct 10, 2024 · 2 comments · Fixed by #8086
Labels
error messages Messaging when something goes wrong

Comments

@potoo0
Copy link
Contributor

potoo0 commented Oct 10, 2024

If virtualenv is activated, uv python find <not exists version> msg should be consistent regardless of the working path.

(cd ~; uv python find 3.13) error msg should the same as uv python find 3.13.

# code @ archlinux in ~/.venv/jupyter jupyter [16:44:32]
$ uv python find 3.12
/home/code/.venv/jupyter/bin/python3

# code @ archlinux in ~/.venv/jupyter jupyter [16:44:57]
$ (cd ~; uv python find 3.12)
/home/code/.venv/jupyter/bin/python3

# code @ archlinux in ~/.venv/jupyter jupyter [16:45:04]
$ uv python find 3.13
error: No interpreter found for Python 3.13 in virtual environments, managed installations, or system path

# code @ archlinux in ~/.venv/jupyter jupyter [16:45:11] C:2
$ (cd ~; uv python find 3.13)
error: Broken virtualenv `/home/code/.venv`: `pyvenv.cfg` is missing
@charliermarsh
Copy link
Member

\cc @zanieb

@charliermarsh charliermarsh added the error messages Messaging when something goes wrong label Oct 10, 2024
@potoo0
Copy link
Contributor Author

potoo0 commented Oct 10, 2024

python_find test error:

Testing started at 18:16 ...
/home/wsl/0-projects/uv/target/debug/deps/python_find-820b62fc917fea0d python_find --format=json --exact -Z unstable-options --show-output
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Snapshot: python_find
Source: crates/uv/tests/python_find.rs:28
────────────────────────────────────────────────────────────────────────────────
Expression: snapshot
────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬───────────────────────────────────────────────────────────────────
    1     1 │ exit_code: 2
    2     2 │ ----- stdout -----
    3     3 │ 
    4     4 │ ----- stderr -----
    5       │-error: No interpreter found in virtual environments, managed installations, or system path
          5 │+error: Broken virtualenv `/home/wsl/.venv`: `pyvenv.cfg` is missing
────────────┴───────────────────────────────────────────────────────────────────
To update snapshots run `cargo insta review`
Stopped on the first failure. Run `cargo insta test` to run all snapshots.

zanieb added a commit that referenced this issue Dec 10, 2024
…iscovery (#8086)

## Summary

Fix #8075.

Invalid discovered environments in the working directory should be
filtered out.

## Test Plan

- Test python_find

---------

Co-authored-by: Zanie Blue <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Messaging when something goes wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants