Skip to content

Instantly share code, notes, and snippets.

@asottile
Created July 1, 2016 15:36
Show Gist options
  • Save asottile/79958893d1f2db13bc42d3f74f84aef3 to your computer and use it in GitHub Desktop.
Save asottile/79958893d1f2db13bc42d3f74f84aef3 to your computer and use it in GitHub Desktop.
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