File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1
1
# hatch_build.py is executed by hatch at build-time and can contain custom build logic hooks
2
+ import os
2
3
from hatchling .metadata .plugin .interface import MetadataHookInterface
3
4
4
5
5
6
class CustomMetadataHook (MetadataHookInterface ):
6
7
"""Custom metadata hook for hatch that ensures that gitlint and gitlint-core[trusted-deps] versions always match"""
7
8
8
9
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' ]} " ]
You can’t perform that action at this time.
0 commit comments