Skip to main content
skill CX Codex

python-packaging · laurigates — Claude Code skill: what it does, how to install

python-packaging guides the agent through building wheels and sdists with uv, configuring pyproject.toml, and uploading packages to PyPI or Test PyPI.

MIT 336 installs ★ 60 updated 2026-11-16

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add laurigates/claude-plugins --skill python-packaging -a claude-code
Open on GitHub

What python-packaging does

The skill provides workflow references for building and publishing Python libraries using Astral uv. It covers running uv build for wheel and sdist outputs targeting the dist/ folder, alongside publishing commands via uv publish.

Inside are templates for pyproject.toml, showing how to set package metadata, PyPI classifiers, CLI entry points in [project.scripts], and dynamic versioning derived from git tags. Build backends include uv_build, setuptools, and hatchling. Publishing requires an authentication secret inside the $PYPI_TOKEN environment variable.

Package distribution is the sole focus here. Dependency locks belong in a separate workflow.

What it helps with

  • build wheel and sdist archives into dist/ using uv build
  • publish package releases to PyPI or Test PyPI with token authentication
  • configure CLI entry points and console scripts in pyproject.toml
  • set up dynamic package versions sourced from git tags

Example prompts for the agent

  • Build wheel and sdist packages for this library using uv
  • Add a console script entry point to pyproject.toml and verify build configuration
  • Publish the release artifacts in dist to Test PyPI

How to install python-packaging

1Skills CLI (Vercel)

npx skills add laurigates/claude-plugins --skill python-packaging -a claude-code

2Manually: put the files in place

~/.claude/skills/python-packaging/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/python-packaging/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about python-packaging

How to install python-packaging in Claude Code?

Run npx skills add laurigates/claude-plugins --skill python-packaging -a claude-code. The file will be placed in ~/.claude/skills/python-packaging/SKILL.md.

What does python-packaging do?

It provides commands and reference configurations for compiling distribution packages via uv build and publishing them to PyPI with uv publish.

How does it differ from uv-project-management?

This skill focuses strictly on building artifacts, metadata, and publishing. Syncing virtual environments and maintaining lockfiles is handled by uv-project-management.

Source text

SKILL.md · MIT
---
created: 2025-12-16
modified: 2026-11-14
reviewed: 2026-04-25
name: python-packaging
description: Build and publish Python packages with uv. Use when the user mentions building packages, publishing to PyPI, wheel/sdist creation, or entry points.
user-invocable: false
allowed-tools: Bash(uv build *), Bash(uv publish *), Read, Grep, Glob
---

# Python Packaging

Quick reference for building and publishing Python packages with UV and modern build tools.

## When to Use This Skill

| Use this skill when... | Use uv-project-management instead when... |
|---|---|
| Building a wheel/sdist with `uv build` for PyPI distribution | Setting up a new project's pyproject.toml or adding runtime dependencies |
| Publishing a release to PyPI or a private index with `uv publish` | Managing the lockfile or syncing the local virtual environment |
| Configuring entry points, console scripts, or package metadata for distribution | Resolving dependency conflicts or pinning versions for development |

## When This Skill Applies

- Building Python packages (wheels, sdists)
- Publishing to PyPI or private indexes
- Package versioning
- Build system configuration
- Editable installations

## Quick Reference

### Building Packages

```bash
# Build package
uv build

# Build specific formats
uv build --wheel
uv build --sdist

# Output location: dist/
```

### Publishing

```bash
# Publish to PyPI
uv publish

# With token
uv publish --token $PYPI_TOKEN

# To Test PyPI
uv publish --publish-url https://test.pypi.org/legacy/
```

### Package Structure

```
my-package/
├── pyproject.toml
├── README.md
├── LICENSE
├── src/
│   └── my_package/
│       ├── __init__.py
│       ├── __version__.py
│       └── main.py
└── tests/
```

## pyproject.toml Configuration

```toml
[project]
name = "my-package"
version = "0.1.0"
description = "A great package"
readme = "README.md"
requires-python = ">=3.11"
license = {text = "MIT"}
authors = [
    {name = "Your Name", email = "[email protected]"}
]
keywords = ["python", "package"]
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.11",
]

dependencies = [
    "requests>=2.31.0",
]

[project.optional-dependencies]
dev = ["pytest", "ruff", "ty"]

[project.urls]
Homepage = "https://github.com/user/my-package"
Documentation = "https://my-package.readthedocs.io"
Repository = "https://github.com/user/my-package.git"
Issues = "https://github.com/user/my-package/issues"

[project.scripts]
my-cli = "my_package.cli:main"

[build-system]
requires = ["uv_build>=0.9.2,<0.10.0"]
build-backend = "uv_build"
```

## Versioning

```toml
[project]
version = "0.1.0"  # Manual versioning

# Dynamic versioning (from git tags)
dynamic = ["version"]

[tool.uv]
version-provider = "git"
```

## Entry Points

```toml
[project.scripts]
my-cli = "my_package.cli:main"

[project.gui-scripts]
my-gui = "my_package.gui:main"

[project.entry-points."my_plugin"]
plugin1 = "my_package.plugins:plugin1"
```

