2929)
3030
3131from duckdb_packaging ._versioning import create_git_tag , pep440_to_git_tag , get_git_describe , strip_post_from_version
32- from duckdb_packaging .setuptools_scm_version import forced_version_from_env
32+ from duckdb_packaging .setuptools_scm_version import forced_version_from_env , MAIN_BRANCH_VERSIONING
3333
3434
3535_DUCKDB_VERSION_FILENAME = "duckdb_version.txt"
4141
4242def _log (msg : str , is_error : bool = False ) -> None :
4343 """Log a message with build backend prefix.
44-
44+
4545 Args:
4646 msg: The message to log.
4747 is_error: If True, log to stderr; otherwise log to stdout.
@@ -51,7 +51,7 @@ def _log(msg: str, is_error: bool=False) -> None:
5151
5252def _in_git_repository () -> bool :
5353 """Check if the current directory is inside a git repository.
54-
54+
5555 Returns:
5656 True if .git directory exists, False otherwise.
5757 """
@@ -129,7 +129,7 @@ def _skbuild_config_add(
129129 key : str , value : Union [List , str ], config_settings : Dict [str , Union [List [str ],str ]], fail_if_exists : bool = False
130130):
131131 """Add or modify a configuration setting for scikit-build-core.
132-
132+
133133 This function handles adding values to scikit-build-core configuration settings,
134134 supporting both string and list types with appropriate merging behavior.
135135
@@ -145,7 +145,7 @@ def _skbuild_config_add(
145145
146146 Behavior Rules:
147147 - String value + list setting: value is appended to the list
148- - String value + string setting: existing value is overridden
148+ - String value + string setting: existing value is overridden
149149 - List value + list setting: existing list is extended
150150 - List value + string setting: raises RuntimeError
151151
@@ -180,18 +180,18 @@ def _skbuild_config_add(
180180
181181def build_sdist (sdist_directory : str , config_settings : Optional [Dict [str , Union [List [str ],str ]]] = None ) -> str :
182182 """Build a source distribution using the DuckDB submodule.
183-
183+
184184 This function extracts the DuckDB version from either the git submodule and saves it
185185 to a version file before building the sdist with scikit-build-core. If _FORCED_PEP440_VERSION
186186 was set then we first create a tag on the submodule.
187-
187+
188188 Args:
189189 sdist_directory: Directory where the sdist will be created.
190190 config_settings: Optional build configuration settings.
191-
191+
192192 Returns:
193193 The filename of the created sdist.
194-
194+
195195 Raises:
196196 RuntimeError: If not in a git repository or DuckDB submodule issues.
197197 """
@@ -201,7 +201,7 @@ def build_sdist(sdist_directory: str, config_settings: Optional[Dict[str, Union[
201201 if _FORCED_PEP440_VERSION is not None :
202202 duckdb_version = pep440_to_git_tag (strip_post_from_version (_FORCED_PEP440_VERSION ))
203203 else :
204- duckdb_version = get_git_describe (repo_path = submodule_path )
204+ duckdb_version = get_git_describe (repo_path = submodule_path , since_minor = MAIN_BRANCH_VERSIONING )
205205 _write_duckdb_long_version (duckdb_version )
206206 return skbuild_build_sdist (sdist_directory , config_settings = config_settings )
207207
@@ -212,19 +212,19 @@ def build_wheel(
212212 metadata_directory : Optional [str ] = None ,
213213) -> str :
214214 """Build a wheel from either git submodule or extracted sdist sources.
215-
215+
216216 This function builds a wheel using scikit-build-core, handling two scenarios:
217217 1. In a git repository: builds directly from the DuckDB submodule
218218 2. In an sdist: reads the saved DuckDB version and passes it to CMake
219-
219+
220220 Args:
221221 wheel_directory: Directory where the wheel will be created.
222222 config_settings: Optional build configuration settings.
223223 metadata_directory: Optional directory for metadata preparation.
224-
224+
225225 Returns:
226226 The filename of the created wheel.
227-
227+
228228 Raises:
229229 RuntimeError: If not in a git repository or sdist environment.
230230 """
@@ -259,4 +259,4 @@ def build_wheel(
259259 "get_requires_for_build_editable" ,
260260 "prepare_metadata_for_build_wheel" ,
261261 "prepare_metadata_for_build_editable" ,
262- ]
262+ ]
0 commit comments