スキル一覧に戻る
simonw

setup-to-pyproject

by simonw

Skills for coding agents

37🍴 3📅 2026年1月18日
GitHubで見るManusで実行

SKILL.md


name: setup-to-pyproject description: 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.

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:

  • namename
  • versionversion
  • descriptiondescription
  • long_descriptionreadme (use filename)
  • author + author_emailauthors = [{name = "...", email = "..."}]
  • urlproject.urls.Homepage
  • python_requiresrequires-python
  • install_requiresdependencies
  • entry_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.py
  • setup.cfg
  • MANIFEST.in (usually, unless complex includes)
  • requirements.txt / requirements-dev.txt (optional, uv manages these)

スコア

総合スコア

45/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

0/5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です