@@ -1499,39 +1499,55 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
1499
1499
}
1500
1500
1501
1501
// If this is GitHub URL, attempt to resolve to a precise commit using the GitHub API.
1502
- if let Some ( precise ) = self
1502
+ match self
1503
1503
. build_context
1504
1504
. git ( )
1505
1505
. github_fast_path (
1506
1506
resource. git ,
1507
1507
client. unmanaged . uncached_client ( resource. url ) . clone ( ) ,
1508
1508
)
1509
- . await ?
1509
+ . await
1510
1510
{
1511
- // There's no need to check the cache, since we can't use cached metadata if there are
1512
- // sources, and we can't know if there are sources without fetching the
1513
- // `pyproject.toml`.
1514
- //
1515
- // For the same reason, there's no need to write to the cache, since we won't be able to
1516
- // use it on subsequent runs.
1517
- if let Some ( metadata) = self
1518
- . github_metadata ( precise, source, resource, client)
1519
- . await ?
1520
- {
1521
- // Validate the metadata, but ignore it if the metadata doesn't match.
1522
- match validate_metadata ( source, & metadata) {
1523
- Ok ( ( ) ) => {
1524
- debug ! ( "Found static metadata via GitHub fast path for: {source}" ) ;
1525
- return Ok ( ArchiveMetadata {
1526
- metadata : Metadata :: from_metadata23 ( metadata) ,
1527
- hashes : vec ! [ ] ,
1528
- } ) ;
1511
+ Ok ( Some ( precise) ) => {
1512
+ // There's no need to check the cache, since we can't use cached metadata if there are
1513
+ // sources, and we can't know if there are sources without fetching the
1514
+ // `pyproject.toml`.
1515
+ //
1516
+ // For the same reason, there's no need to write to the cache, since we won't be able to
1517
+ // use it on subsequent runs.
1518
+ match self
1519
+ . github_metadata ( precise, source, resource, client)
1520
+ . await
1521
+ {
1522
+ Ok ( Some ( metadata) ) => {
1523
+ // Validate the metadata, but ignore it if the metadata doesn't match.
1524
+ match validate_metadata ( source, & metadata) {
1525
+ Ok ( ( ) ) => {
1526
+ debug ! ( "Found static metadata via GitHub fast path for: {source}" ) ;
1527
+ return Ok ( ArchiveMetadata {
1528
+ metadata : Metadata :: from_metadata23 ( metadata) ,
1529
+ hashes : vec ! [ ] ,
1530
+ } ) ;
1531
+ }
1532
+ Err ( err) => {
1533
+ debug ! ( "Ignoring `pyproject.toml` from GitHub for {source}: {err}" ) ;
1534
+ }
1535
+ }
1536
+ }
1537
+ Ok ( None ) => {
1538
+ // Nothing to do.
1529
1539
}
1530
1540
Err ( err) => {
1531
- debug ! ( "Ignoring `pyproject.toml` from GitHub for {source}: {err}" ) ;
1541
+ debug ! ( "Failed to fetch `pyproject.toml` via GitHub fast path for: {source} ( {err}) " ) ;
1532
1542
}
1533
1543
}
1534
1544
}
1545
+ Ok ( None ) => {
1546
+ // Nothing to do.
1547
+ }
1548
+ Err ( err) => {
1549
+ debug ! ( "Failed to resolve commit via GitHub fast path for: {source} ({err})" ) ;
1550
+ }
1535
1551
}
1536
1552
1537
1553
// Fetch the Git repository.
0 commit comments