managing-python-projects-with-uv

Managing Python Projects with uv

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "managing-python-projects-with-uv" with this command: npx skills add https://github.com/ai-helpers/ai-skills-curated

Managing Python Projects with uv

Overview

This skill helps you work with Python projects managed by uv, an extremely fast Python package and project manager written in Rust. Use this skill for:

Initializing new Python projects

Managing dependencies and virtual environments

Running scripts and applications

Building and publishing packages

Optimizing Python workflows with uv's speed

There are several ways to install and use Python and the ecosystem built upon Python.

  • PyEnv has been available for a while and is now mature enough to be widely used by the majority of users. PyEnv is the solution be default used in these cheat sheets

  • uv is the new, shiny, kid on the block, and may appeal to those seeking to be on the edge of technological trends. There is at least a very specific use case where uv proves useful, it is to power standalone Python scripts: it is enough to add the magic #!/usr/bin/env -S uv command as the first line of any Python script, and that latter becomes standalone, self-served on any platform, any where, whithout requiring the users to install anything like dependencies (apart uv itself, obviously)

When to Use This Skill

Use this skill when:

  • Setting up a new Python project from scratch

  • Converting an existing project to use uv

  • Managing dependencies (adding, removing, updating packages)

  • Working with virtual environments

  • Running Python scripts or applications in a uv project

  • Building distributions for PyPI

  • The user asks about uv commands or workflows

  • You need to check which Python version or packages are installed

Additional Resources

Assets for this skill

  • Makefile — Example of Makefile excerpts with relevant targets

  • pyproject.toml — Example of Python project file, compatible with uv

  • README.md — Example of relevant excerpts in the README file

  • main.py — Example of working standalone main.py file, to be copied in the src/<project>/ directory (if not existing, be sure to create that directory, adapting to your project)

  • test_main.py — Example of working test_main.py

Python test script, to be copied in the tests/ directory (if not existing, be sure to create that directory)

  • .gitignore - Example of relevant excerpts in the .gitignore

file, Git-ignoring Python-/uv-related files

  • ci.yml - Example of relevant excerpts in the ci.yml CI/CD (GitHub Actions) dev pipeline, to be copied into the .github/workflows/

directory (if not existing, be sure to create that directory)

  • publish.yml - Example of relevant excerpts in the publish.yml CI/CD (GitHub Actions) release pipeline, to be copied into the .github/workflows/ directory

Data Engineering Helpers

  • Data Engineering Helpers - Knowledge Sharing - Python

  • Cheat sheet for how to set up and use Python, especially detailing the installation and use of uv

uv

  • Astral doc - uv

  • GitHub - Astral - uv

  • Astral doc - uv migration guides

Quick Reference

  • Skills.sh - managing-python-projects-with-uv (this Skill on the Skills marketplace)

  • Integrate the sample files into your project directory (if you had not any such file, just copy them; otherwise, merge their content within your corresponding files):

  • Makefile

  • pyproject.toml

  • README.md

  • main.py

  • test_main.py

  • .gitignore

  • ci.yml

  • publish.yml

Quick start

  • If not already done so, install this skill,

  • Either globally:

npx skills add https://github.com/ai-helpers/ai-skills-curated
--skill managing-python-projects-with-uv -g

  • Or locally:

npx skills add https://github.com/ai-helpers/ai-skills-curated
--skill managing-python-projects-with-uv

  • Create an empty directory, initilize it with Git and open VS Code:

mkdir -p ~/tmp/my-new-python-project && cd ~/tmp/my-new-python-project git init code .

  • Prompt the AI agent with something like

With the managing-python-projects-with-uv skill, create a Python project, with testing, CI/CD and publishing capability on Pypi"

  • Stage in Git the just created resources:

git add pyproject.toml Makefile .github .gitignore src tests README.md

  • If not already done so, install a specific Python version for uv:

make init-uv-python PYTHON_VERSION=3.13

  • Clean all previous work:

make clean

  • Note that uv is expecting that the Python source code be in the src/<project>/ sub-directory

  • The <project> name is specified in the pyproject.toml Python project specification file. Change it to reflect your project name

  • For the next commands to work, that source directory should at least contain a Python script. If need, copy the main.py into the src/<project>/ directory:

mkdir -p src/<project> tests .github/workflows cp assets/main.py src/<project>/ cp assets/test_main.py tests/ cp assets/.yml .github/workflows/ git add src/<project>/main.py tests/test_main.py .github/workflows/.yml

  • Initialize the Python environment with uv:

make init # update

  • Run the Python script:

make run

Useful commands

  • Build the artifact (Python wheel):

make build

  • Check (with the linter and type checkers) that there is no Python issue:

make check

  • Test the Python package:

make test

  • Publish the artifact (Python wheel):

make publish

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated
Coding

clawhub-rate-limited-publisher

Queue and publish local skills to ClawHub with a strict 5-per-hour cap using the local clawhub CLI and host scheduler.

Archived SourceRecently Updated