diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-09 13:38:02 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-09 13:38:02 +0000 |
commit | 6f442e774b9236c999f36c2d7af17640f49bff99 (patch) | |
tree | 47e73755bffd41bdde2d59d76cc595f5a1fa75d4 /hatch_build.py | |
parent | Initial commit. (diff) | |
download | gitlint-6f442e774b9236c999f36c2d7af17640f49bff99.tar.xz gitlint-6f442e774b9236c999f36c2d7af17640f49bff99.zip |
Adding upstream version 0.19.1.upstream/0.19.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'hatch_build.py')
-rw-r--r-- | hatch_build.py | 13 |
1 files changed, 13 insertions, 0 deletions
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']}"] |