-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrelease.py
More file actions
44 lines (40 loc) · 1.6 KB
/
release.py
File metadata and controls
44 lines (40 loc) · 1.6 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
"""
Script for creating all of the binaries that are released for the current
platform.
"""
import os
import sys
testMode = "--test" in sys.argv
oracleHomes = os.environ["CX_ORACLE_HOMES"].split(",")
pythonVersions = os.environ["CX_ORACLE_PYTHON_VERSIONS"].split(",")
pythonFormat = os.environ["CX_ORACLE_PYTHON_FORMAT"]
origPath = os.environ["PATH"]
for version in pythonVersions:
majorVersion, minorVersion = [int(s) for s in version.split(".")]
for oracleHome in oracleHomes:
if sys.platform == "win32":
os.environ["PATH"] = oracleHome + os.pathsep + origPath
else:
os.environ["ORACLE_HOME"] = oracleHome
python = pythonFormat % (majorVersion, minorVersion)
if testMode:
subCommand = "test"
subCommandArgs = ""
elif sys.platform == "win32":
subCommandArgs = ""
if majorVersion == 2 and minorVersion == 4:
subCommand = "bdist_wininst"
else:
subCommand = "bdist_msi"
else:
subCommand = "bdist_rpm"
subCommandArgs = "--no-autoreq --python %s" % python
command = "%s setup.py %s %s" % \
(python, subCommand, subCommandArgs)
messageFragment = "%s for Python %s.%s in home %s" % \
(subCommand, majorVersion, minorVersion, oracleHome)
sys.stdout.write("Executing %s.\n" % messageFragment)
sys.stdout.write("Running command %s\n" % command)
if os.system(command) != 0:
msg = "Stopping. execution of %s failed.\n" % messageFragment
sys.exit(msg)