forked from python-greenlet/greenlet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake-win-release
More file actions
executable file
·70 lines (56 loc) · 1.62 KB
/
Copy pathmake-win-release
File metadata and controls
executable file
·70 lines (56 loc) · 1.62 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#! /usr/bin/env python
import sys, os, subprocess
def bits():
"""determine if running on a 32 bit or 64 bit platform
just looking at sys.maxint isn't enough
x64 windows has sys.maxint == (1<<31) - 1
"""
if sys.version_info[:2] < (2, 5):
if sys.maxint == 2147483647: # (1 << 31) - 1
return 32
else:
return 64
class X(object):
def __len__(self):
return 1 << 31
try:
len(X())
return 64
except OverflowError:
return 32
if bits() == 32:
pyversions = "24 25 26 27 30 31 32"
else:
pyversions = "27 30 31 32"
executables = [(x, "C:\\Python%s\\python.exe" % x) for x in pyversions.split()]
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():
upload = ""
if sys.argv[1:] == ["upload"]:
upload = "upload"
for v, x in executables:
if not os.path.exists(x):
continue
for dist in ["bdist_egg", "bdist_wininst"]:
if (v, dist) == ("24", "bdist_msi"):
continue
cmd = "%s setup.py -q %s %s" % (x, dist, upload)
system(cmd)
if __name__ == "__main__":
main()