Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._internal.cli.cmdoptions Namespace Reference

Data Structures

class  PipOption
 

Functions

None raise_option_error (OptionParser parser, Option option, str msg)
 
OptionGroup make_option_group (Dict[str, Any] group, ConfigOptionParser parser)
 
None check_dist_restriction (Values options, bool check_target=False)
 
str _path_option_check (Option option, str opt, str value)
 
str _package_name_option_check (Option option, str opt, str value)
 
Option exists_action ()
 
Option extra_index_url ()
 
Option find_links ()
 
Option trusted_host ()
 
Option constraints ()
 
Option requirements ()
 
Option editable ()
 
None _handle_src (Option option, str opt_str, str value, OptionParser parser)
 
Any _get_format_control (Values values, Option option)
 
None _handle_no_binary (Option option, str opt_str, str value, OptionParser parser)
 
None _handle_only_binary (Option option, str opt_str, str value, OptionParser parser)
 
Option no_binary ()
 
Option only_binary ()
 
Tuple[Tuple[int,...], Optional[str]] _convert_python_version (str value)
 
None _handle_python_version (Option option, str opt_str, str value, OptionParser parser)
 
None add_target_python_options (OptionGroup cmd_opts)
 
TargetPython make_target_python (Values options)
 
Option prefer_binary ()
 
None _handle_no_cache_dir (Option option, str opt, str value, OptionParser parser)
 
None _handle_no_use_pep517 (Option option, str opt, str value, OptionParser parser)
 
None _handle_config_settings (Option option, str opt_str, str value, OptionParser parser)
 
None _handle_merge_hash (Option option, str opt_str, str value, OptionParser parser)
 
None check_list_path_option (Values options)
 

Variables

 logger = logging.getLogger(__name__)
 
Callable cert
 
Callable client_cert
 
Callable index_url
 
Callable no_index
 
Callable src
 
Callable platforms
 
Callable python_version
 
Callable implementation
 
Callable abis
 
Callable cache_dir
 
Callable no_cache
 
Callable no_deps
 
Callable ignore_requires_python
 
Callable no_build_isolation
 
Callable check_build_deps
 
Any use_pep517
 
Any no_use_pep517
 
Callable config_settings
 
Callable build_options
 
Callable global_options
 
Callable no_clean
 
Callable pre
 
Callable disable_pip_version_check
 
Callable root_user_action
 
Callable hash
 
Callable require_hashes
 
Callable list_path
 
Callable list_exclude
 
Callable no_python_version_warning
 
list ALWAYS_ENABLED_FEATURES
 
Callable use_new_feature
 
Callable use_deprecated_feature
 
dict general_group
 groups #
 
dict index_group
 

Detailed Description

shared options and groups

The principle here is to define options once, but *not* instantiate them
globally. One reason being that options with action='append' can carry state
between parses. pip parses general options twice internally, and shouldn't
pass on state. To be consistent, all options will follow this design.

Function Documentation

◆ _convert_python_version()

Tuple[Tuple[int, ...], Optional[str]] _convert_python_version ( str  value)
protected
Convert a version string like "3", "37", or "3.7.3" into a tuple of ints.

:return: A 2-tuple (version_info, error_msg), where `error_msg` is
    non-None if and only if there was a parsing error.

Definition at line 548 of file cmdoptions.py.

548def _convert_python_version(value: str) -> Tuple[Tuple[int, ...], Optional[str]]:
549 """
550 Convert a version string like "3", "37", or "3.7.3" into a tuple of ints.
551
552 :return: A 2-tuple (version_info, error_msg), where `error_msg` is
553 non-None if and only if there was a parsing error.
554 """
555 if not value:
556 # The empty string is the same as not providing a value.
557 return (None, None)
558
559 parts = value.split(".")
560 if len(parts) > 3:
561 return ((), "at most three version parts are allowed")
562
563 if len(parts) == 1:
564 # Then we are in the case of "3" or "37".
565 value = parts[0]
566 if len(value) > 1:
567 parts = [value[0], value[1:]]
568
569 try:
570 version_info = tuple(int(part) for part in parts)
571 except ValueError:
572 return ((), "each version part must be an integer")
573
574 return (version_info, None)
575
576
for i

References i.

Referenced by pip._internal.cli.cmdoptions._handle_python_version().

Here is the caller graph for this function:

◆ _get_format_control()

Any _get_format_control ( Values  values,
Option  option 
)
protected
Get a format_control object.

Definition at line 469 of file cmdoptions.py.

469def _get_format_control(values: Values, option: Option) -> Any:
470 """Get a format_control object."""
471 return getattr(values, option.dest)
472
473

References i.

Referenced by pip._internal.cli.cmdoptions._handle_no_binary(), and pip._internal.cli.cmdoptions._handle_only_binary().

Here is the caller graph for this function:

◆ _handle_config_settings()

None _handle_config_settings ( Option  option,
str  opt_str,
str  value,
OptionParser   parser 
)
protected

Definition at line 821 of file cmdoptions.py.

823) -> None:
824 key, sep, val = value.partition("=")
825 if sep != "=":
826 parser.error(f"Arguments to {opt_str} must be of the form KEY=VAL") # noqa
828 if dest is None:
829 dest = {}
831 if key in dest:
832 if isinstance(dest[key], list):
833 dest[key].append(val)
834 else:
835 dest[key] = [dest[key], val]
836 else:
837 dest[key] = val
838
839

References i.

◆ _handle_merge_hash()

None _handle_merge_hash ( Option  option,
str  opt_str,
str  value,
OptionParser   parser 
)
protected
Given a value spelled "algo:digest", append the digest to a list
pointed to in a dict by the algo name.

Definition at line 910 of file cmdoptions.py.

912) -> None:
913 """Given a value spelled "algo:digest", append the digest to a list
914 pointed to in a dict by the algo name."""
917 try:
918 algo, digest = value.split(":", 1)
919 except ValueError:
921 "Arguments to {} must be a hash name " # noqa
922 "followed by a value, like --hash=sha256:"
923 "abcde...".format(opt_str)
924 )
925 if algo not in STRONG_HASHES:
927 "Allowed hash algorithms for {} are {}.".format( # noqa
928 opt_str, ", ".join(STRONG_HASHES)
929 )
930 )
931 parser.values.hashes.setdefault(algo, []).append(digest)
932
933

References i.

◆ _handle_no_binary()

None _handle_no_binary ( Option  option,
str  opt_str,
str  value,
OptionParser   parser 
)
protected

Definition at line 474 of file cmdoptions.py.

476) -> None:
477 existing = _get_format_control(parser.values, option)
479 value,
482 )
483
484

References pip._internal.cli.cmdoptions._get_format_control(), and i.

Here is the call graph for this function:

◆ _handle_no_cache_dir()

None _handle_no_cache_dir ( Option  option,
str  opt,
str  value,
OptionParser   parser 
)
protected
Process a value provided for the --no-cache-dir option.

This is an optparse.Option callback for the --no-cache-dir option.

Definition at line 688 of file cmdoptions.py.

690) -> None:
691 """
692 Process a value provided for the --no-cache-dir option.
693
694 This is an optparse.Option callback for the --no-cache-dir option.
695 """
696 # The value argument will be None if --no-cache-dir is passed via the
697 # command-line, since the option doesn't accept arguments. However,
698 # the value can be non-None if the option is triggered e.g. by an
699 # environment variable, like PIP_NO_CACHE_DIR=true.
700 if value is not None:
701 # Then parse the string value to get argument error-checking.
702 try:
703 strtobool(value)
704 except ValueError as exc:
705 raise_option_error(parser, option=option, msg=str(exc))
706
707 # Originally, setting PIP_NO_CACHE_DIR to a value that strtobool()
708 # converted to 0 (like "false" or "no") caused cache_dir to be disabled
709 # rather than enabled (logic would say the latter). Thus, we disable
710 # the cache directory not just on values that parse to True, but (for
711 # backwards compatibility reasons) also on values that parse to False.
712 # In other words, always set it to False if the option is provided in
713 # some (valid) form.
715
716

References i, and pip._internal.cli.cmdoptions.raise_option_error().

Here is the call graph for this function:

◆ _handle_no_use_pep517()

None _handle_no_use_pep517 ( Option  option,
str  opt,
str  value,
OptionParser   parser 
)
protected
Process a value provided for the --no-use-pep517 option.

This is an optparse.Option callback for the no_use_pep517 option.

Definition at line 765 of file cmdoptions.py.

767) -> None:
768 """
769 Process a value provided for the --no-use-pep517 option.
770
771 This is an optparse.Option callback for the no_use_pep517 option.
772 """
773 # Since --no-use-pep517 doesn't accept arguments, the value argument
774 # will be None if --no-use-pep517 is passed via the command-line.
775 # However, the value can be non-None if the option is triggered e.g.
776 # by an environment variable, for example "PIP_NO_USE_PEP517=true".
777 if value is not None:
778 msg = """A value was passed for --no-use-pep517,
779 probably using either the PIP_NO_USE_PEP517 environment variable
780 or the "no-use-pep517" config file option. Use an appropriate value
781 of the PIP_USE_PEP517 environment variable or the "use-pep517"
782 config file option instead.
783 """
784 raise_option_error(parser, option=option, msg=msg)
785
786 # If user doesn't wish to use pep517, we check if setuptools and wheel are installed
787 # and raise error if it is not.
788 packages = ("setuptools", "wheel")
789 if not all(importlib.util.find_spec(package) for package in packages):
790 msg = (
791 f"It is not possible to use --no-use-pep517 "
792 f"without {' and '.join(packages)} installed."
793 )
794 raise_option_error(parser, option=option, msg=msg)
795
796 # Otherwise, --no-use-pep517 was passed via the command-line.
798
799

References i, and pip._internal.cli.cmdoptions.raise_option_error().

Here is the call graph for this function:

◆ _handle_only_binary()

None _handle_only_binary ( Option  option,
str  opt_str,
str  value,
OptionParser   parser 
)
protected

Definition at line 485 of file cmdoptions.py.

487) -> None:
488 existing = _get_format_control(parser.values, option)
490 value,
493 )
494
495

References pip._internal.cli.cmdoptions._get_format_control(), and i.

Here is the call graph for this function:

◆ _handle_python_version()

None _handle_python_version ( Option  option,
str  opt_str,
str  value,
OptionParser   parser 
)
protected
Handle a provided --python-version value.

Definition at line 577 of file cmdoptions.py.

579) -> None:
580 """
581 Handle a provided --python-version value.
582 """
583 version_info, error_msg = _convert_python_version(value)
584 if error_msg is not None:
585 msg = "invalid --python-version value: {!r}: {}".format(
586 value,
587 error_msg,
588 )
589 raise_option_error(parser, option=option, msg=msg)
590
591 parser.values.python_version = version_info
592
593

References pip._internal.cli.cmdoptions._convert_python_version(), i, and pip._internal.cli.cmdoptions.raise_option_error().

Here is the call graph for this function:

◆ _handle_src()

None _handle_src ( Option  option,
str  opt_str,
str  value,
OptionParser  parser 
)
protected

Definition at line 446 of file cmdoptions.py.

446def _handle_src(option: Option, opt_str: str, value: str, parser: OptionParser) -> None:
447 value = os.path.abspath(value)
449
450

References i.

◆ _package_name_option_check()

str _package_name_option_check ( Option  option,
str  opt,
str  value 
)
protected

Definition at line 106 of file cmdoptions.py.

106def _package_name_option_check(option: Option, opt: str, value: str) -> str:
107 return canonicalize_name(value)
108
109

◆ _path_option_check()

str _path_option_check ( Option  option,
str  opt,
str  value 
)
protected

Definition at line 102 of file cmdoptions.py.

102def _path_option_check(option: Option, opt: str, value: str) -> str:
103 return os.path.expanduser(value)
104
105

References i.

◆ add_target_python_options()

None add_target_python_options ( OptionGroup  cmd_opts)

Definition at line 649 of file cmdoptions.py.

649def add_target_python_options(cmd_opts: OptionGroup) -> None:
650 cmd_opts.add_option(platforms())
651 cmd_opts.add_option(python_version())
652 cmd_opts.add_option(implementation())
653 cmd_opts.add_option(abis())
654
655

References pip._internal.cli.cmdoptions.abis, i, pip._internal.cli.cmdoptions.implementation, pip._internal.cli.cmdoptions.platforms, and pip._internal.cli.cmdoptions.python_version.

◆ check_dist_restriction()

None check_dist_restriction ( Values  options,
bool   check_target = False 
)
Function for determining if custom platform options are allowed.

:param options: The OptionParser options.
:param check_target: Whether or not to check if --target is being used.

Definition at line 62 of file cmdoptions.py.

