--- id: hatch-build-scripts version: "1.0.0" license: MIT License Copyright (c) 2025 Ryan Morshead 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) license_treatment: permissive maintenance: aging --- # hatch_build_scripts — Dependency injection without the boilerplate. License: permissive · Maintenance: aging · Downloads: 221.4K/mo ## 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 above — 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 pip install hatch-build-scripts uv add hatch-build-scripts 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 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_current - Install friction: low - Maintenance: aging - Downloads: 221.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags hatch build hook plugin, run scripts during package build, include build artifacts in distribution, custom build commands hatch, build-time script execution, hatchling build extension, package build automation, build-automation, hatch-plugin [View on SkillFed](https://skillfed.io/packages/hatch-build-scripts) · [View on PyPI](https://pypi.org/project/hatch-build-scripts/)