Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def main():
lib_path = sys.argv[1]
dist_path = sys.argv[2] if len(sys.argv) > 2 else 'dist'
wheel_fnames = glob(pjoin(dist_path, '*.whl'))
for fname in wheel_fnames:
print('Processing', fname)
with wheeltools.InWheel(fname, fname):
shutil.copy2(lib_path, pjoin('numpy', 'core'))
def add_library(lib_path, dist_path='dist'):
wheel_fnames = glob(pjoin(dist_path, '*.whl'))
for fname in wheel_fnames:
print('Processing', fname)
with wheeltools.InWheel(fname, fname):
shutil.copy2(lib_path, pjoin('numpy', 'core'))
import shutil
import sys
from os.path import join as pjoin
from glob import glob
from zipfile import ZipFile
from delocate import wheeltools
def my_zip2dir(zip_fname, out_dir):
with open(zip_fname, 'rb') as fobj:
zip = ZipFile(fobj)
zip.extractall(path=out_dir)
# Monkeypatch wheeltools
wheeltools.zip2dir = my_zip2dir
def main():
lib_path = sys.argv[1]
dist_path = sys.argv[2] if len(sys.argv) > 2 else 'dist'
wheel_fnames = glob(pjoin(dist_path, '*.whl'))
for fname in wheel_fnames:
print('Processing', fname)
with wheeltools.InWheel(fname, fname):
shutil.copy2(lib_path, pjoin('numpy', 'core'))
if __name__ == '__main__':
main()
BUILD_STUFF = abspath(dirname(__file__))
DEFAULT_OPENBLAS_ROOT = r"c:\opt"
OPENBLAS_LIBNAME_RE = re.compile(r'^libraries\s*=\s*(.+)$', re.M)
def my_zip2dir(zip_fname, out_dir):
""" Removes need for 'unzip' binary in PATH during `wheeltools.zip2dir`
"""
with open(zip_fname, 'rb') as fobj:
zip = ZipFile(fobj)
zip.extractall(path=out_dir)
# Monkeypatch wheeltools
wheeltools.zip2dir = my_zip2dir
def get_bitness():
bits, _ = architecture()
return '32' if bits == '32bit' else '64' if bits == '64bit' else None
def add_library(lib_path, dist_path='dist'):
wheel_fnames = glob(pjoin(dist_path, '*.whl'))
for fname in wheel_fnames:
print('Processing', fname)
with wheeltools.InWheel(fname, fname):
shutil.copy2(lib_path, pjoin('numpy', 'core'))
def main():