Skip to content

Commit 063f5c4

Browse files
authored
Disable gitlint to gitlint-core versioning matching in dev env (#440)
This allows for re-use of the 'dev' environment between different git branches.
1 parent b409f30 commit 063f5c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: hatch_build.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# hatch_build.py is executed by hatch at build-time and can contain custom build logic hooks
2+
import os
23
from hatchling.metadata.plugin.interface import MetadataHookInterface
34

45

56
class CustomMetadataHook(MetadataHookInterface):
67
"""Custom metadata hook for hatch that ensures that gitlint and gitlint-core[trusted-deps] versions always match"""
78

89
def update(self, metadata: dict) -> None:
9-
metadata["dependencies"] = [f"gitlint-core[trusted-deps]=={metadata['version']}"]
10+
# Only enforce versioning matching outside of the 'dev' environment, this allows for re-use of the 'dev'
11+
# environment between different git branches.
12+
if os.environ.get("HATCH_ENV_ACTIVE", "not-dev") != "dev":
13+
metadata["dependencies"] = [f"gitlint-core[trusted-deps]=={metadata['version']}"]

0 commit comments

Comments
 (0)