@@ -662,14 +662,14 @@ def __init__(self, requirement_set, finder, build_options=None,
662
662
self .build_options = build_options or []
663
663
self .global_options = global_options or []
664
664
665
- def _build_one (self , req , output_dir ):
665
+ def _build_one (self , req , output_dir , python_tag = None ):
666
666
"""Build one wheel.
667
667
668
668
:return: The filename of the built wheel, or None if the build failed.
669
669
"""
670
670
tempd = tempfile .mkdtemp ('pip-wheel-' )
671
671
try :
672
- if self .__build_one (req , tempd ):
672
+ if self .__build_one (req , tempd , python_tag = python_tag ):
673
673
try :
674
674
wheel_name = os .listdir (tempd )[0 ]
675
675
wheel_path = os .path .join (output_dir , wheel_name )
@@ -692,13 +692,17 @@ def _base_setup_args(self, req):
692
692
"__file__, 'exec'))" % req .setup_py
693
693
] + list (self .global_options )
694
694
695
- def __build_one (self , req , tempd ):
695
+ def __build_one (self , req , tempd , python_tag = None ):
696
696
base_args = self ._base_setup_args (req )
697
697
698
698
logger .info ('Running setup.py bdist_wheel for %s' , req .name )
699
699
logger .debug ('Destination directory: %s' , tempd )
700
700
wheel_args = base_args + ['bdist_wheel' , '-d' , tempd ] \
701
701
+ self .build_options
702
+
703
+ if python_tag is not None :
704
+ wheel_args += ["--python-tag" , python_tag ]
705
+
702
706
try :
703
707
call_subprocess (wheel_args , cwd = req .source_dir , show_stdout = False )
704
708
return True
@@ -776,7 +780,9 @@ def build(self, autobuilding=False):
776
780
with indent_log ():
777
781
build_success , build_failure = [], []
778
782
for req in buildset :
783
+ python_tag = None
779
784
if autobuilding :
785
+ python_tag = pep425tags .implementation_tag
780
786
output_dir = _cache_for_link (self ._cache_root , req .link )
781
787
try :
782
788
ensure_dir (output_dir )
@@ -787,7 +793,10 @@ def build(self, autobuilding=False):
787
793
continue
788
794
else :
789
795
output_dir = self ._wheel_dir
790
- wheel_file = self ._build_one (req , output_dir )
796
+ wheel_file = self ._build_one (
797
+ req , output_dir ,
798
+ python_tag = python_tag ,
799
+ )
791
800
if wheel_file :
792
801
build_success .append (req )
793
802
if autobuilding :
0 commit comments