Default to PEP 517-based builds (#843)

## Summary

Our current setup uses the legacy `setup.py`-based builds if a
`pyproject.toml` file isn't present. This matches pip's behavior.
However, `pypa/build` uses PEP 517-based builds in such cases, and it
looks like pip plans to make that the default
(https://github.com/pypa/pip/issues/9175), with the limiting factor
being performance issues related to isolated builds.

This is now the default behavior, but the `--legacy-setup-py` flag
allows users to opt-in to using `setup.py` directly for distributions
that lack a `pyproject.toml`.
This commit is contained in:
Charlie Marsh 2024-01-09 20:27:06 -05:00 committed by GitHub
parent e26dc8e33d
commit 55f2be72e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 342 additions and 77 deletions

View file

@ -20,7 +20,7 @@ use puffin_interpreter::{Interpreter, Virtualenv};
use puffin_resolver::{
Manifest, PreReleaseMode, ResolutionGraph, ResolutionMode, ResolutionOptions, Resolver,
};
use puffin_traits::{BuildContext, BuildKind, SourceBuildTrait};
use puffin_traits::{BuildContext, BuildKind, SetupPyStrategy, SourceBuildTrait};
// Exclude any packages uploaded after this date.
static EXCLUDE_NEWER: Lazy<DateTime<Utc>> = Lazy::new(|| {
@ -49,6 +49,14 @@ impl BuildContext for DummyContext {
panic!("The test should not need to build source distributions")
}
fn no_build(&self) -> bool {
false
}
fn setup_py_strategy(&self) -> SetupPyStrategy {
SetupPyStrategy::default()
}
async fn resolve<'a>(&'a self, _requirements: &'a [Requirement]) -> Result<Resolution> {
panic!("The test should not need to build source distributions")
}