mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Support no-build-isolation-package
(#5894)
## Summary Resolves #5831 ## Test Plan `cargo test`
This commit is contained in:
parent
f7110e0a07
commit
acbd367ead
18 changed files with 468 additions and 16 deletions
|
@ -434,22 +434,25 @@ impl SourceBuild {
|
|||
Self::extract_pep517_backend(&source_tree, setup_py, &default_backend)
|
||||
.map_err(|err| *err)?;
|
||||
|
||||
let package_name = project.clone().map(|p| p.name);
|
||||
|
||||
// Create a virtual environment, or install into the shared environment if requested.
|
||||
let venv = match build_isolation {
|
||||
BuildIsolation::Isolated => uv_virtualenv::create_venv(
|
||||
let venv = if let Some(venv) = build_isolation.shared_environment(package_name.as_ref()) {
|
||||
venv.clone()
|
||||
} else {
|
||||
uv_virtualenv::create_venv(
|
||||
temp_dir.path(),
|
||||
interpreter.clone(),
|
||||
uv_virtualenv::Prompt::None,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
)?,
|
||||
BuildIsolation::Shared(venv) => venv.clone(),
|
||||
)?
|
||||
};
|
||||
|
||||
// Setup the build environment. If build isolation is disabled, we assume the build
|
||||
// environment is already setup.
|
||||
if build_isolation.is_isolated() {
|
||||
if build_isolation.is_isolated(package_name.as_ref()) {
|
||||
let resolved_requirements = Self::get_resolved_requirements(
|
||||
build_context,
|
||||
source_build_context,
|
||||
|
@ -499,7 +502,7 @@ impl SourceBuild {
|
|||
// Create the PEP 517 build environment. If build isolation is disabled, we assume the build
|
||||
// environment is already setup.
|
||||
let runner = PythonRunner::new(concurrent_builds);
|
||||
if build_isolation.is_isolated() {
|
||||
if build_isolation.is_isolated(package_name.as_ref()) {
|
||||
if let Some(pep517_backend) = &pep517_backend {
|
||||
create_pep517_build_environment(
|
||||
&runner,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue