hatch_build_scripts-1.0.0


توضیحات

Dependency injection without the boilerplate.
ویژگی مقدار
سیستم عامل -
نام فایل hatch_build_scripts-1.0.0
نام hatch_build_scripts
نسخه کتابخانه 1.0.0
نگهدارنده []
ایمیل نگهدارنده []
نویسنده -
ایمیل نویسنده Ryan Morshead <ryan.morshead@gmail.com>
آدرس صفحه اصلی -
آدرس اینترنتی https://pypi.org/project/hatch_build_scripts/
مجوز 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 (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Hatch Build Scripts [![PyPI - Version](https://img.shields.io/pypi/v/hatch_build_scripts.svg)](https://pypi.org/project/hatch_build_scripts) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/hatch_build_scripts.svg)](https://pypi.org/project/hatch_build_scripts) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) A plugin for [Hatch](https://github.com/pypa/hatch) that allows you to run arbitrary build scripts and include their artifacts in your package distributions. ## Installation To set up `hatch-build-scripts` for your project you'll need to configure it in your project's `pyproject.toml` file as a `build-system` requirement: ```toml [build-system] requires = ["hatchling", "hatch-build-scripts"] build-backend = "hatchling.build" ``` ## Usage Now you'll need to configure the build scripts you want to run. This is done by adding an array of scripts to the `tool.hatch.build.hooks.build-scripts.scripts` key in your `pyproject.toml` file. Each script is configured with the following keys: | Key | Default | Description | | ----------------- | -------- | ------------------------------------------------------------------------------------------------------- | | `commands` | required | An array of commands to run. Each command is run in a separate shell. | | `artifacts` | `[]` | An array of artifact patterns (same as `.gitignore`) to include in your package distributions. | | `out_dir` | `"."` | The directory to copy artifacts into. | | `work_dir` | `"."` | The directory to run the commands in. All artifact patterns are relative to this directory. | | `clean_artifacts` | `true` | Whether to clean files from the `out_dir` that match the artifact patterns before running the commands. | | `clean_out_dir` | `false` | Whether to clean the `out_dir` before running the commands. | In practice this looks like: ```toml [[tool.hatch.build.hooks.build-scripts.scripts]] out_dir = "out" commands = [ "echo 'Hello, world!' > hello.txt", "echo 'Goodbye, world!' > goodbye.txt", ] artifacts = [ "hello.txt", "goodbye.txt", ] [[tool.hatch.build.hooks.build-scripts.scripts]] # you can add more scripts here... ``` You can configure script defaults for scripts by adding a `[tool.hatch.build.hooks.build-scripts]` table to your `pyproject.toml` file. The following keys are supported: | Key | Default | Description | | ----------------- | ------- | ------------------------------------------------------------------------------------------------------- | | `out_dir` | `"."` | The directory to copy artifacts into. | | `work_dir` | `"."` | The directory to run the commands in. All artifact patterns are relative to this directory. | | `clean_artifacts` | `true` | Whether to clean files from the `out_dir` that match the artifact patterns before running the commands. | | `clean_out_dir` | `false` | Whether to clean the `out_dir` before running the commands. |


نیازمندی

مقدار نام
- hatchling
- pathspec


زبان مورد نیاز

مقدار نام
<4,>=3.10 Python


نحوه نصب


نصب پکیج whl hatch_build_scripts-1.0.0:

    pip install hatch_build_scripts-1.0.0.whl


نصب پکیج tar.gz hatch_build_scripts-1.0.0:

    pip install hatch_build_scripts-1.0.0.tar.gz