From adbeea33fb1fd3e720687b34b989c1cd9668225c Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 24 Dec 2020 14:16:40 +0100 Subject: [PATCH] dist: Warn if picking up binary dependency from outside a wheel --- direct/src/dist/commands.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/direct/src/dist/commands.py b/direct/src/dist/commands.py index d46d320e29..c84d453bfd 100644 --- a/direct/src/dist/commands.py +++ b/direct/src/dist/commands.py @@ -579,6 +579,7 @@ class build_apps(setuptools.Command): path = sys.path[:] p3dwhl = None + wheelpaths = [] if use_wheels: wheelpaths = self.download_wheels(platform) @@ -853,6 +854,7 @@ class build_apps(setuptools.Command): for module, source_path in freezer_extras: if source_path is not None: # Rename panda3d/core.pyd to panda3d.core.pyd + source_path = os.path.normpath(source_path) basename = os.path.basename(source_path) if '.' in module: basename = module.rsplit('.', 1)[0] + '.' + basename @@ -863,6 +865,20 @@ class build_apps(setuptools.Command): if len(parts) >= 3 and '-' in parts[-2]: parts = parts[:-2] + parts[-1:] basename = '.'.join(parts) + + # Was this not found in a wheel? Then we may have a problem, + # since it may be for the current platform instead of the target + # platform. + if use_wheels: + found_in_wheel = False + for whl in wheelpaths: + whl = os.path.normpath(whl) + if source_path.lower().startswith(os.path.join(whl, '').lower()): + found_in_wheel = True + break + + if not found_in_wheel: + self.warn('{} was not found in any downloaded wheel, is a dependency missing from requirements.txt?'.format(basename)) else: # Builtin module, but might not be builtin in wheel libs, so double check if module in whl_modules: