{"name":"set-up-python-with-uv","description":"Sets up a Python project with uv - install the tool, create pyproject.toml, add packages, write a lockfile, and run commands without activating a venv by hand. Use when the user wants uv, a Python lockfile, or to replace pip and virtualenv for a project.","category":"backend","tags":["uv","python"],"models":["any"],"proven":false,"passing_families":0,"model_testing":"Not yet model-tested; testing Jan 2027","url":"https://theskillvault.ai/skills/set-up-python-with-uv","api_url":"https://theskillvault.ai/api/skills/set-up-python-with-uv","raw_url":"https://theskillvault.ai/api/skills/set-up-python-with-uv/raw","body":"# Set up Python with uv\n\nuv installs Python packages and manages the virtual environment for you. The project file is `pyproject.toml`. The lockfile is `uv.lock`. Commit both.\n\n## When to use\n- A repo still uses `pip install` and a checked-in pin file that nobody updates.\n- Two machines resolve different versions from the same file.\n- You want one command that creates the environment and runs a script.\n\n## When not to use\n- You need the shape of an HTTP API. uv does not design routes.\n- You need test layout, fixtures and mocks. That is a testing task. uv can install the runner, and that is all.\n\n## Steps\n1. Install uv with the official installer, Homebrew (`brew install uv`) or WinGet (`winget install --id=astral-sh.uv -e`). Confirm with `uv --version`.\n2. In an empty folder, run `uv init`. This writes `pyproject.toml` and a `.python-version` file. To pin the interpreter, run `uv python pin 3.12`.\n3. Add a library with `uv add requests`. Add a dev tool with `uv add --dev ruff`. uv updates `pyproject.toml` and the lockfile, and creates `.venv` if needed.\n4. On another machine, or in CI, run `uv sync --frozen` so the install matches `uv.lock` and does not resolve again.\n5. Run tools through uv so you do not activate the venv: `uv run python main.py` or `uv run ruff check`.\n6. When you want newer versions, run `uv lock --upgrade` and read the diff before you commit it.\n7. Ignore `.venv`. Do not ignore `uv.lock`.\n\n```bash\nuv init\nuv python pin 3.12\nuv add requests\nuv add --dev ruff\nuv sync --frozen\nuv run python main.py\n```\n\n## Gotchas\n- Do not put an index token, password or API key in `pyproject.toml`. Pass private-index credentials through the environment, as uv's docs describe for that index.\n- `uv pip install` is a pip-compatible escape hatch. Prefer `uv add` so the lockfile stays the source of truth.\n- `uv sync` without `--frozen` may update the lock. In CI, use `--frozen` so a surprise upgrade fails the job.\n- Deleting `.venv` is safe. `uv sync` rebuilds it from the lockfile.\n\n## Portability\nuv runs on macOS, Linux and Windows. If you use Poetry or pip-tools instead, keep the same rule: one project file, one lockfile, and a frozen install in CI. The commands differ. A Docker image can copy `uv.lock` and run `uv sync --frozen` rather than `pip install`.\n\n## Done when\n- `pyproject.toml` and `uv.lock` are committed, and `.venv` is ignored.\n- `uv sync --frozen` succeeds on a clean checkout.\n- Scripts run with `uv run`, and no secret is written in the project file.\n\n## Example prompt\n\"Move this repo off pip and a pinned package list. Set it up with uv, pin Python 3.12, and make CI install from the lockfile.\"\n\n---\nAdapted from \"uv-package-manager\" in wshobson/agents (MIT, Copyright (c) 2024 Seth Hobson). See LICENSE.txt.","files":["LICENSE.txt"],"license":"MIT","license_name":"MIT License","license_url":"https://opensource.org/license/mit","attribution":"Based on work by Seth Hobson (wshobson/agents, uv-package-manager) (Copyright (c) 2024 Seth Hobson, MIT License), https://github.com/wshobson/agents/tree/7e2fb559cf4b824b27f1fec49fe88f7511066d26/plugins/python-development/skills/uv-package-manager; adapted by TheSkillVault, https://theskillvault.ai","install":{"claude_code":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/set-up-python-with-uv/raw' -o ~/'.claude/skills/set-up-python-with-uv/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/set-up-python-with-uv/files/LICENSE.txt' -o ~/'.claude/skills/set-up-python-with-uv/LICENSE.txt'","cursor":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/set-up-python-with-uv/raw' -o '.cursor/skills/set-up-python-with-uv/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/set-up-python-with-uv/files/LICENSE.txt' -o '.cursor/skills/set-up-python-with-uv/LICENSE.txt'","agents":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/set-up-python-with-uv/raw' -o '.agents/skills/set-up-python-with-uv/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/set-up-python-with-uv/files/LICENSE.txt' -o '.agents/skills/set-up-python-with-uv/LICENSE.txt'","mcp_url":"https://theskillvault.ai/mcp","cursor_mcp_deeplink":"cursor://anysphere.cursor-deeplink/mcp/install?name=theskillvault&config=eyJ1cmwiOiJodHRwczovL3RoZXNraWxsdmF1bHQuYWkvbWNwIn0%3D","mcp_config":{"mcpServers":{"theskillvault":{"url":"https://theskillvault.ai/mcp"}}}},"bundles":[],"tested_on":[{"family":"chatgpt","name":"ChatGPT","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"claude","name":"Claude","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"gemini","name":"Gemini","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"grok","name":"Grok","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"llama","name":"Llama","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"deepseek","name":"DeepSeek","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"mistral","name":"Mistral","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"qwen","name":"Qwen","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"kimi","name":"Kimi K","outcome":null,"date":null,"source":null,"counts":false,"stale":false}],"proven_rule":{"threshold":5,"window_days":365,"computed_at":"2026-11-29T03:42:30.374Z"}}