skillfed

hatch_build_scripts

Dependency injection without the boilerplate.

hatch-build-scripts v1.0.0 221.4K downloads/30d#9,279 on PyPI26
Permissive license MIT License Copyright (c) 2025 Ryan Morshead <ryan.morshead@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files… (full text in the JSON record) AGING released

What it is and what it does

hatch-build-scripts is a build-time plugin for Hatch that extends the hatchling build backend to run arbitrary shell commands and capture their artifacts during package creation. You configure it in your project's pyproject.toml with arrays of commands, output directories, and artifact patterns (using .gitignore-style syntax), and the plugin executes those commands at build time, then includes the matched artifacts in your final distribution.

It's useful when your package needs to generate code, compile resources, or produce other files as part of the build process—things that can't be checked into version control or that depend on build-time decisions. The plugin depends on hatchling and pathspec, and requires Python 3.10 or later. It is classified as Beta and has not seen a release in over a year, though the repository remains maintained.

Use it for:

  • Generate source code or configuration files at build time based on templates or external data.
  • Compile or transpile assets (e.g., TypeScript to JavaScript, SCSS to CSS) and include them in the wheel.
  • Run code generation tools (e.g., protobuf, GraphQL schema generators) and package the output.
  • Build native extensions or run build scripts that produce binary artifacts for inclusion.
  • Automate documentation generation or changelog processing as part of the package build.

Worth the install?

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

A Hatch build plugin that runs arbitrary shell commands during package building and includes their output artifacts in distributions.

Yes, if you need to run build-time scripts and include their artifacts in your distribution. The plugin is straightforward to configure and has no security issues. The aging maintenance status (442 days since last release) is a minor concern for a build tool, but the repository is not archived and remains functional. Install friction is low. Suitable for projects that genuinely need build-time artifact generation.

Install

hatch-build-scripts on PyPI

pip

pip install hatch-build-scripts

uv

uv add hatch-build-scripts

poetry

poetry add hatch-build-scripts

Installing hatch_build_scripts

Before you install

Low friction installation as a pure-Python wheel. Maintenance status is aging—last release was 442 days ago—but the repository remains active and unarchived with recent commits.

License in practice

MIT License permits unrestricted use, modification, and distribution with no warranty. Safe for commercial and private projects.

Quickstart

# In pyproject.toml:
[build-system]
requires = ["hatchling", "hatch-build-scripts"]
build-backend = "hatchling.build"

[[tool.hatch.build.hooks.build-scripts.scripts]]
commands = ["echo 'Hello' > hello.txt"]
artifacts = ["hello.txt"]
out_dir = "out"

Requires Python 3.10 or later. Must be configured in pyproject.toml as a build-system requirement, not installed as a runtime dependency.

Verify before relying

  • Whether the plugin handles complex shell syntax or only simple commands reliably.
  • Performance impact when running many build scripts or large artifact collections.
  • Compatibility with non-POSIX shells or Windows batch commands.

Package facts

License MIT License Copyright (c) 2025 Ryan Morshead <ryan.morshead@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files… (full text in the JSON record) (permissive)
Python support supports the current Python release (<4,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — hatchling, pathspec
Maintenance aging — 442 days since the last release
Last repo commit
First released
Downloads 221,415/month — #9,279 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: hatch_build_scripts-1.0.0-py3-none-any.whl

Development Status :: 4 - BetaProgramming Language :: Python

Tags

hatch build hook pluginrun scripts during package buildinclude build artifacts in distributioncustom build commands hatchbuild-time script executionhatchling build extensionpackage build automation
build-automationhatch-plugin

More Build Tools packages