Extensions: suppress noisy prints for extension wheel filtering

These messages could flood the output even when extension installation
succeeded. Only show them when Python debugging is enabled.
This commit is contained in:
Campbell Barton
2024-11-29 10:09:36 +11:00
parent 00255b9421
commit 5fa0be491e

View File

@@ -945,6 +945,12 @@ def _extensions_wheel_filter_for_this_system(wheels):
# it's highly doubtful users ever run into this but we could add extend this if it's really needed.
# (e.g. `linux-i686` on 64 bit systems & `linux-armv7l`).
import sysconfig
# When false, suppress printing for incompatible wheels.
# This generally isn't a problem as it's common for an extension to include wheels for multiple platforms.
# Printing is mainly useful when installation fails because none of the wheels are compatible.
debug = bpy.app.debug_python
platform_tag_current = sysconfig.get_platform().replace("-", "_")
import sys
@@ -999,12 +1005,12 @@ def _extensions_wheel_filter_for_this_system(wheels):
):
pass
else:
# Useful to know, can quiet print in the future.
print(
"Skipping wheel for other system",
"({:s} != {:s}):".format(platform_tag, platform_tag_current),
wheel_filename,
)
if debug:
print(
"Skipping wheel for other system",
"({:s} != {:s}):".format(platform_tag, platform_tag_current),
wheel_filename,
)
continue
# Perform Python Version Checks.
@@ -1038,17 +1044,17 @@ def _extensions_wheel_filter_for_this_system(wheels):
break
if not python_version_is_compat:
# Useful to know, can quiet print in the future.
print(
"Skipping wheel for other Python version",
"({:s}=>({:s}) not in {:d}.{:d}):".format(
python_tag,
", ".join([".".join(str(i) for i in v) for v in python_versions]),
python_version_current[0],
python_version_current[1],
),
wheel_filename,
)
if debug:
print(
"Skipping wheel for other Python version",
"({:s}=>({:s}) not in {:d}.{:d}):".format(
python_tag,
", ".join([".".join(str(i) for i in v) for v in python_versions]),
python_version_current[0],
python_version_current[1],
),
wheel_filename,
)
continue
wheels_compatible.append(wheel)