Respect direct URLs in puffin installer (#345)

We now write the `direct_url.json` when installing, and _skip_
installing if we find a package installed via the direct URL that the
user is requesting.

A lot of TODOs, especially around cleaning up the `Source` abstraction
and its relationship to `DirectUrl`. I'm gonna keep working on these
today, but this works and makes the requirements clear.

Closes #332.
This commit is contained in:
Charlie Marsh 2023-11-07 06:11:27 -08:00 committed by GitHub
parent 55ad1c89be
commit 2c32bc5a86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 464 additions and 44 deletions

View file

@ -146,6 +146,11 @@ impl<'a, T: BuildContext> SourceDistributionFetcher<'a, T> {
return Ok(None);
};
// If the commit already contains a complete SHA, short-circuit.
if git.precise().is_some() {
return Ok(None);
}
// Fetch the precise SHA of the Git reference (which could be a branch, a tag, a partial
// commit, etc.).
let dir = self.0.cache().join(GIT_CACHE);