|
11 | 11 | # mypy: strict-optional=False |
12 | 12 | from __future__ import annotations |
13 | 13 |
|
14 | | -import importlib.util |
15 | 14 | import logging |
16 | 15 | import os |
17 | 16 | import pathlib |
@@ -184,8 +183,7 @@ class PipOption(Option): |
184 | 183 | action="store_true", |
185 | 184 | default=False, |
186 | 185 | help=( |
187 | | - "Allow pip to only run in a virtual environment; " |
188 | | - "exit with an error otherwise." |
| 186 | + "Allow pip to only run in a virtual environment; exit with an error otherwise." |
189 | 187 | ), |
190 | 188 | ) |
191 | 189 |
|
@@ -851,62 +849,16 @@ def _handle_dependency_group( |
851 | 849 | dest="check_build_deps", |
852 | 850 | action="store_true", |
853 | 851 | default=False, |
854 | | - help="Check the build dependencies when PEP517 is used.", |
| 852 | + help="Check the build dependencies.", |
855 | 853 | ) |
856 | 854 |
|
857 | 855 |
|
858 | | -def _handle_no_use_pep517( |
859 | | - option: Option, opt: str, value: str, parser: OptionParser |
860 | | -) -> None: |
861 | | - """ |
862 | | - Process a value provided for the --no-use-pep517 option. |
863 | | -
|
864 | | - This is an optparse.Option callback for the no_use_pep517 option. |
865 | | - """ |
866 | | - # Since --no-use-pep517 doesn't accept arguments, the value argument |
867 | | - # will be None if --no-use-pep517 is passed via the command-line. |
868 | | - # However, the value can be non-None if the option is triggered e.g. |
869 | | - # by an environment variable, for example "PIP_NO_USE_PEP517=true". |
870 | | - if value is not None: |
871 | | - msg = """A value was passed for --no-use-pep517, |
872 | | - probably using either the PIP_NO_USE_PEP517 environment variable |
873 | | - or the "no-use-pep517" config file option. Use an appropriate value |
874 | | - of the PIP_USE_PEP517 environment variable or the "use-pep517" |
875 | | - config file option instead. |
876 | | - """ |
877 | | - raise_option_error(parser, option=option, msg=msg) |
878 | | - |
879 | | - # If user doesn't wish to use pep517, we check if setuptools is installed |
880 | | - # and raise error if it is not. |
881 | | - packages = ("setuptools",) |
882 | | - if not all(importlib.util.find_spec(package) for package in packages): |
883 | | - msg = ( |
884 | | - f"It is not possible to use --no-use-pep517 " |
885 | | - f"without {' and '.join(packages)} installed." |
886 | | - ) |
887 | | - raise_option_error(parser, option=option, msg=msg) |
888 | | - |
889 | | - # Otherwise, --no-use-pep517 was passed via the command-line. |
890 | | - parser.values.use_pep517 = False |
891 | | - |
892 | | - |
893 | 856 | use_pep517: Any = partial( |
894 | 857 | Option, |
895 | 858 | "--use-pep517", |
896 | 859 | dest="use_pep517", |
897 | 860 | action="store_true", |
898 | | - default=None, |
899 | | - help="Use PEP 517 for building source distributions " |
900 | | - "(use --no-use-pep517 to force legacy behaviour).", |
901 | | -) |
902 | | - |
903 | | -no_use_pep517: Any = partial( |
904 | | - Option, |
905 | | - "--no-use-pep517", |
906 | | - dest="use_pep517", |
907 | | - action="callback", |
908 | | - callback=_handle_no_use_pep517, |
909 | | - default=None, |
| 861 | + default=True, |
910 | 862 | help=SUPPRESS_HELP, |
911 | 863 | ) |
912 | 864 |
|
@@ -939,30 +891,11 @@ def _handle_config_settings( |
939 | 891 | action="callback", |
940 | 892 | callback=_handle_config_settings, |
941 | 893 | metavar="settings", |
942 | | - help="Configuration settings to be passed to the PEP 517 build backend. " |
| 894 | + help="Configuration settings to be passed to the build backend. " |
943 | 895 | "Settings take the form KEY=VALUE. Use multiple --config-settings options " |
944 | 896 | "to pass multiple keys to the backend.", |
945 | 897 | ) |
946 | 898 |
|
947 | | -build_options: Callable[..., Option] = partial( |
948 | | - Option, |
949 | | - "--build-option", |
950 | | - dest="build_options", |
951 | | - metavar="options", |
952 | | - action="append", |
953 | | - help="Extra arguments to be supplied to 'setup.py bdist_wheel'.", |
954 | | -) |
955 | | - |
956 | | -global_options: Callable[..., Option] = partial( |
957 | | - Option, |
958 | | - "--global-option", |
959 | | - dest="global_options", |
960 | | - action="append", |
961 | | - metavar="options", |
962 | | - help="Extra global options to be supplied to the setup.py " |
963 | | - "call before the install or bdist_wheel command.", |
964 | | -) |
965 | | - |
966 | 899 | no_clean: Callable[..., Option] = partial( |
967 | 900 | Option, |
968 | 901 | "--no-clean", |
|
0 commit comments