python-packaging

Create and distribute Python packages using pyproject.toml and setuptools.

3|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/DrLuggels/my_dhbw --skill python-packaging-drluggels
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-packaging
Source: https://github.com/DrLuggels/my_dhbw/tree/main/.claude/plugins/python-development/skills/python-packaging
Command: npx skills add https://github.com/DrLuggels/my_dhbw --skill python-packaging-drluggels

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of creating, structuring, and distributing Python packages, making your code easily shareable and installable by others.

Core Features & Use Cases

  • Package Structure: Guides you on setting up optimal project layouts (src-layout, flat-layout).
  • Configuration: Demonstrates modern pyproject.toml usage for build systems, project metadata, and tool configurations (Black, Ruff, MyPy, Pytest).
  • Distribution: Covers building wheels and source distributions, and publishing to PyPI and TestPyPI.
  • Use Case: You've developed a useful Python library and want to share it with the community or your team. This Skill will guide you through creating a professional, distributable package.

Quick Start

Use the python-packaging skill to create a minimal package structure with a pyproject.toml file.

Frequently Asked Questions about python-packaging

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

FAQPage Schema
How do I build and publish a Python package to PyPI using pyproject.toml?

To build and publish a Python package, configure build systems and project metadata using pyproject.toml, build source distributions and wheels, then upload them to PyPI. This standardizes software distribution for team or community sharing.

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

The best way to structure a Python project for distribution is using the src-layout or flat-layout. These project layouts separate source code from configuration, ensuring clean builds and preventing import errors during testing.

Can I include data files and C extensions when packaging Python code?

Yes, you can include data files and C extensions when packaging Python code. Modern build backends like setuptools support configuring inclusions within pyproject.toml to ensure they are correctly bundled in your distributions.

Does pyproject.toml work with testing and linting tools like Pytest and Ruff?

Yes, pyproject.toml works with testing and linting tools like Pytest, Black, Ruff, and MyPy. You can centralize project metadata, build systems, and tool configurations within this single file.

How do I publish a Python package to TestPyPI before the main PyPI release?

To publish a Python package to TestPyPI, build your wheels and source distributions, then configure your upload target to the TestPyPI endpoint. This verifies installation and distribution integrity before the main PyPI release.

When do I need namespace packages in Python packaging?

You need namespace packages in Python packaging when splitting a large project across multiple separate distributions. This mechanism allows distinct packages to share the same parent namespace without requiring explicit namespace initialization code.