| name | hatchling |
| description | This skill provides comprehensive documentation for Hatchling, the modern Python build backend that implements PEP 517/518/621/660 standards. Use this skill when working with Hatchling configuration, build system setup, Python packaging, pyproject.toml configuration, project metadata, dependencies, entry points, build hooks, version management, wheel and sdist builds, package distribution, setuptools migration, and troubleshooting Hatchling build errors. |
Hatchling
Overview
Hatchling is a modern, standards-compliant Python build backend that replaces legacy setuptools for package building. It provides clear configuration through pyproject.toml, intelligent defaults, and extensibility through hooks and plugins. This skill enables understanding Hatchling's architecture, configuration options, and build customization capabilities.
Key Capabilities
- Configuration via pyproject.toml: Standards-compliant PEP 621 metadata with sensible defaults
- Build Targets: Wheel and source distribution builds with extensive customization
- Build Hooks: Dynamic code execution during build for artifacts, version management, and compilation
- Version Management: Multiple version sources with automatic version injection
- File Selection: Git-aware VCS integration with glob pattern matching
- Plugins: Extensible architecture for custom builders, hooks, and metadata hooks
Reference Documentation
This skill provides comprehensive reference documentation organized by topic. Each section links to detailed guides covering configuration, usage patterns, and examples.
Project Configuration
- Project Metadata & Configuration - Package metadata, dependencies, entry points, dynamic fields
- Build System Configuration - Build backend setup, PEP 517/518, reproducible builds, environment variables
Build Targets
- Wheel Build Target - Wheel configuration, package discovery, file selection, editable installs
- Source Distribution (Sdist) Target - Sdist configuration, VCS integration, legacy setup.py support
- Build Target Types - Wheel, sdist, binary, custom builders, multi-version builds
- Build Targets Configuration Details - Target-specific hooks, dependencies, versions, precedence
File Selection & Build Customization
- File Selection & Patterns - Git-style globs, include/exclude patterns, VCS integration, force-include
- Build Hooks - Hook interface, execution order, custom hooks, version hooks, build data passing
- Advanced Build Features - Dynamic dependencies, force-include, path rewriting, editable installs, build context
Version & Metadata Management
- Version Management - Version sources (code, regex, env), schemes, validation, build hooks
- Metadata Hooks - Metadata hook interface, custom hooks, dynamic metadata generation
- Context Formatting & Dynamic Configuration - Context variables, environment-based config, interpolation
Plugin System
- Plugin System & Extensibility - Builder, hook, metadata, version plugins, hatch-vcs, plugin development
Build Environment & Integration
- Build Environment Internals - Environment config, dependencies, UV vs pip, Cython integration, isolation
- Integration & Compatibility - PEP standards compliance, setup.py migration, setuptools compatibility, CMake/extensions
- Special Configuration Options - PEP 561 type hints, SPDX licenses, namespace packages, src-layout, extensions
Core Concepts & Standards
- Core Concepts & Best Practices - PEP 517 backend, minimal philosophy, VCS file selection, reproducible builds
- Related Standards & Specifications - Python packaging overview, PEP references, metadata specs, distribution formats
Operational Guides
- Command-Line Building - hatch build commands, python -m build, pip install, output customization
- Error Handling & Validation - Path validation, file selection errors, version/license validation, heuristic failures
- Release Notes & Version History - Hatchling version history, feature additions, PEP 639 support, performance improvements