Skip to content

Commit

Permalink
Update repair help message
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut committed Mar 12, 2021
1 parent f8a6d91 commit acfce6b
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions auditwheel/main_repair.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,41 @@
from .policy import (load_policies, get_policy_by_name, get_policy_name,
get_priority_by_name, POLICY_PRIORITY_HIGHEST)
from .tools import EnvironmentDefault
import argparse
import logging


logger = logging.getLogger(__name__)


def configure_parser(sub_parsers):
policies = load_policies()
policy_names = [p['name'] for p in policies]
policy_names += [alias for p in policies for alias in p['aliases']]
aliases_help = 'Legacy tags are still supported and alias the new PEP600 '\
'tags. '
epilog = """PLATFORMS:
These are the possible target platform tags, as specified by PEP 600.
Note that old, pre-PEP 600 tags are still usable and are listed as aliases
below.
"""
for p in policies:
if len(p['aliases']) == 0:
continue
if len(p['aliases']) == 1:
middle = 'is an alias'
else:
middle = 'are aliases'
aliases_help += f"{', '.join(p['aliases'])} {middle} for {p['name']}. "
epilog += f"- {p['name']}"
if len(p['aliases']) > 0:
epilog += f" (aliased by {', '.join(p['aliases'])})"
epilog += '\n'
highest_policy = get_policy_name(POLICY_PRIORITY_HIGHEST)
help = "Vendor in external shared library dependencies of a wheel."
p = sub_parsers.add_parser('repair', help=help, description=help,
epilog=aliases_help)
p = sub_parsers.add_parser(
'repair', help=help, description=help, epilog=epilog,
formatter_class=argparse.RawDescriptionHelpFormatter)
p.add_argument('WHEEL_FILE', help='Path to wheel file.')
p.add_argument(
'--plat',
action=EnvironmentDefault,
metavar='PLATFORM',
env='AUDITWHEEL_PLAT',
dest='PLAT',
help=f'Desired target platform. (default: "{highest_policy}")\n'
f'{aliases_help}',
help='Desired target platform. See the available platforms under the '
f'PLATFORMS section below. (default: "{highest_policy}")',
choices=policy_names,
default=highest_policy)
p.add_argument('-L',
Expand Down

0 comments on commit acfce6b

Please sign in to comment.