Created
July 1, 2016 15:36
-
-
Save asottile/79958893d1f2db13bc42d3f74f84aef3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pipes | |
import subprocess | |
pythons = ( | |
'Python27', | |
'Python27_x86', | |
'Python34', | |
'Python34_x86', | |
'Python35', | |
'Python35_x86', | |
) | |
def printit(func, *cmd): | |
print('$ ' + ' '.join(pipes.quote(x) for x in cmd)) | |
func(cmd) | |
def install_pip(venv_pip, version): | |
# pip install pip always errors on windows, ignore the error it actually worked | |
printit(subprocess.call, pip, 'install', version, '--upgrade') | |
for python in pythons: | |
venv = 'venv' + python | |
pip = venv + '/Scripts/pip.exe' | |
printit(subprocess.check_call, 'rm', '-rf', venv) | |
printit( | |
subprocess.check_call, | |
'C:/Python27/Scripts/virtualenv', | |
venv, | |
'-p', 'C:/{}/python.exe'.format(python), | |
) | |
# Build old-style wheels (they'll look like cp27-none-....whl) | |
install_pip(pip, 'pip<8') | |
printit(subprocess.call, pip, 'install', 'wheel==0.26') | |
printit(subprocess.check_call, pip, 'wheel', 'pyterminalsize', '-w', '.') | |
# Build new-style wheels | |
install_pip(pip, 'pip') | |
printit(subprocess.call, pip, 'install', 'wheel', '--upgrade') | |
printit(subprocess.check_call, pip, 'wheel', 'pyterminalsize', '-w', '.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment