Skip to main content

uvenv - workflow tool for uv.

The uvenv command is a wrapper around the uv command. It provides a simple interface for managing Python projects, inspired by tools like pipenv, but using requirements.txt and requirements.in files.

Note: This is an active work in progress. Some features may not be fully implemented, and are subject to change.

Project Structure

uvenv assumes the following project structure:

  • requirements.in — A file containing the packages to be installed.
  • requirements.txt — A lockfile containing the exact versions of the packages to be installed.
  • .venv — A directory containing the virtual environment.

uvenv will automatically discover the project root by searching for these files in the current directory and its parents.

Environment Variables

uvenv allows you to customize the locations of key files and directories using environment variables:

  • UVENV_REQUIREMENTS_IN: Specifies the location of the requirements input file (default: requirements.in)
  • UVENV_REQUIREMENTS_TXT: Specifies the location of the requirements lockfile (default: requirements.txt)
  • UVENV_VENV_DIR: Specifies the directory for the virtual environment (default: .venv)
  • UVENV_UV: Specifies the path to the uv executable (default: uv)
  • UVENV_PYTHON: Specifies the Python interpreter to use (default: python)

For example, to use a different name for your requirements file:

$ export UVENV_REQUIREMENTS_IN=requirements-dev.in
$ export UVENV_REQUIREMENTS_TXT=requirements-dev.txt
$ export UVENV_VENV_DIR=~/.venvs/myproject

$ uvenv install

Commands

uvenv currently provides the following primary commands:

  • uvenv install — Install the packages in requirements.in.
  • uvenv uninstall — Uninstall the packages in requirements.in.
  • uvenv lock — Generate or update the lockfile in requirements.txt.

Philosophy

  • Simplicity: uvenv aims to provide a simple and intuitive interface for managing Python projects.
  • Speed: uvenv leverages the speed of uv for dependency management and virtual environment creation.
  • Flexibility: uvenv aims to be flexible and support a variety of project structures and workflows.
  • Compatibility: uvenv aims to be compatible with a variety of Python versions and platforms.
  • Minimalism: uvenv aims to be minimal and avoid unnecessary complexity.
  • Power: uvenv aims to provide powerful features for managing Python projects.
  • Community: uvenv aims to be community-driven and open-source.

Features

  • Automatic project root discovery
  • Virtual environment management
  • Dependency installation and uninstallation
  • Requirements locking
  • Command running within the virtual environment
  • Interactive shell with activated virtual environment

Installation

To install uvenv, you need to have Python 3.6+ and uv installed. Then you can install uvenv using pip:

$ pip install uvenv-cli

Usage

uvenv provides the following commands:

Install

Install dependencies or specific packages:

$ uvenv install
$ uvenv install <package1> <package2>

Uninstall

Remove specific packages:

$ uvenv uninstall <package1> <package2>

Lock

Generate or update requirements.txt:

$ uvenv lock

Help

Show help message:

$ uvenv --help

Project Structure

uvenv expects your project to have either a requirements.txt or requirements.in file in the project root. It will automatically discover the project root by searching for these files in the current directory and its parents.

Usage

  1. Start a new project:

    $ mkdir myproject
    $ cd myproject
    $ echo "requests==2.26.0" > requirements.in
    $ uvenv install
    
  2. Add a new package:

    $ uvenv install numpy
    
  3. Remove a package:

    $ uvenv uninstall requests
    
  4. Update locked requirements:

    $ uvenv lock
    

Upcoming features

  1. Run a Python script:

    $ uvenv run python myscript.py
    
  2. Start an interactive shell:

    $ uvenv shell
    

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project will be licensed under the MIT License.

Metadata

Release files for uvenv-cli 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uvenv-cli 0.1.1
File Size Uploaded Provenance Actions
uvenv_cli-0.1.1.tar.gz 8.5 kB Without provenance Details for uvenv_cli-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for uvenv-cli 0.1.1
File Interpreter ABI Platform Actions
uvenv_cli-0.1.1-py2.py3-none-any.whl Python 2, Python 3 none any Details for uvenv_cli-0.1.1-py2.py3-none-any.whl

Total release size: 16.0 kB

Release files / uvenv_cli-0.1.1.tar.gz

Download URL uvenv_cli-0.1.1.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2d5edda7665fd29be3b5e76393630e6166616396269861e82b96a5868bd11563
BLAKE2b-256 checksum
How to use checksums
3db3c196e1b8971ec8a1fb531ce15e87cd6527778bb6fe867df712c774f8f2a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.6

Release files / uvenv_cli-0.1.1-py2.py3-none-any.whl

Download URL uvenv_cli-0.1.1-py2.py3-none-any.whl
Size 7.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
729b297ee78b1f1d8e8ee1c882bba731f6d876121606ed7bc68ce8038360a3fa
BLAKE2b-256 checksum
How to use checksums
f3f62bc7fabf6a468403b049b07cc0b1a5195bb95d525c16177d3a44c9624273
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.6

Security for uvenv-cli 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page