mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 01:44:06 -04:00
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.
This commit is contained in:
parent
40c23e5cf1
commit
fff8c82d7c
@ -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]
|
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):
|
class build(distutils.command.build.build):
|
||||||
def run(self):
|
def run(self):
|
||||||
distutils.command.build.build.run(self)
|
distutils.command.build.build.run(self)
|
||||||
@ -95,6 +89,10 @@ class build(distutils.command.build.build):
|
|||||||
for whl in wheelpaths:
|
for whl in wheelpaths:
|
||||||
sys.path.insert(0, whl)
|
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
|
# Create runtime
|
||||||
freezer_extras = set()
|
freezer_extras = set()
|
||||||
freezer_modules = set()
|
freezer_modules = set()
|
||||||
@ -141,10 +139,6 @@ 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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user