|
17 | 17 | from ..settings.skbuild_model import ScikitBuildSettings
|
18 | 18 | from .cross_compile import auto_cross_compile_env
|
19 | 19 | from .generator import set_environment_for_gen
|
20 |
| -from .sysconfig import get_platform, get_python_include_dir, get_python_library |
| 20 | +from .sysconfig import ( |
| 21 | + get_platform, |
| 22 | + get_python_include_dir, |
| 23 | + get_python_library, |
| 24 | + get_soabi, |
| 25 | +) |
21 | 26 |
|
22 | 27 | __all__: list[str] = ["Builder", "get_archs", "archs_to_tags"]
|
23 | 28 |
|
@@ -158,23 +163,7 @@ def configure(
|
158 | 163 | if python_sabi_library and sysconfig.get_platform().startswith("win"):
|
159 | 164 | cache_config[f"{prefix}_SABI_LIBRARY"] = python_sabi_library
|
160 | 165 |
|
161 |
| - if limited_abi: |
162 |
| - cache_config["SKBUILD_SOABI"] = ( |
163 |
| - "" if sysconfig.get_platform().startswith("win") else "abi3" |
164 |
| - ) |
165 |
| - else: |
166 |
| - # Workaround for bug in PyPy and packaging that is not handled in CMake |
167 |
| - # According to PEP 3149, SOABI and EXT_SUFFIX are interchangeable (and |
168 |
| - # the latter is much more likely to be correct as it is used elsewhere) |
169 |
| - if sys.version_info < (3, 8, 7): |
170 |
| - # See https://github.com/python/cpython/issues/84006 |
171 |
| - import distutils.sysconfig # pylint: disable=deprecated-module |
172 |
| - |
173 |
| - ext_suffix = distutils.sysconfig.get_config_var("EXT_SUFFIX") |
174 |
| - else: |
175 |
| - ext_suffix = sysconfig.get_config_var("EXT_SUFFIX") |
176 |
| - assert isinstance(ext_suffix, str) |
177 |
| - cache_config["SKBUILD_SOABI"] = ext_suffix.rsplit(".", 1)[0].lstrip(".") |
| 166 | + cache_config["SKBUILD_SOABI"] = get_soabi(self.config.env, abi3=limited_abi) |
178 | 167 |
|
179 | 168 | # Allow CMakeLists to detect this is supposed to be a limited ABI build
|
180 | 169 | cache_config["SKBUILD_SABI_COMPONENT"] = (
|
|
0 commit comments