Skip to content

Commit 0fa0ac4

Browse files
committed
fixed python3.lib not being added for sabi
incase of sabi abi3=True is passed to get library which looks for the .lib without minor version Signed-off-by: Devashish Lal <[email protected]>
1 parent da8aac9 commit 0fa0ac4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/scikit_build_core/builder/sysconfig.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __dir__() -> list[str]:
4747

4848
# Adapted from scikit-build by removing few checks that have already been earlier
4949
# https://github.com/scikit-build/scikit-build/blob/master/skbuild/cmaker.py#L514
50-
def _try_to_find_python_library() -> Path | None:
50+
def _try_to_find_python_library(*, abi3: bool = False) -> Path | None:
5151
candidate_lib_prefixes = ["", "lib"]
5252
candidate_suffixes = [""]
5353
candidate_implementations = ["python"]
@@ -72,6 +72,10 @@ def _try_to_find_python_library() -> Path | None:
7272
"",
7373
]
7474

75+
# Don't consider minor version if abi3
76+
if abi3:
77+
candidate_versions.pop(0)
78+
7579
abiflags = getattr(sys, "abiflags", "")
7680
candidate_abiflags = [abiflags]
7781
if abiflags:
@@ -187,7 +191,7 @@ def get_python_library(env: Mapping[str, str], *, abi3: bool = False) -> Path |
187191
if libpath.is_file():
188192
return libpath
189193

190-
lib_path: Path | None = _try_to_find_python_library()
194+
lib_path: Path | None = _try_to_find_python_library(abi3=abi3)
191195
if lib_path:
192196
return lib_path
193197

0 commit comments

Comments
 (0)