@@ -957,23 +957,43 @@ def _build_one_inside_env(self, req, output_dir, python_tag=None):
957
957
self ._clean_one (req )
958
958
return None
959
959
960
- def _make_setuptools_bdist_wheel_args (self , req ):
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]
961
969
# NOTE: Eventually, we'd want to also -S to the flags here, when we're
962
970
# isolating. Currently, it breaks Python in virtualenvs, because it
963
971
# relies on site.py to find parts of the standard library outside the
964
972
# virtualenv.
965
- return make_setuptools_shim_args (
966
- req . setup_py_path ,
967
- global_options = self . global_options ,
973
+ args = make_setuptools_shim_args (
974
+ setup_py_path ,
975
+ global_options = global_options ,
968
976
unbuffered_output = True
969
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
970
983
971
- def _make_setuptools_clean_args (self , req ):
972
- return make_setuptools_shim_args (
973
- req .setup_py_path ,
974
- global_options = self .global_options ,
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 ,
975
993
unbuffered_output = True
976
994
)
995
+ args += ["clean" , "--all" ]
996
+ return args
977
997
978
998
def _build_one_pep517 (self , req , tempd , python_tag = None ):
979
999
"""Build one InstallRequirement using the PEP 517 build process.
@@ -1019,11 +1039,13 @@ def _build_one_legacy(self, req, tempd, python_tag=None):
1019
1039
1020
1040
Returns path to wheel if successfully built. Otherwise, returns None.
1021
1041
"""
1022
- wheel_args = self ._make_setuptools_bdist_wheel_args (req )
1023
- wheel_args += ['bdist_wheel' , '-d' , tempd ]
1024
- wheel_args += self .build_options
1025
- if python_tag is not None :
1026
- wheel_args += ["--python-tag" , python_tag ]
1042
+ wheel_args = self ._make_setuptools_bdist_wheel_args (
1043
+ req .setup_py_path ,
1044
+ global_options = self .global_options ,
1045
+ build_options = self .build_options ,
1046
+ destination_dir = tempd ,
1047
+ python_tag = python_tag ,
1048
+ )
1027
1049
1028
1050
spin_message = 'Building wheel for %s (setup.py)' % (req .name ,)
1029
1051
with open_spinner (spin_message ) as spinner :
@@ -1051,8 +1073,10 @@ def _build_one_legacy(self, req, tempd, python_tag=None):
1051
1073
return wheel_path
1052
1074
1053
1075
def _clean_one (self , req ):
1054
- clean_args = self ._make_setuptools_clean_args (req )
1055
- clean_args += ['clean' , '--all' ]
1076
+ clean_args = self ._make_setuptools_clean_args (
1077
+ req .setup_py_path ,
1078
+ global_options = self .global_options ,
1079
+ )
1056
1080
1057
1081
logger .info ('Running setup.py clean for %s' , req .name )
1058
1082
try :
0 commit comments