MCPcopy Create free account
hub / github.com/numpy/numpy / unpack_windows_zip

Function unpack_windows_zip

tools/openblas_support.py:178–200  ·  view source on GitHub ↗
(fname, plat)

Source from the content-addressed store, hash-verified

176
177
178def unpack_windows_zip(fname, plat):
179 unzip_base = os.path.join(gettempdir(), 'openblas')
180 if not os.path.exists(unzip_base):
181 os.mkdir(unzip_base)
182 with zipfile.ZipFile(fname, 'r') as zf:
183 zf.extractall(unzip_base)
184 if plat == "win-32":
185 target = os.path.join(unzip_base, "32")
186 else:
187 target = os.path.join(unzip_base, "64")
188 # Copy the lib to openblas.lib. Once we can properly use pkg-config
189 # this will not be needed
190 lib = glob.glob(os.path.join(target, 'lib', '*.lib'))
191 if len(lib) == 1:
192 # The 64-bit tarball already has these copied, no need to do it
193 for f in lib:
194 shutil.copy(f, os.path.join(target, 'lib', 'openblas.lib'))
195 shutil.copy(f, os.path.join(target, 'lib', 'openblas64_.lib'))
196 # Copy the dll from bin to lib so system_info can pick it up
197 dll = glob.glob(os.path.join(target, 'bin', '*.dll'))
198 for f in dll:
199 shutil.copy(f, os.path.join(target, 'lib'))
200 return target
201
202
203def unpack_targz(fname):

Callers 1

setup_openblasFunction · 0.85

Calls 3

joinMethod · 0.45
existsMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected