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

Add test case for uv python list downloads #12381

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

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Mar 21, 2025

Requires #12380
Extends new tests from #12374

Is waiting for dependent PRs to merge; for early review see a27c93e

@zanieb zanieb added the testing Internal testing of behavior label Mar 21, 2025
@zanieb zanieb changed the base branch from main to zb/python-list-test March 21, 2025 18:56
@zanieb zanieb changed the base branch from zb/python-list-test to zb/list-tests March 21, 2025 18:56
let context: TestContext = TestContext::new_with_versions(&[]).with_filtered_python_keys();

// We show all interpreters
uv_snapshot!(context.filters(), context.python_list().env_remove("UV_PYTHON_DOWNLOADS"), @r"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might not actually be cross-platform. Testing in CI.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not, so we'll filter to a subset of Python versions on top of #12375

@zanieb
Copy link
Member Author

zanieb commented Mar 21, 2025

Interesting, both Linux and Windows have a couple 3.7 versions

Snapshot: python_list_downloads
Source: crates/uv/tests/it/python_list.rs:143
────────────────────────────────────────────────────────────────────────────────
Expression: snapshot
────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬───────────────────────────────────────────────────────────────────
    8     8 │ cpython-3.11.11-[PLATFORM]                  <download available>
    9     9 │ cpython-3.10.16-[PLATFORM]                  <download available>
   10    10 │ cpython-3.9.21-[PLATFORM]                   <download available>
   11    11 │ cpython-3.8.20-[PLATFORM]                   <download available>
         12 │+cpython-3.7.9-[PLATFORM]                    <download available>
   12    13 │ pypy-3.11.11-[PLATFORM]                     <download available>
   13    14 │ pypy-3.10.16-[PLATFORM]                     <download available>
   14    15 │ pypy-3.9.19-[PLATFORM]                      <download available>
   15    16 │ pypy-3.8.16-[PLATFORM]                      <download available>
         17 │+pypy-3.7.13-[PLATFORM]                      <download available>
   16    18 │ 
   17    19 │ ----- stderr -----
────────────┴───────────────────────────────────────────────────────────────────

@zanieb zanieb force-pushed the zb/list-tests-downloads branch from ad689e3 to e403ad1 Compare March 21, 2025 20:34
@zanieb zanieb force-pushed the zb/list-tests-downloads branch from e403ad1 to a27c93e Compare March 21, 2025 22:26
Base automatically changed from zb/list-tests to main March 23, 2025 02:57
zanieb added a commit that referenced this pull request Mar 23, 2025
Allows `uv python list <request>` to filter the installed list. I often
want this and it's not hard to add.

I tested the remote download filtering locally (#12381 is needed for
snapshot tests)

```
❯ cargo run -q -- python list --all-versions 3.13
cpython-3.13.2-macos-aarch64-none    <download available>
cpython-3.13.1-macos-aarch64-none    /opt/homebrew/opt/[email protected]/bin/python3.13 -> ../Frameworks/Python.framework/Versions/3.13/bin/python3.13
cpython-3.13.1-macos-aarch64-none    <download available>
cpython-3.13.0-macos-aarch64-none    /Users/zb/.local/share/uv/python/cpython-3.13.0-macos-aarch64-none/bin/python3.13
❯ cargo run -q -- python list --all-versions 3.13 --only-installed
cpython-3.13.1-macos-aarch64-none    /opt/homebrew/opt/[email protected]/bin/python3.13 -> ../Frameworks/Python.framework/Versions/3.13/bin/python3.13
cpython-3.13.0-macos-aarch64-none    /Users/zb/.local/share/uv/python/cpython-3.13.0-macos-aarch64-none/bin/python3.13
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Internal testing of behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants