python-pypi-package-builder
하는 일
이 가이드는 Python 라이브러리를 만들고, 테스트하고, PyPI(Python 패키지 '마켓플레이스')에 게시하도록 돕습니다. 코드 정리부터 최종 릴리스까지 다루며, 패키지가 잘 작동하고 다른 개발자가 쉽게 쓸 수 있도록 합니다.
사용하는 경우
- ✓공유할 첫 Python 라이브러리를 만들고 싶을 때.
- ✓Python 패키지를 PyPI에 게시해야 할 때.
- ✓기존 Python 프로젝트를 정리하고 테스트하고 싶을 때.
스킬 링크
https://github.com/github/awesome-copilot/blob/main/skills/python-pypi-package-builder/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“'my_utility'라는 Python 라이브러리를 어떻게 만들고 게시하나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
이 가이드는 코드를 정리하는 가장 좋은 방법과, 패키지를 만들고 테스트하고 게시하는 올바른 도구를 고르도록 돕습니다. 또한 패키지의 버전을 관리하는 방법과 '타입 힌트' 같은 최신 기능을 쓰는 방법도 설명합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Python PyPI Package Builder Skill
A complete, battle-tested guide for building, testing, linting, versioning, typing, and publishing a production-grade Python library to PyPI — from first commit to community-ready release.
AI Agent Instruction: Read this entire file before writing a single line of code or creating any file. Every decision — layout, backend, versioning strategy, patterns, CI — has a decision rule here. Follow the decision trees in order. This skill applies to any Python package type (utility, SDK, CLI, plugin, data library). Do not skip sections.
Quick Navigation
| Section in this file | What it covers |
|---|---|
| 1. Skill Trigger | When to load this skill |
| 2. Package Type Decision | Identify what you are building |
| 3. Folder Structure Decision | src/ vs flat vs monorepo |
| 4. Build Backend Decision | setuptools / hatchling / flit / poetry |
| 5. PyPA Packaging Flow | The canonical publish pipeline |
| 6. Project Structure Templates | Full layouts for every option |
| 7. Versioning Strategy | PEP 440, semver, dynamic vs static |
| Reference file | What it covers |
|---|---|
references/pyproject-toml.md |
All four backend templates, setuptools_scm, py.typed, tool configs |
references/library-patterns.md |
OOP/SOLID, type hints, core class design, factory, protocols, CLI |
references/testing-quality.md |
conftest.py, unit/backend/async tests, ruff/mypy/pre-commit |
references/ci-publishing.md |
ci.yml, publish.yml, Trusted Publishing, TestPyPI, CHANGELOG, release checklist |
references/community-docs.md |
README, docstrings, CONTRIBUTING, SECURITY, anti-patterns, master checklist |
references/architecture-patterns.md |
Backend system (plugin/strategy), config layer, transport layer, CLI, backend injection |
references/versioning-strategy.md |
PEP 440, SemVer, pre-release, setuptools_scm deep-dive, flit static, decision engine |
references/release-governance.md |
Branch strategy, branch protection, OIDC, tag author validation, prevent invalid tags |
references/tooling-ruff.md |
Ruff-only setup (replaces black/isort), mypy config, pre-commit, asyncio_mode=auto |
Scaffold script: run python skills/python-pypi-package-builder/scripts/scaffold.py --name your-package-name
to generate the entire directory layout, stub files, and pyproject.toml in one command.
1. Skill Trigger
Load this skill whenever the user wants to:
- Create, scaffold, or publish a Python package or library to PyPI
- Build a pip-installable SDK, utility, CLI tool, or framework extension
- Set up
pyproject.toml, linting, mypy, pre-commit, or GitHub Actions for a Python project - Understand versioning (
setuptools_scm, PEP 440, semver, static versioning) - Understand PyPA specs:
py.typed,MANIFEST.in,RECORD, classifiers - Publish to PyPI using Trusted Publishing (OIDC) or API tokens
- Refactor an existing package to follow modern Python packaging standards
- Add type hints, protocols, ABCs, or dataclasses to a Python library
- Apply OOP/SOLID design patterns to a Python package
- Choose between build backends (setuptools, hatchling, flit, poetry)
Also trigger for phrases like: "build a Python SDK", "publish my library", "set up PyPI CI", "create a pip package", "how do I publish to PyPI", "pyproject.toml help", "PEP 561 typed", "setuptools_scm version", "semver Python", "PEP 440", "git tag release", "Trusted Publishing".
2. Package Type Decision
Identify what the user is building before writing any code. Each type has distinct patterns.
Decision Table
| Type | Core Pattern | Entry Point | Key Deps | Example Packages |
|---|---|---|---|---|
| Utility library | Module of pure functions + helpers | Import API only | Minimal | arrow, humanize, boltons, more-itertools |
| API client / SDK | Class with methods, auth, retry logic | Import API only | httpx or requests |
boto3, stripe-python, openai |
| CLI tool | Command functions + argument parser | [project.scripts] or [project.entry-points] |
click or typer |
black, ruff, httpie, rich |
…
자주 묻는 질문
PyPI는 무엇인가요?
PyPI는 Python Package Index의 약자입니다. Python 개발자가 라이브러리(패키지)를 게시하고 공유해, 다른 사람이 설치하고 프로젝트에서 쓸 수 있는 온라인 저장소입니다.
'빌드 백엔드'(setuptools, hatchling, flit, poetry)는 무엇인가요?
Python이 코드를 패키지로 묶어, pip으로 설치하고 PyPI에 게시할 수 있는 형식으로 바꾸는 데 쓰는 서로 다른 도구입니다. 각각 장점이 있습니다.
'타입 힌트'는 무엇인가요?
변수나 함수가 기대하거나 반환하는 데이터 타입을 나타내려고 Python 코드에 추가하는 주석입니다. 오류를 일찍 찾고 코드를 이해하기 쉽게 해 줍니다.
상세 정보
작성자의 원본 설명
End-to-end skill for building, testing, linting, versioning, and publishing a production-grade Python library to PyPI. Covers all four build backends (setuptools+setuptools_scm, hatchling, flit, poetry), PEP 440 versioning, semantic versioning, dynamic git-tag versioning, OOP/SOLID design, type hints (PEP 484/526/544/561), Trusted Publishing (OIDC), and the full PyPA packaging flow. Use for: creat
repo: github/awesome-copilot
인기도
- GitHub 스타
- 40k
- 순위
- #7352
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
acquire-codebase-knowledge
40k에이전트가 기존 코드 프로젝트를 이해하고 문서화하도록 돕습니다. 새 구성원을 맞이하거나 아키텍처를 개괄적으로 파악할 때 유용합니다.
acreadiness-assess
40k에이전트가 프로젝트의 AI 준비 상태를 평가하고 보고서를 만들도록 합니다. 프로젝트가 AI 도구를 쓸 준비가 얼마나 되어 있는지 이해하는 데 유용합니다.
acreadiness-generate-instructions
40k에이전트가 평가 결과를 바탕으로 AI 도구를 위한 지침을 만들도록 돕습니다. AI가 코드와 상호작용하는 방식을 개선하고 확인된 공백을 메울 때 유용합니다.
acreadiness-policy
40k에이전트가 AI 프로젝트 평가를 위한 정책을 정의하거나 적용하도록 돕습니다. 프로젝트 평가 방식을 표준화하고 규정 준수를 보장할 때 유용합니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.