|
39 | 39 | from pip._internal.utils.logging import indent_log
|
40 | 40 | from pip._internal.utils.marker_files import has_delete_marker_file
|
41 | 41 | from pip._internal.utils.misc import captured_stdout, ensure_dir, read_chunks
|
42 |
| -from pip._internal.utils.setuptools_build import make_setuptools_shim_args |
| 42 | +from pip._internal.utils.setuptools_build import ( |
| 43 | + make_setuptools_bdist_wheel_args, |
| 44 | + make_setuptools_clean_args, |
| 45 | +) |
43 | 46 | from pip._internal.utils.subprocess import (
|
44 | 47 | LOG_DIVIDER,
|
45 | 48 | call_subprocess,
|
@@ -957,44 +960,6 @@ def _build_one_inside_env(self, req, output_dir, python_tag=None):
|
957 | 960 | self._clean_one(req)
|
958 | 961 | return None
|
959 | 962 |
|
960 |
| - def _make_setuptools_bdist_wheel_args( |
961 |
| - self, |
962 |
| - setup_py_path, # type: str |
963 |
| - global_options, # type: Sequence[str] |
964 |
| - build_options, # type: Sequence[str] |
965 |
| - destination_dir, # type: str |
966 |
| - python_tag, # type: Optional[str] |
967 |
| - ): |
968 |
| - # type: (...) -> List[str] |
969 |
| - # NOTE: Eventually, we'd want to also -S to the flags here, when we're |
970 |
| - # isolating. Currently, it breaks Python in virtualenvs, because it |
971 |
| - # relies on site.py to find parts of the standard library outside the |
972 |
| - # virtualenv. |
973 |
| - args = make_setuptools_shim_args( |
974 |
| - setup_py_path, |
975 |
| - global_options=global_options, |
976 |
| - unbuffered_output=True |
977 |
| - ) |
978 |
| - args += ["bdist_wheel", "-d", destination_dir] |
979 |
| - args += build_options |
980 |
| - if python_tag is not None: |
981 |
| - args += ["--python-tag", python_tag] |
982 |
| - return args |
983 |
| - |
984 |
| - def _make_setuptools_clean_args( |
985 |
| - self, |
986 |
| - setup_py_path, # type: str |
987 |
| - global_options, # type: Sequence[str] |
988 |
| - ): |
989 |
| - # type: (...) -> List[str] |
990 |
| - args = make_setuptools_shim_args( |
991 |
| - setup_py_path, |
992 |
| - global_options=global_options, |
993 |
| - unbuffered_output=True |
994 |
| - ) |
995 |
| - args += ["clean", "--all"] |
996 |
| - return args |
997 |
| - |
998 | 963 | def _build_one_pep517(self, req, tempd, python_tag=None):
|
999 | 964 | """Build one InstallRequirement using the PEP 517 build process.
|
1000 | 965 |
|
@@ -1039,7 +1004,7 @@ def _build_one_legacy(self, req, tempd, python_tag=None):
|
1039 | 1004 |
|
1040 | 1005 | Returns path to wheel if successfully built. Otherwise, returns None.
|
1041 | 1006 | """
|
1042 |
| - wheel_args = self._make_setuptools_bdist_wheel_args( |
| 1007 | + wheel_args = make_setuptools_bdist_wheel_args( |
1043 | 1008 | req.setup_py_path,
|
1044 | 1009 | global_options=self.global_options,
|
1045 | 1010 | build_options=self.build_options,
|
@@ -1073,7 +1038,7 @@ def _build_one_legacy(self, req, tempd, python_tag=None):
|
1073 | 1038 | return wheel_path
|
1074 | 1039 |
|
1075 | 1040 | def _clean_one(self, req):
|
1076 |
| - clean_args = self._make_setuptools_clean_args( |
| 1041 | + clean_args = make_setuptools_clean_args( |
1077 | 1042 | req.setup_py_path,
|
1078 | 1043 | global_options=self.global_options,
|
1079 | 1044 | )
|
|
0 commit comments