mirror of
https://github.com/astral-sh/uv.git
synced 2025-09-26 12:09:12 +00:00
Avoid removing seed packages for uv venv --seed
environments (#7410)
## Summary Closes https://github.com/astral-sh/uv/issues/7121.
This commit is contained in:
parent
8d4b6ca971
commit
f895c40a4e
12 changed files with 115 additions and 14 deletions
|
@ -43,6 +43,7 @@ fn write_cfg(f: &mut impl Write, data: &[(String, String)]) -> io::Result<()> {
|
|||
}
|
||||
|
||||
/// Create a [`VirtualEnvironment`] at the given location.
|
||||
#[allow(clippy::fn_params_excessive_bools)]
|
||||
pub(crate) fn create(
|
||||
location: &Path,
|
||||
interpreter: &Interpreter,
|
||||
|
@ -50,6 +51,7 @@ pub(crate) fn create(
|
|||
system_site_packages: bool,
|
||||
allow_existing: bool,
|
||||
relocatable: bool,
|
||||
seed: bool,
|
||||
) -> Result<VirtualEnvironment, Error> {
|
||||
// Determine the base Python executable; that is, the Python executable that should be
|
||||
// considered the "base" for the virtual environment. This is typically the Python executable
|
||||
|
@ -350,16 +352,16 @@ pub(crate) fn create(
|
|||
"false".to_string()
|
||||
},
|
||||
),
|
||||
(
|
||||
"relocatable".to_string(),
|
||||
if relocatable {
|
||||
"true".to_string()
|
||||
} else {
|
||||
"false".to_string()
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
if relocatable {
|
||||
pyvenv_cfg_data.push(("relocatable".to_string(), "true".to_string()));
|
||||
}
|
||||
|
||||
if seed {
|
||||
pyvenv_cfg_data.push(("seed".to_string(), "true".to_string()));
|
||||
}
|
||||
|
||||
if let Some(prompt) = prompt {
|
||||
pyvenv_cfg_data.push(("prompt".to_string(), prompt));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue