File tree 1 file changed +4
-0
lines changed
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 2
2
# This allows us to extend or override its functionality where needed
3
3
from setuptools import build_meta as _orig
4
4
5
+ # Re-use the default implementations for standard PEP 517 hook methods
5
6
prepare_metadata_for_build_wheel = _orig .prepare_metadata_for_build_wheel
6
7
build_wheel = _orig .build_wheel
7
8
build_sdist = _orig .build_sdist
8
9
get_requires_for_build_sdist = _orig .get_requires_for_build_sdist
9
10
11
+ # Override the `get_requires_for_build_wheel` function to add dynamic dependency logic
10
12
def get_requires_for_build_wheel (config_settings = None ):
11
13
from packaging import version
12
14
from skbuild .exceptions import SKBuildError
@@ -15,11 +17,13 @@ def get_requires_for_build_wheel(config_settings=None):
15
17
# check if system cmake can be used if present
16
18
# if not, append cmake PyPI distribution to required packages
17
19
# scikit-build>=0.18 itself requires cmake 3.5+
20
+ # Define the minimum required version of CMake (needed by scikit-build>=0.18)
18
21
min_version = "3.5"
19
22
try :
20
23
if version .parse (get_cmake_version ().split ("-" )[0 ]) < version .parse (min_version ):
21
24
packages .append (f'cmake>={ min_version } ' )
22
25
except SKBuildError :
23
26
packages .append (f'cmake>={ min_version } ' )
24
27
28
+ # Return the final list of required packages for building the wheel
25
29
return packages
You can’t perform that action at this time.
0 commit comments