From fff8c82d7c90623f457a2dba20a190a6c726fb30 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Sat, 7 Jan 2017 10:19:04 -0800 Subject: [PATCH] deploy-ng: Correctly add deploy_libs to sys.path Now modulefinder will pick up on the Python stdlib C extension modules in the panda3d whl, and no special path hacks are required. --- direct/src/showutil/dist.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/direct/src/showutil/dist.py b/direct/src/showutil/dist.py index a8b3bc446c..876de9d23d 100644 --- a/direct/src/showutil/dist.py +++ b/direct/src/showutil/dist.py @@ -44,12 +44,6 @@ def find_packages(whlfile): return [i for i in filelist if '.so.' in i or i.endswith('.dll') or i.endswith('.dylib') or 'libpandagl' in i] -def get_python_ext_module_dir(): - import cmath - import inspect - return os.path.dirname(inspect.getfile(cmath)) - - class build(distutils.command.build.build): def run(self): distutils.command.build.build.run(self) @@ -95,6 +89,10 @@ class build(distutils.command.build.build): for whl in wheelpaths: sys.path.insert(0, whl) + # Add deploy_libs from panda3d whl to the path + sys.path.insert(0, os.path.join(p3dwhlfn, 'deploy_libs')) + + # Create runtime freezer_extras = set() freezer_modules = set() @@ -141,10 +139,6 @@ class build(distutils.command.build.build): parts = parts[:-2] + parts[-1:] basename = '.'.join(parts) - if use_wheels and source_path.startswith(get_python_ext_module_dir()): - # Look in panda3d whl instead - source_path = source_path.replace(get_python_ext_module_dir(), '{}/deploy_libs'.format(p3dwhlfn)) - target_path = os.path.join(builddir, basename) if '.whl/' in source_path: # This was found in a wheel, extract it