-
Notifications
You must be signed in to change notification settings - Fork 2.3k
avoid fetching an exact, cached commit, even if it isn't locked #13748
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
Changes from all commits
f25e78c
fb53177
23de37c
41a6e9f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2111,6 +2111,53 @@ fn install_git_public_https_missing_commit() { | |||||
| "###); | ||||||
| } | ||||||
|
|
||||||
| #[test] | ||||||
| #[cfg(feature = "git")] | ||||||
| fn install_git_public_https_exact_commit() { | ||||||
| let context = TestContext::new(DEFAULT_PYTHON_VERSION); | ||||||
|
|
||||||
| // `uv pip install` a Git dependency with an exact commit. | ||||||
| uv_snapshot!(context.filters(), context.pip_install() | ||||||
| // Normally Updating/Updated notifications are suppressed in tests (because their order can | ||||||
| // be nondeterministic), but here that's exactly what we want to test for. | ||||||
| .env_remove(EnvVars::UV_TEST_NO_CLI_PROGRESS) | ||||||
| // Whether fetching happens during resolution or later depends on whether the GitHub fast | ||||||
| // path is taken, which isn't reliable. Disable it, so that we get a stable order of events | ||||||
| // here. | ||||||
| .env(EnvVars::UV_NO_GITHUB_FAST_PATH, "true") | ||||||
| .arg("uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage@b270df1a2fb5d012294e9aaf05e7e0bab1e6a389") | ||||||
| , @r" | ||||||
| success: true | ||||||
| exit_code: 0 | ||||||
| ----- stdout ----- | ||||||
|
|
||||||
| ----- stderr ----- | ||||||
| Updating https://github.com/astral-test/uv-public-pypackage (b270df1a2fb5d012294e9aaf05e7e0bab1e6a389) | ||||||
| Updated https://github.com/astral-test/uv-public-pypackage (b270df1a2fb5d012294e9aaf05e7e0bab1e6a389) | ||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test occasionally flakes for me, and I can't understand why. Sometimes, rarely, the uv/crates/uv/src/commands/pip/install.rs Line 466 in dc3fd46
...happens strictly before this call to uv/crates/uv/src/commands/pip/install.rs Line 508 in dc3fd46
I'm clearly overlooking something, but I'm not sure what. Maybe the answer is to just filter out the "Resolved..." line, but I want to understand it.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is that the one resolved by |
||||||
| Resolved 1 package in [TIME] | ||||||
| Building uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage@b270df1a2fb5d012294e9aaf05e7e0bab1e6a389 | ||||||
| Built uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage@b270df1a2fb5d012294e9aaf05e7e0bab1e6a389 | ||||||
| Prepared 1 package in [TIME] | ||||||
| Installed 1 package in [TIME] | ||||||
| + uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@b270df1a2fb5d012294e9aaf05e7e0bab1e6a389) | ||||||
| "); | ||||||
|
|
||||||
| // Run the exact same command again, with that commit now in cache. | ||||||
| uv_snapshot!(context.filters(), context.pip_install() | ||||||
| .env_remove(EnvVars::UV_TEST_NO_CLI_PROGRESS) | ||||||
| .env(EnvVars::UV_NO_GITHUB_FAST_PATH, "true") | ||||||
| .arg("uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage@b270df1a2fb5d012294e9aaf05e7e0bab1e6a389") | ||||||
| , @r" | ||||||
| success: true | ||||||
| exit_code: 0 | ||||||
| ----- stdout ----- | ||||||
|
|
||||||
| ----- stderr ----- | ||||||
| Resolved 1 package in [TIME] | ||||||
| Audited 1 package in [TIME] | ||||||
| "); | ||||||
| } | ||||||
|
|
||||||
| /// Install a package from a private GitHub repository using a PAT | ||||||
| #[test] | ||||||
| #[cfg(all(not(windows), feature = "git"))] | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added strict
GitOidparsing to this PR, since it simplifies the new code insources.rsand it doesn't seem to break anything.