| created | "2025-12-16T00:00:00.000Z" |
| modified | "2026-05-09T00:00:00.000Z" |
| reviewed | "2026-04-25T00:00:00.000Z" |
| 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, 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
uv build
uv build --wheel
uv build --sdist
Publishing
uv publish
uv publish --token $PYPI_TOKEN
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
[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 = "you@example.com"}
]
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
[project]
version = "0.1.0"
dynamic = ["version"]
[tool.uv]
version-provider = "git"
Entry Points
[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)
[build-system]
requires = ["uv_build>=0.9.2,<0.10.0"]
build-backend = "uv_build"
Setuptools
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"
Hatchling
[build-system]
requires = ["hatchling>=1.18"]
build-backend = "hatchling.build"
Common Workflows
Publish to PyPI
uv build
ls dist/
uv publish --token $PYPI_TOKEN
Test PyPI First
uv publish --publish-url https://test.pypi.org/legacy/ \
--token $TEST_PYPI_TOKEN
pip install --index-url https://test.pypi.org/simple/ my-package
Package Classifiers
Common classifiers:
classifiers = [
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Framework :: Django",
"Framework :: FastAPI",
"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