Skip to content

Conversation

@EliteTK
Copy link
Contributor

@EliteTK EliteTK commented Dec 29, 2025

Summary

I believe this mostly addresses #16709. Now specifying a simple version with --python or specifying a version using --python-version will result in the specified version getting downloaded with a fallback to the previous behaviour if the download fails for some transient reason or if downloads are disabled.

The behaviour of how --python gets treated as --python-version if a "simple version" is specified is kept. This means that --python 3.7 turns into a soft requirement. This seems at odds with how other similar parts of UV work, but there seem to be quite a few tests which test for this specific behaviour and I think this is best saved for a separate issue.

Test Plan

I added a test case which would previously fall back to the default interpreter and warn about it.

@EliteTK EliteTK added the enhancement New feature or improvement to existing functionality label Dec 29, 2025
@EliteTK EliteTK temporarily deployed to uv-test-registries December 29, 2025 13:01 — with GitHub Actions Inactive
Comment on lines +1491 to +1492
Ok(Err(error)) => return Err(error.into()),
Err(error) => return Err(error.into()),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a question here regarding if we should instead just report these errors and continue instead of propagating them upstream, as this is kind of a breaking change.

Copy link
Member

Choose a reason for hiding this comment

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

I think it seems reasonable to fail on error as long as we don't fail on things like... offline mode being enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this specific context, downloads_enabled is passed the combined management preference, download preference, and offline state. So this block won't get ran in the offline case.

Copy link
Member

Choose a reason for hiding this comment

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

I guess the concern is like... if you wifi is off?

Comment on lines +1510 to +1511
// If both approaches fail, and a specific patch version was requested try
// again allowing a different patch version
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we use the same strategy when downloading?

Copy link
Member

Choose a reason for hiding this comment

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

That seems technically correct, though I can't say it's definitely worth it without seeing the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know why github let me make a link and then produced whatever broken thing that was...

I mean the code above in the if downloads_enabled block.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think it's only the error handling that might be annoying? I think you should try it.

@EliteTK EliteTK requested a review from zanieb December 29, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants