python-packaging

Automate Python packaging configuration in pyproject.toml for PyPI distribution.

2|Updated Nov 13, 2025
One-click install
npx skills add https://github.com/ricardoroche/ricardos-claude-code --skill python-packaging-ricardoroche
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-packaging
Source: https://github.com/ricardoroche/ricardos-claude-code/tree/main/.claude/skills/python-packaging
Command: npx skills add https://github.com/ricardoroche/ricardos-claude-code --skill python-packaging-ricardoroche

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires setuptools, wheel, fastapi, pydantic, sqlalchemy, httpx, pytest, pytest-cov, pytest-asyncio, black, ruff, mypy, sphinx, sphinx-rtd-theme.

What problem does it solve?

This Skill streamlines the often-complex process of packaging Python projects, addressing issues like inconsistent pyproject.toml configurations, non-standard project layouts, and unreliable distribution. It ensures your packages are modern, maintainable, and easily publishable to PyPI.

Core Features & Use Cases

  • pyproject.toml Mastery: Guides on configuring project metadata, dependencies, optional dependencies, entry points, and tool settings (pytest, Black, Ruff, Mypy).
  • Standard Project Structure: Enforces the src/ layout, including __init__.py, __main__.py, and py.typed for type hints.
  • Build & Distribution: Provides commands for building wheels and source distributions, and uploading to PyPI using twine.
  • CI/CD Integration: Offers a GitHub Actions workflow for automating package publishing on release.
  • Use Case: A developer needs to prepare their Python library for open-source release. This skill helps them configure pyproject.toml with correct metadata, define dev and docs optional dependencies, set up a src/ layout, and automate publishing via GitHub Actions.

Quick Start

Configure pyproject.toml for a new Python package, including project metadata, core dependencies, and dev dependencies.

Frequently Asked Questions about python-packaging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure pyproject.toml for a Python package?

Configure pyproject.toml by defining project metadata, dependencies, optional extras, build-system, classifiers, and entry points. This single file replaces setup.py and setup.cfg, encoding all packaging requirements per modern Python standards for reliable distribution and PyPI publishing.

What's the best way to structure a Python project for distribution?

Use the src/ layout with your package inside src/, including __init__.py, __main__.py, and py.typed for type hints. This structure isolates your package code, improves testability, and aligns with modern packaging best practices for publishing to PyPI.

How do I build and publish a Python package to PyPI?

Build wheels and source distributions using setuptools and wheel, then upload with twine. Automating this via GitHub Actions on release ensures consistent, reliable publishing without manual steps.

Can I use setuptools and wheel to create distributions for PyPI?

Yes. setuptools and wheel are the standard build tools for creating wheels and source distributions. Together they prepare your package in formats PyPI accepts, enabling reliable distribution and installation.

What dependencies should I define in pyproject.toml for development?

Define dev dependencies like pytest, black, ruff, mypy, and sphinx for testing, linting, type checking, and documentation. Optional dependency groups in pyproject.toml let users install only what they need while keeping your package lean.

Why should I automate Python package publishing with CI/CD?

GitHub Actions workflows automate building and uploading to PyPI on release, eliminating manual steps and human error. This ensures consistent versioning, testing, and distribution without touching production commands locally.