Agent skill
setup-to-pyproject
Migrate Python projects from setup.py/setup.cfg to pyproject.toml for use with uv. Use when upgrading legacy Python packaging, converting setup.py to modern pyproject.toml format, setting up dependency groups for development/testing, and ensuring `uv run pytest` works correctly.
Install this agent skill to your Project
npx add-skill https://github.com/simonw/skills/tree/main/setup-to-pyproject
SKILL.md
Setup.py to pyproject.toml Migration for uv
Migrate legacy Python packaging to modern pyproject.toml with uv compatibility.
Core Structure
[project]
name = "package-name"
version = "0.1.0"
description = "Package description"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"requests>=2.28",
]
license = "Apache-2.0"
[project.urls]
Homepage = "https://github.com/user/repo"
Changelog = "https://github.com/user/repo/releases"
Issues = "https://github.com/user/repo/issues"
CI = "https://github.com/user/repo/actions"
[dependency-groups]
dev = [
"pytest>=9.0",
"black>=25.12.0",
]
[build-system]
requires = ["uv_build>=0.9.18,<0.10.0"]
build-backend = "uv_build"
Key Migration Steps
1. Extract metadata from setup.py
Map setup() arguments to [project] table:
name→nameversion→versiondescription→descriptionlong_description→readme(use filename)author+author_email→authors = [{name = "...", email = "..."}]url→project.urls.Homepagepython_requires→requires-pythoninstall_requires→dependenciesentry_points.console_scripts→[project.scripts]
2. Set up dependency-groups for dev dependencies
Critical for uv run pytest to work:
[dependency-groups]
dev = [
"pytest>=9.0",
"black>=25.12.0",
]
3. Confirm it works with uv run
Then run tests with:
uv run pytest
The dev group will be picked up automatically by uv run.
4. Confirm it works with uv build
Test that building the package works correctly:
uv build
uv_build defaults to src/ layout. For flat layout (package directory at project root), add:
[tool.uv.build-backend]
module-root = ""
Files to Delete After Migration
setup.pysetup.cfgMANIFEST.in(usually, unless complex includes)requirements.txt/requirements-dev.txt(optional, uv manages these)
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
cogapp-markdown
Use cogapp to auto-generate sections of markdown documentation by embedding Python code that produces content. Use when a project needs to keep documentation in sync with code, such as embedding CLI --help output in README files, generating tables, or any content that should be derived from the code itself rather than manually maintained.
uv-tdd
A development process for Python applications that uses TDD to iterate on a new project based around uv. Use when Claude needs to create a new Python project, write Python code with tests, or work on Python development using test-driven development practices with the uv package manager.
upgrade-actions
Upgrade GitHub Actions workflows
datasette-plugin-writer
Guide for writing Datasette plugins. This skill should be used when users want to create or develop plugins for Datasette, including information about plugin hooks, the cookiecutter template, database APIs, request/response handling, and plugin configuration.
starlette
Build async web applications and APIs with Starlette 1.0, the lightweight ASGI framework for Python. Use this skill whenever a user wants to create an async Python web app, REST API, WebSocket server, or ASGI application using Starlette. Triggers include mentions of 'Starlette', 'ASGI', async Python web frameworks, or requests to build lightweight async APIs, WebSocket services, streaming responses, or middleware pipelines. Also use when the user is working with FastAPI internals (which is built on Starlette), needs ASGI middleware patterns, or wants a minimal async web server without a full framework. Covers routing, requests/responses, WebSockets, middleware, templates, static files, authentication, lifespan, background tasks, config, testing, schemas, and more.
greeter
Generate a cheerful greeting in any language.
Didn't find tool you were looking for?