A thin wrapper for uv with external venv management
Project description
prime-uve
A thin wrapper for uv that provides seamless external venv management with automatic environment loading.
Why prime-uve?
For some project venv location is preferable outside the project root, on the local machine (e.g. if a project is save on a network share, venv should not be there for performance reasons). Tools like poetry do manage venv in a cache location, but uv does not easily: uv can read venv path from the environment variable UV_PROJECT_ENVIRONMENT, and the variable needs to be set for every subsequent uv call. Managing this manually is tedious and error-prone.
uv by default does not load environment variables from a .env, but it can run any command loading environment variables from a .env file with the --env-file <file> flag. Therefore this syntax is valid:
uv run --env-file <.env> -- uv [command]
prime-uve automates loading .env.uve for every command and provides tooling to manage venvs in a centralized location outside project roots.
As a side effect this tool also run uv with any environment variables the user decide to set in the .env.uve file.
Features
uvecommand - Alias foruv run --env-file .env.uve -- uv [command]prime-uveCLI - Venv management with external venv locations- Automatic
.env.uvediscovery - Walks up directory tree to find config - Cross-platform paths - Uses expandable env variables (
$HOME) - Centralized venv storage - Keep venvs organized outside project directories
- Orphan detection - Track and clean up venvs from deleted projects
Installation
Install system-wide as a CLI tool:
uv tool install prime-uve
Quick Start
1. Initialize a project
cd your-project/
uv init # generate the pyproject.toml
prime-uve init
This creates .env.uve with:
UV_PROJECT_ENVIRONMENT="$HOME/prime-uve/venvs/<project_name>_<hash>"
2. Use uve instead of uv
uve sync # Instead of: uv run --env-file .env.uve -- uv sync
uve add requests # Instead of: uv run --env-file .env.uve -- uv add requests
uve run python script.py # Instead of: uv run --env-file .env.uve -- uv run python script.py
.env.uve File Lookup
The lookup logic for .env.uve:
- Look for
.env.uvein current directory - If not found and cwd is not project root (no
pyproject.toml), walk up the tree
This ensures commands work correctly from any subdirectory within your project.
Venv Management Commands
prime-uve list
List all managed venvs with validation:
- Checks if projects still exist
- Verifies paths match
.env.uvemappings - Highlights orphaned venvs
prime-uve prune
Remove venvs from cache:
--all- Clean everything--orphan- Clean only orphan venvs (deleted or moved projects)path/to/venv- Clean specific venv--current- Clean venv mapped to current project
Path Configuration
Venv paths use environment variables for cross-platform compatibility:
# path uses $env variables for cross-platform compatibility
UV_PROJECT_ENVIRONMENT="$HOME/prime-uve/venvs/<project_name>_<hash>"
The path includes:
- Project name - From
pyproject.toml - Short hash - Derived from project path to ensure uniqueness
Architecture
Current Status: Early development phase. Core commands implemented:
prime-uve init- Initialize project venvprime-uve list- List managed venvsprime-uve prune- Clean up orphaned venvs
License
MIT License - see LICENSE file for details.
Credits
Built on top of uv by Astral.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prime_uve-0.1.2.tar.gz.
File metadata
- Download URL: prime_uve-0.1.2.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
614b885dffe04f902ceda533255dc60f513b8680e820dad7152c6653c9b7134d
|
|
| MD5 |
35da015d2165182c206871639db6cb92
|
|
| BLAKE2b-256 |
35d0483127aa2caa0589b24ac549655dfa4afd231e083ab5f244d4962b178311
|
Provenance
The following attestation bundles were made for prime_uve-0.1.2.tar.gz:
Publisher:
release.yml on kompre/prime-uve
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prime_uve-0.1.2.tar.gz -
Subject digest:
614b885dffe04f902ceda533255dc60f513b8680e820dad7152c6653c9b7134d - Sigstore transparency entry: 741683171
- Sigstore integration time:
-
Permalink:
kompre/prime-uve@336c45ecb470dae7134ff5e19713ab2e8be4c1f3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kompre
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@336c45ecb470dae7134ff5e19713ab2e8be4c1f3 -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file prime_uve-0.1.2-py3-none-any.whl.
File metadata
- Download URL: prime_uve-0.1.2-py3-none-any.whl
- Upload date:
- Size: 31.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4b96d980284ef16d9c51f668bdfb2e6a679fd83a658adc55af71382e290d1e6
|
|
| MD5 |
9aec945e57b9f5fae99347d138d92c2c
|
|
| BLAKE2b-256 |
5de59de4d8db8c786d724ba3e246f8b6b75fd1841825b135b2960059011a2b3b
|
Provenance
The following attestation bundles were made for prime_uve-0.1.2-py3-none-any.whl:
Publisher:
release.yml on kompre/prime-uve
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prime_uve-0.1.2-py3-none-any.whl -
Subject digest:
d4b96d980284ef16d9c51f668bdfb2e6a679fd83a658adc55af71382e290d1e6 - Sigstore transparency entry: 741683181
- Sigstore integration time:
-
Permalink:
kompre/prime-uve@336c45ecb470dae7134ff5e19713ab2e8be4c1f3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kompre
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@336c45ecb470dae7134ff5e19713ab2e8be4c1f3 -
Trigger Event:
pull_request
-
Statement type: