in odps_scripts/pyodps_pack.py [0:0]
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"specifiers",
metavar="REQ",
nargs="*",
help="a requirement item compatible with pip command",
)
parser.add_argument(
"--requirement",
"-r",
action="append",
default=[],
metavar="PATH",
help="Path of requirements.txt including file name",
)
parser.add_argument(
"--install-requires",
action="append",
default=[],
help="Requirement for install time",
)
parser.add_argument(
"--install-requires-file",
action="append",
default=[],
help="Requirement file for install time",
)
parser.add_argument("--run-before", help="Prepare script before package build.")
parser.add_argument(
"--no-deps",
action="store_true",
default=False,
help="Don't put package dependencies into archives",
)
parser.add_argument(
"--pre",
action="store_true",
default=False,
help="Include pre-release and development versions. "
"By default, pyodps-pack only finds stable versions.",
)
parser.add_argument(
"--proxy",
metavar="proxy",
help="Specify a proxy in the form scheme://[user:passwd@]proxy.server:port.",
)
parser.add_argument(
"--retries",
metavar="retries",
help="Maximum number of retries each connection should attempt (default 5 times).",
)
parser.add_argument(
"--timeout",
metavar="sec",
help="Set the socket timeout (default 15 seconds).",
)
parser.add_argument(
"--exclude",
"-X",
action="append",
default=[],
metavar="DEPEND",
help="Requirements to exclude from the package",
)
parser.add_argument(
"--index-url",
"-i",
default="",
help="Base URL of PyPI package. If absent, will use "
"`global.index-url` in `pip config list` command by default.",
)
parser.add_argument(
"--extra-index-url",
metavar="url",
action="append",
default=[],
help="Extra URLs of package indexes to use in addition to --index-url. "
"Should follow the same rules as --index-url.",
)
parser.add_argument(
"--trusted-host",
metavar="host",
action="append",
default=[],
help="Mark this host or host:port pair as trusted, "
"even though it does not have valid or any HTTPS.",
)
parser.add_argument(
"--legacy-image",
"-l",
action="store_true",
default=False,
help="Use legacy image to make packages",
)
parser.add_argument(
"--mcpy27",
action="store_true",
default=False,
help="Build package for Python 2.7 on MaxCompute. "
"If enabled, will assume `legacy-image` to be true.",
)
parser.add_argument(
"--dwpy27",
action="store_true",
default=False,
help="Build package for Python 2.7 on DataWorks. "
"If enabled, will assume `legacy-image` to be true.",
)
parser.add_argument(
"--prefer-binary",
action="store_true",
default=False,
help="Prefer older binary packages over newer source packages",
)
parser.add_argument(
"--output",
"-o",
default="packages.tar.gz",
help="Target archive file name to store",
)
parser.add_argument(
"--dynlib",
action="append",
default=[],
help="Dynamic library to include. Can be an absolute path to a .so library "
"or library name with or without 'lib' prefix.",
)
parser.add_argument(
"--pack-env", action="store_true", default=False, help="Pack full environment"
)
parser.add_argument(
"--exclude-editable",
action="store_true",
default=False,
help="Exclude editable packages when packing",
)
parser.add_argument(
"--use-pep517",
action="store_true",
default=None,
help="Use PEP 517 for building source distributions (use --no-use-pep517 to force legacy behaviour).",
)
parser.add_argument(
"--no-use-pep517",
action="store_false",
dest="use_pep517",
default=None,
help=argparse.SUPPRESS,
)
parser.add_argument(
"--check-build-dependencies",
action="store_true",
default=None,
help="Check the build dependencies when PEP517 is used.",
)
parser.add_argument(
"--arch",
default="x86_64",
help="Architecture of target package, x86_64 by default. Currently only x86_64 "
"and aarch64 supported. Do not use this argument if you are not running "
"your code in a proprietary cloud.",
)
parser.add_argument(
"--python-version",
help="Version of Python your environment is on, for instance 3.6. "
"You may also use 36 instead. Do not use this argument if you "
"are not running your code in a proprietary cloud.",
)
parser.add_argument("--docker-args", help="Extra arguments for Docker.")
parser.add_argument(
"--no-docker",
action="store_true",
default=False,
help="Create packages without Docker. May cause errors if incompatible "
"binaries involved.",
)
parser.add_argument(
"--without-docker", action="store_true", default=False, help=argparse.SUPPRESS
)
parser.add_argument(
"--no-merge",
action="store_true",
default=False,
help="Create or download wheels without merging them.",
)
parser.add_argument(
"--without-merge", action="store_true", default=False, help=argparse.SUPPRESS
)
parser.add_argument(
"--skip-scan-pkg-resources",
action="store_true",
default=False,
help="Skip scanning for usage of pkg-resources package.",
)
parser.add_argument(
"--find-vcs-root",
action="store_true",
default=False,
help="Find VCS root when building local source code.",
)
parser.add_argument(
"--debug",
action="store_true",
default=False,
help="Dump debug messages for diagnose purpose",
)
args = parser.parse_args()
if args.without_docker:
_print_warning(
"DEPRECATION: --without-docker is deprecated, use --no-docker instead."
)
args.no_docker = True
if args.without_merge:
_print_warning(
"DEPRECATION: --without-merge is deprecated, use --no-merge instead."
)
args.no_merge = True
try:
sys.exit(_main(args) or 0)
except PackException as ex:
_print_fail(ex.args[0])
if isinstance(ex, PackCommandException):
parser.print_help()
sys.exit(1)