62def check_dist_restriction(options: Values, check_target: bool = False) -> None:
63 """Function for determining if custom platform options are allowed.
64
65 :param options: The OptionParser options.
66 :param check_target: Whether or not to check if --target is being used.
67 """
68 dist_restriction_set = any(
69 [
74 ]
75 )
76
77 binary_only = FormatControl(set(), {":all:"})
78 sdist_dependencies_allowed = (
80 )
81
82 # Installations or downloads using dist restrictions must not combine
83 # source distributions and dist-specific wheels, as they are not
84 # guaranteed to be locally compatible.
85 if dist_restriction_set and sdist_dependencies_allowed:
86 raise CommandError(
87 "When restricting platform and interpreter constraints using "
88 "--python-version, --platform, --abi, or --implementation, "
89 "either --no-deps must be set, or --only-binary=:all: must be "
90 "set and --no-binary must not be set (or must be set to "
91 ":none:)."
92 )
93
94 if check_target:
95 if dist_restriction_set and not options.target_dir:
96 raise CommandError(
97 "Can not use any platform or abi specific options unless "
98 "installing via '--target'"
99 )
100
101

References i.

◆ check_list_path_option()

None check_list_path_option ( Values  options)

Definition at line 971 of file cmdoptions.py.

971def check_list_path_option(options: Values) -> None:
973 raise CommandError("Cannot combine '--path' with '--user' or '--local'")
974
975

References i.

◆ constraints()

Option constraints ( )

Definition at line 405 of file cmdoptions.py.

405def constraints() -> Option:
406 return Option(
407 "-c",
408 "--constraint",
409 dest="constraints",
410 action="append",
411 default=[],
412 metavar="file",
413 help="Constrain versions using the given constraints file. "
414 "This option can be used multiple times.",
415 )
416
417

◆ editable()

Option editable ( )

Definition at line 431 of file cmdoptions.py.

431def editable() -> Option:
432 return Option(
433 "-e",
434 "--editable",
435 dest="editables",
436 action="append",
437 default=[],
438 metavar="path/url",
439 help=(
440 "Install a project in editable mode (i.e. setuptools "
441 '"develop mode") from a local project path or a VCS url.'
442 ),
443 )
444
445

◆ exists_action()

Option exists_action ( )

Definition at line 299 of file cmdoptions.py.

299def exists_action() -> Option:
300 return Option(
301 # Option when path already exist
302 "--exists-action",
303 dest="exists_action",
304 type="choice",
305 choices=["s", "i", "w", "b", "a"],
306 default=[],
307 action="append",
308 metavar="action",
309 help="Default action when a path already exists: "
310 "(s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.",
311 )
312
313

◆ extra_index_url()

Option extra_index_url ( )

Definition at line 354 of file cmdoptions.py.

354def extra_index_url() -> Option:
355 return Option(
356 "--extra-index-url",
357 dest="extra_index_urls",
358 metavar="URL",
359 action="append",
360 default=[],
361 help="Extra URLs of package indexes to use in addition to "
362 "--index-url. Should follow the same rules as "
363 "--index-url.",
364 )
365
366

◆ find_links()

Option find_links ( )

Definition at line 377 of file cmdoptions.py.

377def find_links() -> Option:
378 return Option(
379 "-f",
380 "--find-links",
381 dest="find_links",
382 action="append",
383 default=[],
384 metavar="url",
385 help="If a URL or path to an html file, then parse for links to "
386 "archives such as sdist (.tar.gz) or wheel (.whl) files. "
387 "If a local path or file:// URL that's a directory, "
388 "then look for archives in the directory listing. "
389 "Links to VCS project URLs are not supported.",
390 )
391
392

◆ make_option_group()

OptionGroup make_option_group ( Dict[str, Any]  group,
ConfigOptionParser  parser 
)
Return an OptionGroup object
group  -- assumed to be dict with 'name' and 'options' keys
parser -- an optparse Parser

Definition at line 50 of file cmdoptions.py.

50def make_option_group(group: Dict[str, Any], parser: ConfigOptionParser) -> OptionGroup:
51 """
52 Return an OptionGroup object
53 group -- assumed to be dict with 'name' and 'options' keys
54 parser -- an optparse Parser
55 """
56 option_group = OptionGroup(parser, group["name"])
57 for option in group["options"]:
59 return option_group
60
61

References i.

◆ make_target_python()

TargetPython make_target_python ( Values  options)

