Skip to content

feat: upgrade to uv 0.7.19#4091

Merged
tdejager merged 11 commits intoprefix-dev:mainfrom
tdejager:feat/uv-gt-0-7-19
Jul 8, 2025
Merged

feat: upgrade to uv 0.7.19#4091
tdejager merged 11 commits intoprefix-dev:mainfrom
tdejager:feat/uv-gt-0-7-19

Conversation

@tdejager
Copy link
Contributor

@tdejager tdejager commented Jul 4, 2025

Upgrade to uv 0.7.19, so that we can prepare for a PR I hope to land in uv, because the upgrade always takes a while, I decide to start doing this now.

The main thing is, that uv now seems to strip the git+ prefix in some cases, so we had to start doing this as well. Please check this all very closely in the review please :) They've also added a DisplaySafeUrl, which is similar to Url redaction you've added @nichmor.

@tdejager tdejager requested a review from nichmor July 4, 2025 15:33
uv-platform-tags = { git = "https://github.com/astral-sh/uv", tag = "0.7.8" }
uv-pypi-types = { git = "https://github.com/astral-sh/uv", tag = "0.7.8" }
uv-requirements-txt = { git = "https://github.com/astral-sh/uv", tag = "0.7.8" }
uv-build-frontend = { git = "https://github.com/astral-sh/uv", tag = "0.7.19" }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tag upgrade here.

Comment on lines +401 to +402
reqwest-middleware = { git = "https://github.com/astral-sh/reqwest-middleware", rev = "ad8b9d332d1773fde8b4cd008486de5973e0a3f8" }
reqwest-retry = { git = "https://github.com/astral-sh/reqwest-middleware", rev = "ad8b9d332d1773fde8b4cd008486de5973e0a3f8" }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need these patched versions, I took them from the uv repo on the designated tag.

uv-installer = { workspace = true }
uv-normalize = { workspace = true }
uv-python = { workspace = true }
uv-redacted = { workspace = true }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the new url redaction stuff.

let index = options
.index_url
.clone()
.map(DisplaySafeUrl::from)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to map into this from now on.

);

PinnedGitSpec::new(dist.git.repository().clone(), pinned_checkout)
PinnedGitSpec::new(dist.git.repository().clone().into(), pinned_checkout)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Again we need to go back to Url in this case..

let expected_uv_req = RequirementSource::Git {
git: uv_git_types::GitUrl::from_fields(
Url::parse("ssh://git@github.com/user/test.git").unwrap(),
DisplaySafeUrl::parse("ssh://git@github.com/user/test.git").unwrap(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New type here as well.

// Before hitting the network let's make sure the credentials are available to uv
for url in self.index_locations.indexes().map(|index| index.url()) {
let success = store_credentials_from_url(url);
let success = store_credentials_from_url(url.url());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an IndexUrl, which should still contain the credentials...

Comment on lines +115 to +121
let url = url
.to_string()
.strip_prefix("git+")
.map(ToString::to_string)
.unwrap_or_else(|| url.to_string())
.parse::<Url>()
.unwrap();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To get the test to work..

Comment on lines -251 to +258
if locked_git_url.url.repository()
!= &installed_repository_url.into_url()
{
let locked_repository_url =
RepositoryUrl::new(locked_git_url.url.repository());
if locked_repository_url != installed_repository_url {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would now errorneously do a comparison with fragments, so the test failed, tried to get it to work here.

Comment on lines +516 to +525
fn build_arena(&self) -> &BuildArena<Self::SourceDistBuilder> {
// Ensure the build dispatch is initialized
self.ensure_build_dispatch_initialized();

// Get the inner build dispatch and delegate to its build_arena method
self.build_dispatch
.get()
.expect("build dispatch not initialized, this is a programming error")
.build_arena()
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New type introduced by uv, we are just forwarding the implementation.

Copy link
Contributor

@nichmor nichmor left a comment

Choose a reason for hiding this comment

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

Looks good! some small comments

@tdejager tdejager enabled auto-merge (squash) July 7, 2025 11:47
@tdejager tdejager added the test:extra_slow Run the extra slow tests label Jul 7, 2025
Copy link
Contributor

@nichmor nichmor left a comment

Choose a reason for hiding this comment

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

awesomus!

@tdejager tdejager merged commit 1e11b3d into prefix-dev:main Jul 8, 2025
73 of 74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:extra_slow Run the extra slow tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants