Agent skill
uv-uvx
Tips on using uv and uvx (Python build tools) effectively with GitHub, Torch, etc.
Install this agent skill to your Project
npx add-skill https://github.com/sanand0/scripts/tree/main/agents/uv-uvx
SKILL.md
Running from GitHub
You can run uvx --from "git+https://github.com/owner/repo.git@main" your-tool directly without cloning a repo.
You can specify a git repo as an inline script dependency directly in a .py file when running with uv
# /// script
# dependencies = ["git+https://github.com/owner/repo.git"]
# ///
To import static assets, use data-files to install them into the environment and read them using sys.prefix:
# pyproject.toml
[build-system]
requires = ["setuptools>=69"]
build-backend = "setuptools.build_meta"
[project]
name = "your-project"
version = "0.1.0"
requires-python = ">=3.12"
# exposes the CLI entry point for your tool
[project.scripts]
your-tool = "main:main"
# packages the single root script
[tool.setuptools]
py-modules = ["main"]
# installs static.txt into the environment root
[tool.setuptools.data-files]
"." = ["static.txt"]
# main.py
from pathlib import Path
import sys
def main():
path = Path(sys.prefix) / "static.txt"
print(path.read_text())
if __name__ == "__main__":
main()
This is the smallest practical proof of concept, not the most robust packaging pattern. For larger projects, prefer a real package plus importlib.resources.
Tips
- Adding a
[dependency-groups]section topyproject.tomlwithdev = ["pytest"]ensures that pytest is automatically installed byuvbecausedevis a default group. uv run --python 3.14 --isolated --with-editable '.[test]' pytestruns pytest on a local project with a specific Python version.uv runsupports--extrafor extra packagesuv runcan run any command, not just Python scripts, e.g.uv run npxoruv run bash. It's the same asnpxorbashexcept it activates the venv and loads.env.UV_TORCH_BACKEND=auto uv pip install torch torchvision torchaudioinstalls the most appropriate PyTorch version.uvsupports:- pylock.toml, the new lock file standard PEP 0751
- --env-file multiple times, allowing layered secrets
- --exclude-newer installs versions before a specific date
- --overrides overrides versions a package specifies
- --constraints limits the version of the package
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
melt-mlt
Workflows for melt, the MLT Framework CLI video editor, to edit, transcode, composite, stream, or automate video/audio. Covers multitrack composition, color grading, batch processing, encoding, streaming, and server-side pipelines.
batch-research
批量数据采集技能,负责分批并发调度 researcher agent 抓取所有数据源。
chinese-writing
专注科技周刊的中文写作与审稿技能指南,指导大模型生成与审核清晰、克制、无 AI 味的高质量周刊内容。
publish-weekly
使用 Payload REST API 将周刊发布到 CMS,正文不包含头部元数据,通过 users API Key 认证。
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
setup-pre-commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
Didn't find tool you were looking for?