Definition at line 656 of file cmdoptions.py.

656def make_target_python(options: Values) -> TargetPython:
657 target_python = TargetPython(
658 platforms=options.platforms,
659 py_version_info=options.python_version,
660 abis=options.abis,
661 implementation=options.implementation,
662 )
663
664 return target_python
665
666

References i.

◆ no_binary()

Option no_binary ( )

Definition at line 496 of file cmdoptions.py.

496def no_binary() -> Option:
497 format_control = FormatControl(set(), set())
498 return Option(
499 "--no-binary",
500 dest="format_control",
501 action="callback",
502 callback=_handle_no_binary,
503 type="str",
504 default=format_control,
505 help="Do not use binary packages. Can be supplied multiple times, and "
506 'each time adds to the existing value. Accepts either ":all:" to '
507 'disable all binary packages, ":none:" to empty the set (notice '
508 "the colons), or one or more package names with commas between "
509 "them (no colons). Note that some packages are tricky to compile "
510 "and may fail to install when this option is used on them.",
511 )
512
513

◆ only_binary()

Option only_binary ( )

Definition at line 514 of file cmdoptions.py.

514def only_binary() -> Option:
515 format_control = FormatControl(set(), set())
516 return Option(
517 "--only-binary",
518 dest="format_control",
519 action="callback",
520 callback=_handle_only_binary,
521 type="str",
522 default=format_control,
523 help="Do not use source packages. Can be supplied multiple times, and "
524 'each time adds to the existing value. Accepts either ":all:" to '
525 'disable all source packages, ":none:" to empty the set, or one '
526 "or more package names with commas between them. Packages "
527 "without binary distributions will fail to install when this "
528 "option is used on them.",
529 )
530
531

◆ prefer_binary()

Option prefer_binary ( )

Definition at line 667 of file cmdoptions.py.

667def prefer_binary() -> Option:
668 return Option(
669 "--prefer-binary",
670 dest="prefer_binary",
671 action="store_true",
672 default=False,
673 help="Prefer older binary packages over newer source packages.",
674 )
675
676

◆ raise_option_error()

None raise_option_error ( OptionParser  parser,
Option  option,
str  msg 
)
Raise an option parsing error using parser.error().

Args:
  parser: an OptionParser instance.
  option: an Option instance.
  msg: the error text.

Definition at line 36 of file cmdoptions.py.

36def raise_option_error(parser: OptionParser, option: Option, msg: str) -> None:
37 """
38 Raise an option parsing error using parser.error().
39
40 Args:
41 parser: an OptionParser instance.
42 option: an Option instance.
43 msg: the error text.
44 """
45 msg = f"{option} error: {msg}"
46 msg = textwrap.fill(" ".join(msg.split()))
47 parser.error(msg)
48
49

References i.

Referenced by pip._internal.cli.cmdoptions._handle_no_cache_dir(), pip._internal.cli.cmdoptions._handle_no_use_pep517(), and pip._internal.cli.cmdoptions._handle_python_version().

Here is the caller graph for this function:

◆ requirements()

Option requirements ( )

Definition at line 418 of file cmdoptions.py.

418def requirements() -> Option:
419 return Option(
420 "-r",
421 "--requirement",
422 dest="requirements",
423 action="append",
424 default=[],
425 metavar="file",
426 help="Install from the given requirements file. "
427 "This option can be used multiple times.",
428 )
429
430

◆ trusted_host()

Option trusted_host ( )

Definition at line 393 of file cmdoptions.py.

393def trusted_host() -> Option:
394 return Option(
395 "--trusted-host",
396 dest="trusted_hosts",
397 action="append",
398 metavar="HOSTNAME",
399 default=[],
400 help="Mark this host or host:port pair as trusted, even though it "
401 "does not have valid or any HTTPS.",
402 )
403
404

Variable Documentation

◆ abis

Callable abis
Initial value:
1= partial(
2 Option,
3 "--abi",
4 dest="abis",
5 metavar="abi",
6 action="append",
7 default=None,
8 help=(
9 "Only use wheels compatible with Python abi <abi>, e.g. 'pypy_41'. "
10 "If not specified, then the current interpreter abi tag is used. "
11 "Use this option multiple times to specify multiple abis supported "
12 "by the target interpreter. Generally you will need to specify "
13 "--implementation, --platform, and --python-version when using this "
14 "option."
15 ),
16)

Definition at line 631 of file cmdoptions.py.

Referenced by pip._internal.cli.cmdoptions.add_target_python_options().

◆ ALWAYS_ENABLED_FEATURES

list ALWAYS_ENABLED_FEATURES
Initial value:
1= [
2 "no-binary-enable-wheel-cache", # always on since 23.1
3]

Definition at line 998 of file cmdoptions.py.

◆ build_options

Callable build_options
Initial value:
1= partial(
2 Option,
3 "--build-option",
4 dest="build_options",
5 metavar="options",
6 action="append",
7 help="Extra arguments to be supplied to 'setup.py bdist_wheel'.",
8)

Definition at line 854 of file cmdoptions.py.

◆ cache_dir

Callable cache_dir
Initial value:
1= partial(
2 PipOption,
3 "--cache-dir",
4 dest="cache_dir",
5 default=USER_CACHE_DIR,
6 metavar="dir",
7 type="path",
8 help="Store the cache data in <dir>.",
9)

Definition at line 677 of file cmdoptions.py.

◆ cert

Callable cert
Initial value:
1= partial(
2 PipOption,
3 "--cert",
4 dest="cert",
5 type="path",
6 metavar="path",
7 help=(
8 "Path to PEM-encoded CA certificate bundle. "
9 "If provided, overrides the default. "
10 "See 'SSL Certificate Verification' in pip documentation "
11 "for more information."
12 ),
13)

Definition at line 314 of file cmdoptions.py.

◆ check_build_deps

Callable check_build_deps
Initial value:
1= partial(
2 Option,
3 "--check-build-dependencies",
4 dest="check_build_deps",
5 action="store_true",
6 default=False,
7 help="Check the build dependencies when PEP517 is used.",
8)

Definition at line 755 of file cmdoptions.py.

◆ client_cert

Callable client_cert
Initial value:
1= partial(
2 PipOption,
3 "--client-cert",
4 dest="client_cert",
5 type="path",
6 default=None,
7 metavar="path",
8 help="Path to SSL client certificate, a single file containing the "
9 "private key and the certificate in PEM format.",
10)

Definition at line 328 of file cmdoptions.py.

◆ config_settings

Callable config_settings
Initial value:
1= partial(
2 Option,
3 "-C",
4 "--config-settings",
5 dest="config_settings",
6 type=str,
7 action="callback",
8 callback=_handle_config_settings,
9 metavar="settings",
10 help="Configuration settings to be passed to the PEP 517 build backend. "
11 "Settings take the form KEY=VALUE. Use multiple --config-settings options "
12 "to pass multiple keys to the backend.",
13)

Definition at line 840 of file cmdoptions.py.

◆ disable_pip_version_check

Callable disable_pip_version_check
Initial value:
1= partial(
2 Option,
3 "--disable-pip-version-check",
4 dest="disable_pip_version_check",
5 action="store_true",
6 default=False,
7 help="Don't periodically check PyPI to determine whether a new version "
8 "of pip is available for download. Implied with --no-index.",
9)

Definition at line 890 of file cmdoptions.py.

◆ general_group

dict general_group
Initial value:
1= {
2 "name": "General Options",
3 "options": [
4 help_,
5 debug_mode,
6 isolated_mode,
7 require_virtualenv,
8 python,
9 verbose,
10 version,
11 quiet,
12 log,
13 no_input,
14 keyring_provider,
15 proxy,
16 retries,
17 timeout,
18 exists_action,
19 trusted_host,
20 cert,
21 client_cert,
22 cache_dir,
23 no_cache,
24 disable_pip_version_check,
25 no_color,
26 no_python_version_warning,
27 use_new_feature,
28 use_deprecated_feature,
29 ],
30}

groups #

Definition at line 1035 of file cmdoptions.py.

◆ global_options

Callable global_options
Initial value:
1= partial(
2 Option,
3 "--global-option",
4 dest="global_options",
5 action="append",
6 metavar="options",
7 help="Extra global options to be supplied to the setup.py "
8 "call before the install or bdist_wheel command.",
9)

Definition at line 863 of file cmdoptions.py.

◆ hash

