python-packaging

Package Python projects into distributable artifacts and publish them to PyPI.

1|Updated Aug 31, 2024
One-click install
npx skills add https://github.com/aRustyDev/dotfiles --skill python-packaging-arustydev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-packaging
Source: https://github.com/aRustyDev/dotfiles/tree/main/.ai/plugins/python-development/skills/python-packaging
Command: npx skills add https://github.com/aRustyDev/dotfiles --skill python-packaging-arustydev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides the end-to-end process of creating, structuring, and distributing Python packages, helping you package libraries, CLI tools, and applications with modern tooling and publish them to PyPI or private repositories.

Core Features & Use Cases

  • Modern packaging standards: Use pyproject.toml to configure build systems (setuptools, poetry, hatchling, flit) and manage metadata.
  • Distribution preparation: Structure projects for distribution (wheel and source distributions), versioning, and classifiers.
  • Publishing workflow: Prepare and publish packages to PyPI or private registries, including private artifacts tooling.
  • Use Case: You want to package a Python library with a clean source layout, generate a wheel, and publish it to PyPI with proper metadata.

Quick Start

Create a minimal package named 'my_package' with a pyproject.toml, a src/my_package module, and a simple README, then build the wheel and publish to PyPI.

Frequently Asked Questions about python-packaging

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

FAQPage Schema
How do I package a Python library for distribution on PyPI?

Package a Python library by configuring pyproject.toml with build system metadata, structuring your project with a src layout, then building a wheel distribution and publishing to PyPI using modern tooling like setuptools, hatchling, or poetry.

What is pyproject.toml and why do I need it for packaging?

pyproject.toml is the modern configuration file that specifies your build backend, project metadata, dependencies, and classifiers according to PEP 517/518/621 standards, replacing the need for separate setup.py files in many cases.

Can I publish Python packages to a private repository instead of PyPI?

Yes, you can configure your build and publish workflow to target private repositories instead of PyPI, supporting internal distribution of libraries, CLI tools, and applications with the same pyproject.toml-based packaging approach.

What build backends does modern Python packaging support?

Modern Python packaging supports multiple build backends including setuptools, poetry, hatchling, and flit, each configurable through pyproject.toml to generate wheel and source distributions that meet PEP 517/518 standards.

How do I create both wheel and source distributions for my Python package?

Configure your build backend in pyproject.toml and use build tools to generate both wheel (.whl) and source distributions (.tar.gz), which can then be tested locally and published together to PyPI or private registries.

Do I need setup.py if I'm using pyproject.toml?

No, pyproject.toml with a modern build backend like setuptools, hatchling, or poetry can replace setup.py entirely for most projects, though setup.py is still supported for backward compatibility and legacy configurations.