python-pypi-package-builder
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: creating Python packages, pip-installable SDKs, CLI tools, framework plugins, pyproject.toml setup, py.typed, setuptools_scm, semver, mypy, pre-commit, GitHub Actions CI/CD, or PyPI publishing.
npx skills add github/awesome-copilot --skill python-pypi-package-builder --agent copilot
Same command for any agent — swap --agent for claude-code, codex, cursor.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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](#1-skill-trigger) | When to load this skill | | [2. Package Type Decision](#2-package-type-decision) | Identify what you are building | | [3. Folder Structure Decision](#3-folder-structure-decision) | src/ vs flat vs monorepo | | [4. Build Backend Decision](#4-build-backend-decision) | setuptools / hatchling / flit / poetry | | [5. PyPA Packaging Flow](#5-pypa-packaging-flow) | The canonical publish pipeline | | [6. Project Structure Templates](#6-project-structure-templates) | Full layouts for every option | | [7.
- Quick Navigation
- 1. Skill Trigger
- 2. Package Type Decision
- Decision Table
- Package Naming Rules
- 3. Folder Structure Decision
- Decision Tree
- Quick Rule Summary
- 4. Build Backend Decision
- Backend Comparison
- 5. PyPA Packaging Flow
- Key PyPA Concepts
- 6. Project Structure Templates
- A. src/ Layout (Recommended default for new projects)
How it works:
git tag v1.0.0 → installed version = 1.0.0
git tag v1.1.0 → installed version = 1.1.0
In code — NEVER hardcode when using setuptools_scm:
from importlib.metadata import version, PackageNotFoundError
__version__ = version("your-package")
except PackageNotFoundError:
__version__ = "0.0.0-dev" # Fallback for uninstalled dev checkouts
git add CHANGELOG.md
git commit -m "chore: prepare release vX.Y.Z"What does the python-pypi-package-builder skill do?
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: creating Python packages, pip-installable SDKs, CLI tools, framework plugins, pyproject.toml setup, py.typed, setuptools_scm, semver, mypy, pre-commit, GitHub Actions CI/CD, or PyPI publishing.
How do I install it?
Run `npx skills add github/awesome-copilot --skill python-pypi-package-builder --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From github/awesome-copilot, a repository with 37,432 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.