Callable hash
Initial value:
1= partial(
2 Option,
3 "--hash",
4 # Hash values eventually end up in InstallRequirement.hashes due to
5 # __dict__ copying in process_line().
6 dest="hashes",
7 action="callback",
8 callback=_handle_merge_hash,
9 type="string",
10 help="Verify that the package's archive matches this "
11 "hash before installing. Example: --hash=sha256:abcdef...",
12)

Definition at line 934 of file cmdoptions.py.

◆ ignore_requires_python

Callable ignore_requires_python
Initial value:
1= partial(
2 Option,
3 "--ignore-requires-python",
4 dest="ignore_requires_python",
5 action="store_true",
6 help="Ignore the Requires-Python information.",
7)

Definition at line 736 of file cmdoptions.py.

◆ implementation

Callable implementation
Initial value:
1= partial(
2 Option,
3 "--implementation",
4 dest="implementation",
5 metavar="implementation",
6 default=None,
7 help=(
8 "Only use wheels compatible with Python "
9 "implementation <implementation>, e.g. 'pp', 'jy', 'cp', "
10 " or 'ip'. If not specified, then the current "
11 "interpreter implementation is used. Use 'py' to force "
12 "implementation-agnostic wheels."
13 ),
14)

Definition at line 615 of file cmdoptions.py.

Referenced by pip._internal.cli.cmdoptions.add_target_python_options().

◆ index_group

dict index_group
Initial value:
1= {
2 "name": "Package Index Options",
3 "options": [
4 index_url,
5 extra_index_url,
6 no_index,
7 find_links,
8 ],
9}

Definition at line 1066 of file cmdoptions.py.

◆ index_url

Callable index_url
Initial value:
1= partial(
2 Option,
3 "-i",
4 "--index-url",
5 "--pypi-url",
6 dest="index_url",
7 metavar="URL",
8 default=PyPI.simple_url,
9 help="Base URL of the Python Package Index (default %default). "
10 "This should point to a repository compliant with PEP 503 "
11 "(the simple repository API) or a local directory laid out "
12 "in the same format.",
13)

Definition at line 339 of file cmdoptions.py.

◆ list_exclude

Callable list_exclude
Initial value:
1= partial(
2 PipOption,
3 "--exclude",
4 dest="excludes",
5 action="append",
6 metavar="package",
7 type="package_name",
8 help="Exclude specified package from the output",
9)

Definition at line 976 of file cmdoptions.py.

◆ list_path

Callable list_path
Initial value:
1= partial(
2 PipOption,
3 "--path",
4 dest="path",
5 type="path",
6 action="append",
7 help="Restrict to the specified installation path for listing "
8 "packages (can be used multiple times).",
9)

Definition at line 960 of file cmdoptions.py.

◆ logger

logger = logging.getLogger(__name__)

Definition at line 33 of file cmdoptions.py.

◆ no_build_isolation

Callable no_build_isolation
Initial value:
1= partial(
2 Option,
3 "--no-build-isolation",
4 dest="build_isolation",
5 action="store_false",
6 default=True,
7 help="Disable isolation when building a modern source distribution. "
8 "Build dependencies specified by PEP 518 must be already installed "
9 "if this option is used.",
10)

Definition at line 744 of file cmdoptions.py.

◆ no_cache

Callable no_cache
Initial value:
1= partial(
2 Option,
3 "--no-cache-dir",
4 dest="cache_dir",
5 action="callback",
6 callback=_handle_no_cache_dir,
7 help="Disable the cache.",
8)

Definition at line 717 of file cmdoptions.py.

◆ no_clean

Callable no_clean
Initial value:
1= partial(
2 Option,
3 "--no-clean",
4 action="store_true",
5 default=False,
6 help="Don't clean up build directories.",
7)

Definition at line 873 of file cmdoptions.py.

◆ no_deps

Callable no_deps
Initial value:
1= partial(
2 Option,
3 "--no-deps",
4 "--no-dependencies",
5 dest="ignore_dependencies",
6 action="store_true",
7 default=False,
8 help="Don't install package dependencies.",
9)

Definition at line 726 of file cmdoptions.py.

◆ no_index

Callable no_index
Initial value:
1= partial(
2 Option,
3 "--no-index",
4 dest="no_index",
5 action="store_true",
6 default=False,
7 help="Ignore package index (only looking at --find-links URLs instead).",
8)

Definition at line 367 of file cmdoptions.py.

◆ no_python_version_warning

