Skip to content

Commit 60dc1fc

Browse files
committed
fix: more logging
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 3bd8c26 commit 60dc1fc

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/scikit_build_core/builder/cross_compile.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def set_cross_compile_env(
4646
yield
4747
return
4848

49-
if getattr(sysconfig, "_get_sysconfigdata_name", ""):
49+
sysconf_name = getattr(sysconfig, "_get_sysconfigdata_name", "")
50+
if not sysconf_name:
5051
logger.warning(
5152
"Cross-compiling is not supported due to sysconfig._get_sysconfigdata_name missing."
5253
)
@@ -58,7 +59,7 @@ def set_cross_compile_env(
5859
cross_compile_file = tmp_dir / f"_cross_compile_{ext_suffix}.py"
5960
input_txt = resources.read_text("_cross_compile.py")
6061
output_text = string.Template(input_txt).substitute(
61-
host_name=sysconfig._get_sysconfigdata_name(), # type: ignore[attr-defined]
62+
host_name=sysconf_name,
6263
SOABI=ext_suffix.rsplit(maxsplit=1)[0],
6364
EXT_SUFFIX=ext_suffix,
6465
)
@@ -70,6 +71,11 @@ def set_cross_compile_env(
7071
else str(tmp_dir)
7172
)
7273
env["_PYTHON_SYSCONFIGDATA_NAME"] = f"_cross_compile_{ext_suffix}.py"
74+
logger.info(f"Cross-compiling is enabled to {ext_suffix!r}.")
75+
logger.debug(
76+
f"Setting _PYTHON_SYSCONFIGDATA_NAME to {env['_PYTHON_SYSCONFIGDATA_NAME']!r}."
77+
)
78+
logger.debug(f"Setting PYTHONPATH to {env['PYTHONPATH']!r}.")
7379
try:
7480
yield
7581
finally:

tests/test_module_dir.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ def on_all_modules(
2929

3030
def test_all_modules_filter_all():
3131
all_modules = on_all_modules("scikit_build_core", pkg=False)
32-
all_modules = (n for n in all_modules if not n.split(".")[-1].startswith("__"))
32+
all_modules = (
33+
n
34+
for n in all_modules
35+
if not n.split(".")[-1].startswith("__") and "resources" not in n
36+
)
3337
for name in all_modules:
3438
module = importlib.import_module(name)
3539

@@ -45,7 +49,11 @@ def test_all_modules_filter_all():
4549

4650
def test_all_modules_has_all():
4751
all_modules = on_all_modules("scikit_build_core", pkg=True)
48-
all_modules = (n for n in all_modules if not n.split(".")[-1].startswith("_"))
52+
all_modules = (
53+
n
54+
for n in all_modules
55+
if not n.split(".")[-1].startswith("_") and "resources" not in n
56+
)
4957
for name in all_modules:
5058
module = importlib.import_module(name)
5159

0 commit comments

Comments
 (0)