Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _dist_info_dir(bdist_dir):
"""Get the .dist-info directory from an unpacked wheel
Parameters
----------
bdist_dir : str
Path of unpacked wheel file
"""
info_dirs = glob.glob(pjoin(bdist_dir, '*.dist-info'))
if len(info_dirs) != 1:
raise WheelToolsError("Should be exactly one `*.dist_info` directory")
return info_dirs[0]
logger.info('%s receives the following tag: "%s".',
basename(args.WHEEL_FILE), wheel_abi.overall_tag)
logger.info('Use ``auditwheel show`` for more details')
if wheel_abi.overall_tag in in_fname_tags:
logger.info('No tags to be added. Exiting.')
return 1
# todo: move more of this logic to separate file
if not exists(args.WHEEL_DIR):
os.makedirs(args.WHEEL_DIR)
with InWheelCtx(args.WHEEL_FILE) as ctx:
try:
out_wheel = add_platforms(ctx, [wheel_abi.overall_tag])
except WheelToolsError as e:
logger.exception('\n%s.', repr(e))
return 1
if out_wheel:
# tell context manager to write wheel on exit with
# the proper output directory
ctx.out_wheel = join(args.WHEEL_DIR, basename(out_wheel))
logger.info('\nUpdated wheel written to %s', out_wheel)
return 0