mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-06 05:55:42 +00:00
nem sei pq tantos arquivos
This commit is contained in:
@@ -92,10 +92,10 @@ def check_dist_restriction(options: Values, check_target: bool = False) -> None:
|
||||
)
|
||||
|
||||
if check_target:
|
||||
if dist_restriction_set and not options.target_dir:
|
||||
if not options.dry_run and dist_restriction_set and not options.target_dir:
|
||||
raise CommandError(
|
||||
"Can not use any platform or abi specific options unless "
|
||||
"installing via '--target'"
|
||||
"installing via '--target' or using '--dry-run'"
|
||||
)
|
||||
|
||||
|
||||
@@ -226,9 +226,9 @@ progress_bar: Callable[..., Option] = partial(
|
||||
"--progress-bar",
|
||||
dest="progress_bar",
|
||||
type="choice",
|
||||
choices=["on", "off"],
|
||||
choices=["on", "off", "raw"],
|
||||
default="on",
|
||||
help="Specify whether the progress bar should be used [on, off] (default: on)",
|
||||
help="Specify whether the progress bar should be used [on, off, raw] (default: on)",
|
||||
)
|
||||
|
||||
log: Callable[..., Option] = partial(
|
||||
@@ -252,6 +252,19 @@ no_input: Callable[..., Option] = partial(
|
||||
help="Disable prompting for input.",
|
||||
)
|
||||
|
||||
keyring_provider: Callable[..., Option] = partial(
|
||||
Option,
|
||||
"--keyring-provider",
|
||||
dest="keyring_provider",
|
||||
choices=["auto", "disabled", "import", "subprocess"],
|
||||
default="auto",
|
||||
help=(
|
||||
"Enable the credential lookup via the keyring library if user input is allowed."
|
||||
" Specify which mechanism to use [auto, disabled, import, subprocess]."
|
||||
" (default: %default)"
|
||||
),
|
||||
)
|
||||
|
||||
proxy: Callable[..., Option] = partial(
|
||||
Option,
|
||||
"--proxy",
|
||||
@@ -569,10 +582,7 @@ def _handle_python_version(
|
||||
"""
|
||||
version_info, error_msg = _convert_python_version(value)
|
||||
if error_msg is not None:
|
||||
msg = "invalid --python-version value: {!r}: {}".format(
|
||||
value,
|
||||
error_msg,
|
||||
)
|
||||
msg = f"invalid --python-version value: {value!r}: {error_msg}"
|
||||
raise_option_error(parser, option=option, msg=msg)
|
||||
|
||||
parser.values.python_version = version_info
|
||||
@@ -657,7 +667,10 @@ def prefer_binary() -> Option:
|
||||
dest="prefer_binary",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Prefer older binary packages over newer source packages.",
|
||||
help=(
|
||||
"Prefer binary packages over source packages, even if the "
|
||||
"source packages are newer."
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@@ -770,10 +783,14 @@ def _handle_no_use_pep517(
|
||||
"""
|
||||
raise_option_error(parser, option=option, msg=msg)
|
||||
|
||||
# If user doesn't wish to use pep517, we check if setuptools is installed
|
||||
# If user doesn't wish to use pep517, we check if setuptools and wheel are installed
|
||||
# and raise error if it is not.
|
||||
if not importlib.util.find_spec("setuptools"):
|
||||
msg = "It is not possible to use --no-use-pep517 without setuptools installed."
|
||||
packages = ("setuptools", "wheel")
|
||||
if not all(importlib.util.find_spec(package) for package in packages):
|
||||
msg = (
|
||||
f"It is not possible to use --no-use-pep517 "
|
||||
f"without {' and '.join(packages)} installed."
|
||||
)
|
||||
raise_option_error(parser, option=option, msg=msg)
|
||||
|
||||
# Otherwise, --no-use-pep517 was passed via the command-line.
|
||||
@@ -806,16 +823,23 @@ def _handle_config_settings(
|
||||
) -> None:
|
||||
key, sep, val = value.partition("=")
|
||||
if sep != "=":
|
||||
parser.error(f"Arguments to {opt_str} must be of the form KEY=VAL") # noqa
|
||||
parser.error(f"Arguments to {opt_str} must be of the form KEY=VAL")
|
||||
dest = getattr(parser.values, option.dest)
|
||||
if dest is None:
|
||||
dest = {}
|
||||
setattr(parser.values, option.dest, dest)
|
||||
dest[key] = val
|
||||
if key in dest:
|
||||
if isinstance(dest[key], list):
|
||||
dest[key].append(val)
|
||||
else:
|
||||
dest[key] = [dest[key], val]
|
||||
else:
|
||||
dest[key] = val
|
||||
|
||||
|
||||
config_settings: Callable[..., Option] = partial(
|
||||
Option,
|
||||
"-C",
|
||||
"--config-settings",
|
||||
dest="config_settings",
|
||||
type=str,
|
||||
@@ -827,17 +851,6 @@ config_settings: Callable[..., Option] = partial(
|
||||
"to pass multiple keys to the backend.",
|
||||
)
|
||||
|
||||
install_options: Callable[..., Option] = partial(
|
||||
Option,
|
||||
"--install-option",
|
||||
dest="install_options",
|
||||
action="append",
|
||||
metavar="options",
|
||||
help="This option is deprecated. Using this option with location-changing "
|
||||
"options may cause unexpected behavior. "
|
||||
"Use pip-level options like --user, --prefix, --root, and --target.",
|
||||
)
|
||||
|
||||
build_options: Callable[..., Option] = partial(
|
||||
Option,
|
||||
"--build-option",
|
||||
@@ -890,7 +903,7 @@ root_user_action: Callable[..., Option] = partial(
|
||||
dest="root_user_action",
|
||||
default="warn",
|
||||
choices=["warn", "ignore"],
|
||||
help="Action if pip is run as a root user. By default, a warning message is shown.",
|
||||
help="Action if pip is run as a root user [warn, ignore] (default: warn)",
|
||||
)
|
||||
|
||||
|
||||
@@ -905,13 +918,13 @@ def _handle_merge_hash(
|
||||
algo, digest = value.split(":", 1)
|
||||
except ValueError:
|
||||
parser.error(
|
||||
"Arguments to {} must be a hash name " # noqa
|
||||
f"Arguments to {opt_str} must be a hash name "
|
||||
"followed by a value, like --hash=sha256:"
|
||||
"abcde...".format(opt_str)
|
||||
"abcde..."
|
||||
)
|
||||
if algo not in STRONG_HASHES:
|
||||
parser.error(
|
||||
"Allowed hash algorithms for {} are {}.".format( # noqa
|
||||
"Allowed hash algorithms for {} are {}.".format(
|
||||
opt_str, ", ".join(STRONG_HASHES)
|
||||
)
|
||||
)
|
||||
@@ -981,6 +994,12 @@ no_python_version_warning: Callable[..., Option] = partial(
|
||||
)
|
||||
|
||||
|
||||
# Features that are now always on. A warning is printed if they are used.
|
||||
ALWAYS_ENABLED_FEATURES = [
|
||||
"truststore", # always on since 24.2
|
||||
"no-binary-enable-wheel-cache", # always on since 23.1
|
||||
]
|
||||
|
||||
use_new_feature: Callable[..., Option] = partial(
|
||||
Option,
|
||||
"--use-feature",
|
||||
@@ -990,9 +1009,8 @@ use_new_feature: Callable[..., Option] = partial(
|
||||
default=[],
|
||||
choices=[
|
||||
"fast-deps",
|
||||
"truststore",
|
||||
"no-binary-enable-wheel-cache",
|
||||
],
|
||||
]
|
||||
+ ALWAYS_ENABLED_FEATURES,
|
||||
help="Enable new functionality, that may be backward incompatible.",
|
||||
)
|
||||
|
||||
@@ -1005,6 +1023,7 @@ use_deprecated_feature: Callable[..., Option] = partial(
|
||||
default=[],
|
||||
choices=[
|
||||
"legacy-resolver",
|
||||
"legacy-certs",
|
||||
],
|
||||
help=("Enable deprecated functionality, that will be removed in the future."),
|
||||
)
|
||||
@@ -1027,6 +1046,7 @@ general_group: Dict[str, Any] = {
|
||||
quiet,
|
||||
log,
|
||||
no_input,
|
||||
keyring_provider,
|
||||
proxy,
|
||||
retries,
|
||||
timeout,
|
||||
|
||||
Reference in New Issue
Block a user