make-win-release 1.2 KB

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