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.
Default Lifecycle
The plugin integrates into the Hatch build process:
-
hatch buildis invoked -
The build hook scans
sourcesdirectories for decorated code -
An
annotations.ymlis generated in theoutput_directory -
A
reqstool_config.ymlis created with paths for the package structure -
reqstool data is included in the built sdist/wheel package