Browse Source

deploy-ng: fix some issues finding relative library deps in wheels

In particular, this fixes deploying with numpy for macOS, since the numpy whl has library dependencies with .. in the path.
rdb 7 years ago
parent
commit
55371e0aad
1 changed files with 3 additions and 2 deletions
  1. 3 2
      direct/src/showutil/dist.py

+ 3 - 2
direct/src/showutil/dist.py

@@ -864,7 +864,7 @@ class build_apps(setuptools.Command):
                 whlfile = self._get_zip_file(whl)
 
                 # Normalize the path separator
-                wf = wf.replace(os.path.sep, '/')
+                wf = os.path.normpath(wf).replace(os.path.sep, '/')
 
                 # Look case-insensitively.
                 namelist = whlfile.namelist()
@@ -935,9 +935,10 @@ class build_apps(setuptools.Command):
         self.copy(source_path, target_path)
 
         fp = open(target_path, 'rb')
+        source_dir = os.path.dirname(source_path)
         target_dir = os.path.dirname(target_path)
         base = os.path.basename(target_path)
-        self.copy_dependencies(fp, target_dir, search_path, base)
+        self.copy_dependencies(fp, target_dir, search_path + [source_dir], base)
 
     def copy_dependencies(self, fp, target_dir, search_path, referenced_by):
         """ Copies the dependencies of the given open file. """