mirror of
https://github.com/astral-sh/uv
synced 2026-01-24 15:00:18 -05:00
By default, `uv venv <venv-name>` currently removes the `<venv-name`> directory if it exists. This can be surprising behavior: not everyone expects an existing environment to be overwritten. This PR updates the default to fail if a non-empty `<venv-name>` directory already exists and neither `--allow-existing` nor the new `-c/--clear` option is provided (if a TTY is detected, it prompts first). If it's not a TTY, then uv will only warn and not fail for now — we'll make this an error in the future. I've also added a corresponding `UV_VENV_CLEAR` env var. I've chosen to use `--clear` instead of `--force` for this option because it is used by the `venv` module and `virtualenv` and will be familiar to users. I also think its meaning is clearer in this context than `--force` (which could plausibly mean force overwrite just the virtual environment files, which is what our current `--allow-existing` option does). Closes #1472. --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
42 lines
1.0 KiB
TOML
42 lines
1.0 KiB
TOML
[package]
|
|
name = "uv-virtualenv"
|
|
version = "0.0.4"
|
|
publish = false
|
|
description = "virtualenv creation implemented in rust"
|
|
keywords = ["virtualenv", "venv", "python"]
|
|
|
|
edition = { workspace = true }
|
|
rust-version = { workspace = true }
|
|
homepage = { workspace = true }
|
|
documentation = { workspace = true }
|
|
repository = { workspace = true }
|
|
authors = { workspace = true }
|
|
license = { workspace = true }
|
|
|
|
[lib]
|
|
doctest = false
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
uv-configuration = { workspace = true }
|
|
uv-console = { workspace = true }
|
|
uv-fs = { workspace = true }
|
|
uv-pypi-types = { workspace = true }
|
|
uv-python = { workspace = true }
|
|
uv-shell = { workspace = true }
|
|
uv-version = { workspace = true }
|
|
uv-warnings = { workspace = true }
|
|
|
|
console = { workspace = true }
|
|
fs-err = { workspace = true }
|
|
itertools = { workspace = true }
|
|
owo-colors = { workspace = true }
|
|
pathdiff = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
tracing = { workspace = true }
|
|
|
|
[target.'cfg(target_os = "windows")'.dependencies]
|
|
self-replace = { workspace = true }
|