diff options
Diffstat (limited to 'hatch_build.py')
-rw-r--r-- | hatch_build.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/hatch_build.py b/hatch_build.py new file mode 100644 index 0000000..c58a8e1 --- /dev/null +++ b/hatch_build.py @@ -0,0 +1,9 @@ +# hatch_build.py is executed by hatch at build-time and can contain custom build logic hooks +from hatchling.metadata.plugin.interface import MetadataHookInterface + + +class CustomMetadataHook(MetadataHookInterface): + """Custom metadata hook for hatch that ensures that gitlint and gitlint-core[trusted-deps] versions always match""" + + def update(self, metadata: dict) -> None: + metadata["dependencies"] = [f"gitlint-core[trusted-deps]=={metadata['version']}"] |