python-pypi-package-builder
Qué hace
Esta guía te ayuda a crear, probar y publicar bibliotecas de Python en PyPI (el 'mercado' de paquetes de Python). Cubre todo, desde la organización del código hasta la publicación final, para que tu paquete funcione bien y sea fácil de usar para otros desarrolladores.
Cuándo usarla
- ✓Cuando quieres crear tu primera biblioteca de Python para compartirla.
- ✓Cuando necesitas publicar un paquete de Python en PyPI.
- ✓Para organizar y probar un proyecto de Python que ya existe.
Link de la skill
https://github.com/github/awesome-copilot/blob/main/skills/python-pypi-package-builder/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“¿Cómo creo y publico una biblioteca de Python llamada 'my_utility'?”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
La guía te ayuda a elegir la mejor forma de organizar tu código y las herramientas adecuadas para crear, probar y publicar tu paquete. También explica cómo versionarlo y usar funciones modernas como los 'type hints'.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de 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 |
…
Preguntas frecuentes
¿Qué es PyPI?
PyPI significa Python Package Index (Índice de Paquetes de Python). Es un repositorio en línea donde los desarrolladores de Python publican y comparten bibliotecas (paquetes) que otros pueden instalar y usar en sus proyectos.
¿Qué son los 'build backends' (setuptools, hatchling, flit, poetry)?
Son distintas herramientas que Python usa para empaquetar tu código, convirtiéndolo en un formato que se puede instalar con pip y publicar en PyPI. Cada una tiene sus propias ventajas.
¿Qué son los 'type hints'?
Los 'type hints' son anotaciones que añades a tu código de Python para indicar el tipo de dato que espera o devuelve una variable o función. Esto ayuda a detectar errores pronto y hace que el código sea más fácil de entender.
Detalles
Descripción original del autor
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
Popularidad
- Estrellas en GitHub
- 40 mil
- Posición en el ranking
- #7352
- Licencia
- MIT
- Actualizada
- 15/10/2026
Comentarios
- …
Más skills de este repositorio
acquire-codebase-knowledge
40 milAyuda a tu agente a entender y documentar un proyecto de código existente. Es útil para incorporar a nuevas personas o tener una visión general de la arquitectura.
acreadiness-assess
40 milPermite a tu agente evaluar qué tan preparado está un proyecto para la IA y generar un informe. Es útil para saber qué tan bien está listo un proyecto para usar herramientas de IA.
acreadiness-generate-instructions
40 milAyuda a tu agente a crear instrucciones para herramientas de IA basadas en una evaluación. Es útil para mejorar cómo la IA interactúa con el código y cerrar las brechas detectadas.
acreadiness-policy
40 milPermite a tu agente ayudar a definir o aplicar políticas para la evaluación de proyectos de IA. Es útil para estandarizar cómo se evalúan los proyectos y garantizar el cumplimiento.
Skills parecidas
api-connector-builder
280 milHace que tu agente cree nuevas conexiones de API siguiendo el patrón existente. Úsalo para añadir una integración más sin inventar otra forma de hacer las cosas.
api-design
280 milAyuda a tu agente a diseñar APIs REST según las buenas prácticas. Es útil para definir cómo se comunican las APIs, cómo se muestran los errores y cómo organizar los datos.
backend-patterns
280 milAyuda a tu agente con patrones de arquitectura del lado del servidor y optimización de bases de datos. Es útil para crear o revisar código que se ejecuta en el servidor.