|
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
|
@@ -161,8 +160,7 @@ class PipOption(Option):
|
161 | 160 | action="store_true",
|
162 | 161 | default=False,
|
163 | 162 | help=(
|
164 |
| - "Allow pip to only run in a virtual environment; " |
165 |
| - "exit with an error otherwise." |
| 163 | + "Allow pip to only run in a virtual environment; exit with an error otherwise." |
166 | 164 | ),
|
167 | 165 | )
|
168 | 166 |
|
@@ -813,62 +811,16 @@ def _handle_dependency_group(
|
813 | 811 | dest="check_build_deps",
|
814 | 812 | action="store_true",
|
815 | 813 | default=False,
|
816 |
| - help="Check the build dependencies when PEP517 is used.", |
| 814 | + help="Check the build dependencies.", |
817 | 815 | )
|
818 | 816 |
|
819 | 817 |
|
820 |
| -def _handle_no_use_pep517( |
821 |
| - option: Option, opt: str, value: str, parser: OptionParser |
822 |
| -) -> None: |
823 |
| - """ |
824 |
| - Process a value provided for the --no-use-pep517 option. |
825 |
| -
|
826 |
| - This is an optparse.Option callback for the no_use_pep517 option. |
827 |
| - """ |
828 |
| - # Since --no-use-pep517 doesn't accept arguments, the value argument |
829 |
| - # will be None if --no-use-pep517 is passed via the command-line. |
830 |
| - # However, the value can be non-None if the option is triggered e.g. |
831 |
| - # by an environment variable, for example "PIP_NO_USE_PEP517=true". |
832 |
| - if value is not None: |
833 |
| - msg = """A value was passed for --no-use-pep517, |
834 |
| - probably using either the PIP_NO_USE_PEP517 environment variable |
835 |
| - or the "no-use-pep517" config file option. Use an appropriate value |
836 |
| - of the PIP_USE_PEP517 environment variable or the "use-pep517" |
837 |
| - config file option instead. |
838 |
| - """ |
839 |
| - raise_option_error(parser, option=option, msg=msg) |
840 |
| - |
841 |
| - # If user doesn't wish to use pep517, we check if setuptools is installed |
842 |
| - # and raise error if it is not. |
843 |
| - packages = ("setuptools",) |
844 |
| - if not all(importlib.util.find_spec(package) for package in packages): |
845 |
| - msg = ( |
846 |
| - f"It is not possible to use --no-use-pep517 " |
847 |
| - f"without {' and '.join(packages)} installed." |
848 |
| - ) |
849 |
| - raise_option_error(parser, option=option, msg=msg) |
850 |
| - |
851 |
| - # Otherwise, --no-use-pep517 was passed via the command-line. |
852 |
| - parser.values.use_pep517 = False |
853 |
| - |
854 |
| - |
855 | 818 | use_pep517: Any = partial(
|
856 | 819 | Option,
|
857 | 820 | "--use-pep517",
|
858 | 821 | dest="use_pep517",
|
859 | 822 | action="store_true",
|
860 |
| - default=None, |
861 |
| - help="Use PEP 517 for building source distributions " |
862 |
| - "(use --no-use-pep517 to force legacy behaviour).", |
863 |
| -) |
864 |
| - |
865 |
| -no_use_pep517: Any = partial( |
866 |
| - Option, |
867 |
| - "--no-use-pep517", |
868 |
| - dest="use_pep517", |
869 |
| - action="callback", |
870 |
| - callback=_handle_no_use_pep517, |
871 |
| - default=None, |
| 823 | + default=True, |
872 | 824 | help=SUPPRESS_HELP,
|
873 | 825 | )
|
874 | 826 |
|
@@ -901,30 +853,11 @@ def _handle_config_settings(
|
901 | 853 | action="callback",
|
902 | 854 | callback=_handle_config_settings,
|
903 | 855 | metavar="settings",
|
904 |
| - help="Configuration settings to be passed to the PEP 517 build backend. " |
| 856 | + help="Configuration settings to be passed to the build backend. " |
905 | 857 | "Settings take the form KEY=VALUE. Use multiple --config-settings options "
|
906 | 858 | "to pass multiple keys to the backend.",
|
907 | 859 | )
|
908 | 860 |
|
909 |
| -build_options: Callable[..., Option] = partial( |
910 |
| - Option, |
911 |
| - "--build-option", |
912 |
| - dest="build_options", |
913 |
| - metavar="options", |
914 |
| - action="append", |
915 |
| - help="Extra arguments to be supplied to 'setup.py bdist_wheel'.", |
916 |
| -) |
917 |
| - |
918 |
| -global_options: Callable[..., Option] = partial( |
919 |
| - Option, |
920 |
| - "--global-option", |
921 |
| - dest="global_options", |
922 |
| - action="append", |
923 |
| - metavar="options", |
924 |
| - help="Extra global options to be supplied to the setup.py " |
925 |
| - "call before the install or bdist_wheel command.", |
926 |
| -) |
927 |
| - |
928 | 861 | no_clean: Callable[..., Option] = partial(
|
929 | 862 | Option,
|
930 | 863 | "--no-clean",
|
|
0 commit comments