## Build Backends

### UV Build (default)

```toml
[build-system]
requires = ["uv_build>=0.9.2,<0.10.0"]
build-backend = "uv_build"
```

### Setuptools

```toml
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"
```

### Hatchling

```toml
[build-system]
requires = ["hatchling>=1.18"]
build-backend = "hatchling.build"
```

## Common Workflows

### Publish to PyPI

```bash
# 1. Build
uv build

# 2. Check built packages
ls dist/

# 3. Publish
uv publish --token $PYPI_TOKEN
```

### Test PyPI First

```bash
# Publish to Test PyPI
uv publish --publish-url https://test.pypi.org/legacy/ \
           --token $TEST_PYPI_TOKEN

# Test installation
pip install --index-url https://test.pypi.org/simple/ my-package
```

## Package Classifiers

Common classifiers:

```toml
classifiers = [
    # Development Status
    "Development Status :: 3 - Alpha",
    "Development Status :: 4 - Beta",
    "Development Status :: 5 - Production/Stable",

    # Audience
    "Intended Audience :: Developers",
    "Intended Audience :: Science/Research",

    # License
    "License :: OSI Approved :: MIT License",

    # Python Versions
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",

    # Framework
    "Framework :: Django",
    "Framework :: FastAPI",

    # Topic
    "Topic :: Software Development :: Libraries",
    "Topic :: Scientific/Engineering",
]
```

Full list: https://pypi.org/classifiers/

## See Also

- `uv-project-management` - Project setup and dependencies
- `python-development` - Core Python patterns
- `uv-workspaces` - Building workspace packages

## References

- UV build: https://docs.astral.sh/uv/guides/publish/
- PyPI: https://pypi.org/
- Detailed guide: See REFERENCE.md

© laurigates · MIT · laurigates/claude-plugins

Similar skills

All skills for Programming languages →

python-packaging by other authors comes first.

python-packaging Seth Hobson The python-packaging skill turns Python libraries and CLI tools into installable packages and guides PyPI releases. Use it when a project needs a distributable structure. CX Codex +1 12,915installs Python Packaging taste f Python Packaging taste — a prompt that hands the model a fixed set of Python packaging rules: pyproject.toml, src/, uv, Ruff. Useful when a new package needs one consistent style. GP ChatGPT ★ 178,201repo stars Poetry Packaging pluginagentmarketplace Poetry Packaging guides your coding agent through Python package setups, pyproject.toml dependency constraints, and PyPI publishing. CX Codex +1 132installs python-pypi-package-builder official github The python-pypi-package-builder skill guides Python package creation, testing, versioning, and PyPI publishing. Use it for libraries, SDKs, CLI tools, and framework plugins. CX Codex +1 943installs uv harperreed Guides your AI agent through Python workflows using uv: dependency resolution, virtualenvs, PEP 723 scripts, CI, and multistage Docker builds. CX Codex +1 ★ 339repo stars pypi-doppler terrylica pypi-doppler — a skill for Claude Code and five other platforms that publishes Python packages to PyPI using a token stored in Doppler — local machine only. The bundled script detects CI environments and exits immediately if one is found. CX Codex +1 123installs python-uv Mindrally python-uv makes the agent manage Python packages through uv only, no pip or poetry. Useful when the project already runs on uv or when environments keep drifting apart. CX Codex +1 1,000installs

From the same set27

The whole set →
uv-project-management uv-project-management is a Claude Code skill for creating Python projects and managing dependencies with uv. It activates for pyproject.toml, lockfiles, and commands such as uv init, uv add, or uv sync. CX Codex +1 358installs basedpyright-type-checking basedpyright-type-checking sets up strict Python type checking using basedpyright, compares it against mypy, and guides configuration in pyproject.toml. CX Codex +1 357installs uv-workspaces A skill for multi-package Python projects on uv: workspace setup, a shared lockfile, and dependencies between members. CX Codex +1 356installs uv-run uv-run teaches your AI assistant to execute Python scripts via uv and embed dependencies with PEP 723 without manual virtual environment activation. CX Codex +1 342installs uv-python-versions uv-python-versions is a Claude Code skill for managing CPython and PyPy with uv. Install interpreters, pin a project version, or switch versions for testing. CX Codex +1 332installs uv-advanced-dependencies uv-advanced-dependencies is a skill for managing non-standard dependency sources in uv, including GitHub repositories, editable local packages, and private indexes. It covers projects that need Git, local path, or custom index dependencies. CX Codex +1 332installs uv-tool-management uv-tool-management is a Claude Code skill for managing global Python CLI tools with uv and running them temporarily with uvx, including as an alternative to pipx. CX Codex +1 328installs imagemagick-conversion imagemagick-conversion — a skill for converting, resizing and optimizing images via ImageMagick command-line. Useful for bulk format conversion, thumbnail generation, and large-scale image processing workflows. CX Codex +1 260installs

Project sponsors

Companies that keep this analytics open