Usage

Basic Usage

Add the build hook to your pyproject.toml:

[tool.hatch.build.hooks.reqstool]
dependencies = ["reqstool-python-hatch-plugin"]
sources = ["src", "tests"]
test_results = "build/junit.xml"
dataset_directory = "docs/reqstool"
output_directory = "build/reqstool"

Decorator Dependency

To use @Requirements and @SVCs decorators in your code, add the decorators package as a dependency:

[project]
dependencies = ["reqstool-python-decorators"]

See reqstool-python-decorators for decorator usage.

Running the Build

hatch build

Default Lifecycle

The plugin integrates into the Hatch build process:

  1. hatch build is invoked

  2. The build hook scans sources directories for decorated code

  3. An annotations.yml is generated in the output_directory

  4. A reqstool_config.yml is created with paths for the package structure

  5. reqstool data is included in the built sdist/wheel package