1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
#! /usr/bin/env python
import sys, os, subprocess, re
common_dist = ("bdist_wheel", "bdist_egg", "test")
pyver2dist = {
"Python26": common_dist,
"Python26x64": common_dist,
"Python27": common_dist,
"Python27x64": common_dist,
"Python33": common_dist,
"Python33x64": common_dist,
"Python34": common_dist,
"Python34x64": common_dist,
"Python35": common_dist,
"Python35x64": common_dist,
}
def system(cmd):
sys.stdout.write("====> Running %s\n" % cmd)
popen = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
nl = True
while 1:
char = popen.stdout.read(1)
if not char:
break
if nl:
sys.stdout.write(" ")
sys.stdout.write(char)
sys.stdout.flush()
nl = char == "\n"
st = popen.wait()
if st != 0:
sys.exit("Error: command %r failed" % cmd)
sys.stdout.write("\n")
def main():
here = os.path.dirname(os.path.dirname(sys.executable))
for pyver, dists in sorted(pyver2dist.items()):
exe = os.path.join(here, pyver, "python.exe")
for d in dists:
cmd = "%s setup.py -q %s" % (exe, d)
system(cmd)
if __name__ == "__main__":
main()
|