uv-package-manager

Manages Python dependencies, virtual environments, and lockfiles using the uv package manager.

Updated Oct 7, 2022
One-click install
npx skills add https://github.com/tamagusko/linux-cfg --skill uv-package-manager-tamagusko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: uv-package-manager
Source: https://github.com/tamagusko/linux-cfg/tree/main/dotfiles/claude/skills/uv-package-manager
Command: npx skills add https://github.com/tamagusko/linux-cfg --skill uv-package-manager-tamagusko

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Slow Python package installation, inconsistent dependency resolution, and fragmented tooling across pip, pip-tools, and poetry make Python project setup tedious and error-prone. This Skill provides complete guidance for using uv, a Rust-based package manager that handles installation, virtual environments, Python versions, and lockfiles in one tool. ## Core Features & Use Cases - Dependency Management: Add, remove, upgrade, and lock packages with uv add, uv remove, uv lock, and uv sync for reproducible builds via uv.lock. - Environment & Python Management: Create virtual environments with uv venv, install and pin Python versions with uv python install and uv python pin, and run commands without activation using uv run. - Workflow Integration: Covers CI/CD pipelines with GitHub Actions, optimized multi-stage Docker builds, monorepo workspaces, pre-commit hooks, and migration from pip, poetry, and pip-tools. - Use Case: You clone a repository containing pyproject.toml and uv.lock, run uv sync --all-extras to recreate the exact environment in seconds, then execute the test suite with uv run pytest without manually activating anything. ## Quick Start Ask the AI to initialize a new Python project with uv, pin Python 3.12, add fastapi and pytest as dependencies, and generate the lockfile.

Frequently Asked Questions about uv-package-manager

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I install Python packages with uv?

Use `uv add package-name` inside a project to add it to pyproject.toml and install it, or `uv pip install package-name` for pip-compatible installs. uv resolves and installs packages 10-100x faster than pip using its global cache.

How do I create a virtual environment with uv?

Run `uv venv` to create a .venv directory, optionally with `uv venv --python 3.12` for a specific version. You can skip activation entirely by prefixing commands with `uv run`, such as `uv run pytest`.

What is the difference between uv and poetry?

uv is significantly faster than poetry and less opinionated, while reading the same pyproject.toml project format. Existing poetry projects can switch by running `uv sync` directly, since uv understands standard [project] metadata.

Does uv support lockfiles for reproducible builds?

Yes, `uv lock` generates a uv.lock file pinning exact dependency versions, and `uv sync --frozen` installs from it without re-resolving. You can also export to requirements.txt with hashes using `uv export --format requirements-txt --hash`.

How do I use uv in a Dockerfile?

Copy the uv binary from the official ghcr.io/astral-sh/uv image, then run `uv sync --frozen --no-dev` after copying pyproject.toml and uv.lock. A multi-stage build can copy only the resulting .venv into the runtime image for smaller containers.

Why is my uv lockfile out of sync with pyproject.toml?

The lockfile becomes stale when dependencies in pyproject.toml change without relocking. Run `uv lock --upgrade` to regenerate it, or `uv lock --check` in CI to detect drift before installing.