dist: Some work on getting PyQt5 dlls found on Windows

There is more work to do to get PyQt5 to work, however.
This commit is contained in:
rdb 2021-03-12 00:36:42 +01:00
parent eca18f3c19
commit 84051384b8

View File

@ -117,10 +117,13 @@ PACKAGE_DATA_DIRS = {
# Some dependencies have extra directories that need to be scanned for DLLs.
# This dictionary maps wheel basenames (ie. the part of the .whl basename
# before the first hyphen) to a list of directories inside the .whl.
# before the first hyphen) to a list of tuples, the first value being the
# directory inside the wheel, the second being which wheel to look in (or
# None to look in its own wheel).
PACKAGE_LIB_DIRS = {
'scipy': ['scipy/extra-dll'],
'scipy': [('scipy/extra-dll', None)],
'PyQt5': [('PyQt5/Qt5/bin', 'PyQt5_Qt5')],
}
# site.py for Python 2.
@ -731,8 +734,13 @@ class build_apps(setuptools.Command):
# Also look for more specific per-package cases, defined in
# PACKAGE_LIB_DIRS at the top of this file.
extra_dirs = PACKAGE_LIB_DIRS.get(whl_name, [])
for extra_dir in extra_dirs:
search_path.append(os.path.join(whl, extra_dir.replace('/', os.path.sep)))
for extra_dir, search_in in extra_dirs:
if not search_in:
search_path.append(os.path.join(whl, extra_dir.replace('/', os.path.sep)))
else:
for whl2 in wheelpaths:
if os.path.basename(whl2).startswith(search_in + '-'):
search_path.append(os.path.join(whl2, extra_dir.replace('/', os.path.sep)))
return search_path