skillfed

hatchling-autoextras-hook

Hatchling metadata hook to generate all extras

hatchling-autoextras-hook v0.1.3 1.3M downloads/30d#4,126 on PyPI0
Permissive license BSD-3-Clause Active released

What it is and what it does

hatchling-autoextras-hook is a build-time plugin for hatchling that intercepts your project's metadata during packaging and automatically creates an `all` extra that merges every optional dependency you've defined. It deduplicates and alphabetizes the combined list, so users can install the entire optional feature set with a single command.

The hook runs only during the build process and does not modify your source files or pyproject.toml. It requires hatchling as its sole runtime dependency and works with Python 3.10 or later. Configuration is minimal—just add the hook declaration to your pyproject.toml and ensure you have at least one dynamic field so hatchling's metadata system will invoke it.

Use it for:

  • Simplify installation for users who want all optional features without listing each extra separately.
  • Maintain a single source of truth for optional dependencies while automatically exposing a convenience `all` extra.
  • Reduce boilerplate in CI/CD pipelines by using a single `all` extra instead of enumerating multiple extras.
  • Ensure consistency across multiple packages by centralizing the `all` extra generation logic.
  • Avoid manual maintenance of an `all` extra that can become stale when new optional dependencies are added.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Hatchling metadata hook that automatically generates an `all` extra combining all optional dependencies, deduplicating and sorting them alphabetically.

Yes, if you use hatchling and want to offer an `all` extra without manual maintenance. The package is actively maintained, has no known vulnerabilities, and low install friction. It is in beta (Development Status :: 4), so expect the API to change before a 1.0.0 release—pin the version in your build-system.requires if stability is critical.

Install

hatchling-autoextras-hook on PyPI

pip

pip install hatchling-autoextras-hook

uv

uv add hatchling-autoextras-hook

poetry

poetry add hatchling-autoextras-hook

Installing hatchling-autoextras-hook

Before you install

Low install friction with a single runtime dependency on hatchling. Active maintenance with last commit on 2026-08-13 and no known vulnerabilities.

License in practice

BSD-3-Clause is a permissive license; you can use, modify, and distribute this package with minimal restrictions, provided you include the license text and disclaimer.

Quickstart

Add to pyproject.toml:

[build-system]
requires = ["hatchling>=1.18.0", "hatchling-autoextras-hook"]
build-backend = "hatchling.build"

[tool.hatch.metadata.hooks.autoextras]

Then define optional dependencies and install with the generated `all` extra.

Requires at least one dynamic field in [project] metadata for Hatchling metadata hooks to trigger. Hatchling >= 1.18.0 required.

Verify before relying

  • Whether the hook works correctly with all Hatchling versions in the >=1.18,<2.0 range or if specific minor versions have known issues.
  • Real-world performance impact on build times for projects with many extras.
  • Compatibility with Hatchling's other metadata hooks beyond the stated claim that they run in order.

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 1 — hatchling
Maintenance actively maintained — 231 days since the last release
Last repo commit
First released
Downloads 1,275,993/month — #4,126 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: hatchling_autoextras_hook-0.1.3-py3-none-any.whl

Keywords: automation, hatchling, hook, metadata, optional-dependencies

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/EngineeringTopic :: Software Development :: Libraries

Tags

hatchling metadata hookautomatic all extra generationcombine optional dependencieshatchling build automationoptional dependencies aggregationpython package extrashatchling optional deps
hatchling-pluginbuild-automationpackaging

More Libraries packages