From de139943d8272773b5f19ed824d687b0232b9ba3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 11 Mar 2023 09:03:03 +0100 Subject: Adding upstream version 0.19.1. Signed-off-by: Daniel Baumann --- hatch_build.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 hatch_build.py (limited to 'hatch_build.py') diff --git a/hatch_build.py b/hatch_build.py new file mode 100644 index 0000000..4be7a45 --- /dev/null +++ b/hatch_build.py @@ -0,0 +1,13 @@ +# hatch_build.py is executed by hatch at build-time and can contain custom build logic hooks +import os +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: + # Only enforce versioning matching outside of the 'dev' environment, this allows for re-use of the 'dev' + # environment between different git branches. + if os.environ.get("HATCH_ENV_ACTIVE", "not-dev") != "dev": + metadata["dependencies"] = [f"gitlint-core[trusted-deps]=={metadata['version']}"] -- cgit v1.2.3