Browse Source

deploy-ng: Grab Python stdlib C extension modules from panda3d whl

Mitchell Stokes 9 years ago
parent
commit
6199d84131
1 changed files with 9 additions and 0 deletions
  1. 9 0
      direct/src/showutil/dist.py

+ 9 - 0
direct/src/showutil/dist.py

@@ -40,6 +40,11 @@ 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]
     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 _sha1
+    return os.path.dirname(_sha1.__file__)
+
+
 class build(distutils.command.build.build):
 class build(distutils.command.build.build):
     def run(self):
     def run(self):
         distutils.command.build.build.run(self)
         distutils.command.build.build.run(self)
@@ -128,6 +133,10 @@ class build(distutils.command.build.build):
                     parts = parts[:-2] + parts[-1:]
                     parts = parts[:-2] + parts[-1:]
                     basename = '.'.join(parts)
                     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)
                 target_path = os.path.join(builddir, basename)
                 if '.whl/' in source_path:
                 if '.whl/' in source_path:
                     # This was found in a wheel, extract it
                     # This was found in a wheel, extract it