Callable no_python_version_warning
Initial value:
1= partial(
2 Option,
3 "--no-python-version-warning",
4 dest="no_python_version_warning",
5 action="store_true",
6 default=False,
7 help="Silence deprecation warnings for upcoming unsupported Pythons.",
8)

Definition at line 987 of file cmdoptions.py.

◆ no_use_pep517

Any no_use_pep517
Initial value:
1= partial(
2 Option,
3 "--no-use-pep517",
4 dest="use_pep517",
5 action="callback",
6 callback=_handle_no_use_pep517,
7 default=None,
8 help=SUPPRESS_HELP,
9)

Definition at line 810 of file cmdoptions.py.

◆ platforms

Callable platforms
Initial value:
1= partial(
2 Option,
3 "--platform",
4 dest="platforms",
5 metavar="platform",
6 action="append",
7 default=None,
8 help=(
9 "Only use wheels compatible with <platform>. Defaults to the "
10 "platform of the running system. Use this option multiple times to "
11 "specify multiple platforms supported by the target interpreter."
12 ),
13)

Definition at line 532 of file cmdoptions.py.

Referenced by pip._internal.cli.cmdoptions.add_target_python_options().

◆ pre

Callable pre
Initial value:
1= partial(
2 Option,
3 "--pre",
4 action="store_true",
5 default=False,
6 help="Include pre-release and development versions. By default, "
7 "pip only finds stable versions.",
8)

Definition at line 881 of file cmdoptions.py.

◆ python_version

Callable python_version
Initial value:
1= partial(
2 Option,
3 "--python-version",
4 dest="python_version",
5 metavar="python_version",
6 action="callback",
7 callback=_handle_python_version,
8 type="str",
9 default=None,
10 help=dedent(
11
12 ),
13)

Definition at line 594 of file cmdoptions.py.

Referenced by pip._internal.cli.cmdoptions.add_target_python_options().

◆ require_hashes

Callable require_hashes
Initial value:
1= partial(
2 Option,
3 "--require-hashes",
4 dest="require_hashes",
5 action="store_true",
6 default=False,
7 help="Require a hash to check each requirement against, for "
8 "repeatable installs. This option is implied when any package in a "
9 "requirements file has a --hash option.",
10)

Definition at line 948 of file cmdoptions.py.

◆ root_user_action

Callable root_user_action
Initial value:
1= partial(
2 Option,
3 "--root-user-action",
4 dest="root_user_action",
5 default="warn",
6 choices=["warn", "ignore"],
7 help="Action if pip is run as a root user. By default, a warning message is shown.",
8)

Definition at line 900 of file cmdoptions.py.

◆ src

Callable src
Initial value:
1= partial(
2 PipOption,
3 "--src",
4 "--source",
5 "--source-dir",
6 "--source-directory",
7 dest="src_dir",
8 type="path",
9 metavar="dir",
10 default=get_src_prefix(),
11 action="callback",
12 callback=_handle_src,
13 help="Directory to check out editable projects into. "
14 'The default in a virtualenv is "<venv path>/src". '
15 'The default for global installs is "<current dir>/src".',
16)

Definition at line 451 of file cmdoptions.py.

◆ use_deprecated_feature

Callable use_deprecated_feature
Initial value:
1= partial(
2 Option,
3 "--use-deprecated",
4 dest="deprecated_features_enabled",
5 metavar="feature",
6 action="append",
7 default=[],
8 choices=[
9 "legacy-resolver",
10 ],
11 help=("Enable deprecated functionality, that will be removed in the future."),
12)

Definition at line 1017 of file cmdoptions.py.

◆ use_new_feature

Callable use_new_feature
Initial value:
1= partial(
2 Option,
3 "--use-feature",
4 dest="features_enabled",
5 metavar="feature",
6 action="append",
7 default=[],
8 choices=[
9 "fast-deps",
10 "truststore",
11 ]
12 + ALWAYS_ENABLED_FEATURES,
13 help="Enable new functionality, that may be backward incompatible.",
14)

Definition at line 1002 of file cmdoptions.py.

◆ use_pep517

Any use_pep517
Initial value:
1= partial(
2 Option,
3 "--use-pep517",
4 dest="use_pep517",
5 action="store_true",
6 default=None,
7 help="Use PEP 517 for building source distributions "
8 "(use --no-use-pep517 to force legacy behaviour).",
9)

Definition at line 800 of file cmdoptions.py.