-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
Running uv sync --active will delete and recreate the activated virtualenv when the following environment is used:
UV_PYTHON_INSTALL_DIR=.python-installs # MUST be a relative path
UV_PYTHON_PREFERENCE=only-managed
UV_PYTHON_DOWNLOADS=automatic
This happens regardless of whether the active virtualenv already uses a uv managed python.
As the --active flag is designed for syncing to a virtualenv "outside of the project or script" I would never expect the sync command to delete it.
Example (from within a uv project directory)
export UV_PYTHON_INSTALL_DIR=.python-installs
export UV_PYTHON_PREFERENCE=only-managed
export UV_PYTHON_DOWNLOADS=automatic
uv venv foobar
source foobar/bin/activate
uv sync --active # stdout tells you that uv "Removed virtual environment at: foobar"
Platform
Linux 6.8.0-85-generic x86_64 GNU/Linux
Version
uv 0.9.7
Python version
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working