Fall back to PEP 517 hooks for non-compliant PEP 621 metadata (#2662)

If you pass a `pyproject.toml` that use Hatch's context formatting API,
we currently fail because the dependencies aren't valid under PEP 508.
This PR makes the static metadata parsing a little more relaxed, so that
we appropriately fall back to PEP 517 there.
This commit is contained in:
Charlie Marsh 2024-03-25 22:28:39 -04:00 committed by GitHub
parent 12846c2c85
commit 39769d82a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 347 additions and 160 deletions

View file

@ -92,10 +92,7 @@ impl<'a> SourceTreeResolver<'a> {
SourceDistCachedBuilder::new(context, client)
};
let metadata = builder
.download_and_build_metadata(&source)
.await
.context("Failed to build source distribution")?;
let metadata = builder.download_and_build_metadata(&source).await?;
// Determine the appropriate requirements to return based on the extras. This involves
// evaluating the `extras` expression in any markers, but preserving the remaining marker