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
14 changed files with 342 additions and 77 deletions
+3
View File
@@ -17,6 +17,7 @@ use puffin_client::RegistryClientBuilder;
use puffin_dispatch::BuildDispatch;
use puffin_interpreter::Virtualenv;
use puffin_resolver::{Manifest, ResolutionOptions, Resolver};
use puffin_traits::SetupPyStrategy;
#[derive(ValueEnum, Default, Clone)]
pub(crate) enum ResolveCliFormat {
@@ -50,6 +51,7 @@ pub(crate) async fn resolve_cli(args: ResolveCliArgs) -> Result<()> {
let venv = Virtualenv::from_env(platform, &cache)?;
let client = RegistryClientBuilder::new(cache.clone()).build();
let index_urls = IndexUrls::default();
let setup_py = SetupPyStrategy::default();
let build_dispatch = BuildDispatch::new(
&client,
@@ -57,6 +59,7 @@ pub(crate) async fn resolve_cli(args: ResolveCliArgs) -> Result<()> {
venv.interpreter(),
&index_urls,
venv.python_executable(),
setup_py,
args.no_build,
);