1
1
from __future__ import print_function
2
- import os , tempfile , subprocess , sys
2
+ import os , tempfile , subprocess , sys , re
3
3
try :
4
4
from urllib2 import urlopen
5
5
except ImportError :
@@ -17,11 +17,11 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be
17
17
request = urlopen ('https://github.com/ogrisel/python-appveyor-demo/raw/09a1c8672e5015a74d8f69d07add6ee803c176ec/appveyor/run_with_env.cmd' )
18
18
f .write (request .read ())
19
19
20
- def shell (args , env = None , cwd = None ):
20
+ def shell (args , env = None , cwd = None , ** kwargs ):
21
21
# print the command executing for the logs
22
22
print ('+ ' + ' ' .join (args ))
23
23
args = ['cmd' , '/E:ON' , '/V:ON' , '/C' , run_with_env ] + args
24
- return subprocess .check_call (' ' .join (args ), env = env , cwd = cwd )
24
+ return subprocess .check_output (' ' .join (args ), env = env , cwd = cwd , ** kwargs )
25
25
26
26
PythonConfiguration = namedtuple ('PythonConfiguration' , ['version' , 'arch' , 'identifier' , 'path' ])
27
27
python_configurations = [
@@ -69,8 +69,14 @@ def shell(args, env=None, cwd=None):
69
69
# build the wheel
70
70
shell (['pip' , 'wheel' , project_dir , '-w' , output_dir , '--no-deps' ], env = env )
71
71
72
+ # Grab the built wheel for this platform
73
+ # Note: filter wheels *must* be run from inside the build environment
74
+ filter_wheels = os .path .join (os .path .dirname (__file__ ), 'filter_wheels.py' )
75
+ stdout = shell (['python' , filter_wheels , output_dir + '\*.whl' ], env = env , universal_newlines = True )
76
+ wheels = re .findall (r"^%s\\.*\.whl$" % output_dir , stdout , re .MULTILINE )
77
+
72
78
# install the wheel
73
- shell (['pip' , 'install' , package_name , '--no-index' , '-f' , output_dir ] , env = env )
79
+ shell (['pip' , 'install' ] + wheels , env = env )
74
80
75
81
# test the wheel
76
82
if test_requires :
0 commit comments