[PyObjC-svn] r2541 - in trunk/pyobjc/build-support: . templates
[email protected] Sun, 18 Jul 2010 04:28:50 -0500
| Newsgroups | gmane.comp.python.pyobjc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: ronaldoussoren
Date: Sun Jul 18 04:28:48 2010
New Revision: 2541
Log:
Some small fixes to the test/build support code
Modified:
trunk/pyobjc/build-support/build_frameworks.py
trunk/pyobjc/build-support/run_tests.py
trunk/pyobjc/build-support/set-version.py
trunk/pyobjc/build-support/templates/index.html
Modified: trunk/pyobjc/build-support/build_frameworks.py
==============================================================================
--- trunk/pyobjc/build-support/build_frameworks.py (original)
+++ trunk/pyobjc/build-support/build_frameworks.py Sun Jul 18 04:28:48 2010
@@ -34,11 +34,23 @@
# Name of the Python framework and any additional arguments
# passed to the configure command.
-gFrameworkNameTemplate="DbgPython-{archs}"
-gExtraConfigureArgs=[
- "--with-pydebug",
+gFlavours = [
+ dict(
+ name="debug",
+ template="DbgPython-{archs}",
+ flags=[
+ "--with-pydebug",
+ ],
+ ),
+# dict(
+# name="release",
+# template="ReleasePython-{archs}",
+# flags=[
+# ],
+# ),
]
+
# Location of the SVN branches to be used
gURLMap = {
'2.6': 'http://svn.python.org/projects/python/branches/release26-maint',
@@ -100,7 +112,7 @@
lg.warn("Checkout for %s failed", version)
raise ShellError(xit)
-def build_framework(version, archs):
+def build_framework(flavour, version, archs):
"""
Build the given version of Python in the given architecture
variant.
@@ -109,7 +121,7 @@
a local copy of the package).
"""
lg = logging.getLogger("build_framework")
- lg.info("Build framework version=%r archs=%r", version, archs)
+ lg.info("Build %s framework version=%r archs=%r", flavour["name"], version, archs)
builddir = os.path.join(gBaseDir, "checkouts", version, "build")
if os.path.exists(builddir):
@@ -123,10 +135,10 @@
p = subprocess.Popen([
"../configure",
"--enable-framework",
- "--with-framework-name={0}".format(gFrameworkNameTemplate.format(version=version, archs=archs)),
+ "--with-framework-name={0}".format(flavour["template"].format(version=version, archs=archs)),
"--enable-universalsdk={0}".format(gSdkMap[archs]),
"--with-universal-archs={0}".format(archs),
- ] + gExtraConfigureArgs + [
+ ] + flavour["flags"] + [
"MACOSX_DEPLOYMENT_TARGET={0}".format(gDeploymentTargetMap[archs]),
], cwd=builddir)
@@ -156,7 +168,7 @@
lg.debug("Install failed for %r", version)
raise ShellError(xit)
-def install_distribute(version, archs):
+def install_distribute(flavour, version, archs):
lg = logging.getLogger("install_distribute")
lg.debug("Installing distribute")
@@ -166,7 +178,7 @@
lg.debug("Remove existing 'build' subdir")
shutil.rmtree(builddir)
- frameworkName=gFrameworkNameTemplate.format(archs=archs, version=version)
+ frameworkName=flavour["template"].format(archs=archs, version=version)
python = "/Library/Frameworks/{0}.framework/Versions/{1}/bin/python".format(
frameworkName, version)
@@ -184,12 +196,12 @@
raise ShellError(xit)
-def install_virtualenv(version, archs):
+def install_virtualenv(flavour, version, archs):
lg = logging.getLogger("install_virtualenv")
lg.info("Installing virtualenv from local source")
- frameworkName=gFrameworkNameTemplate.format(archs=archs, version=version)
+ frameworkName=flavour["template"].format(archs=archs, version=version)
python = "/Library/Frameworks/{0}.framework/Versions/{1}/bin/python".format(
frameworkName, version)
@@ -269,14 +281,21 @@
for version in sorted(versions):
create_checkout(version)
- for arch in sorted(archs):
- lg.info('Building framework for python %s (%s)', version, arch)
- build_framework(version, arch)
- lg.info('Installing distribute for python %s (%s)', version, arch)
- install_distribute(version, arch)
- lg.info('Installing virtualenv for python %s (%s)', version, arch)
- install_virtualenv(version, arch)
- lg.info('Done python %s (%s)', version, arch)
+ for flavour in gFlavours:
+ for arch in sorted(archs):
+ try:
+ lg.info('Building %s framework for python %s (%s)', flavour["name"], version, arch)
+ build_framework(flavour, version, arch)
+ lg.info('Installing distribute for python %s (%s)', version, arch)
+ install_distribute(flavour, version, arch)
+ lg.info('Installing virtualenv for python %s (%s)', version, arch)
+ install_virtualenv(flavour, version, arch)
+ lg.info('Done %s python %s (%s)', flavour["name"], version, arch)
+ except Exception as exc:
+ lg.warning("building %s for pyton %s (%s) failed: %s",
+ flavour["name"], version, arch, exc)
+ import traceback
+ traceback.print_exc()
except ShellError:
sys.exit(1)
Modified: trunk/pyobjc/build-support/run_tests.py
==============================================================================
--- trunk/pyobjc/build-support/run_tests.py (original)
+++ trunk/pyobjc/build-support/run_tests.py Sun Jul 18 04:28:48 2010
@@ -42,7 +42,7 @@
gUsage = """\
run_tests.py [-a archs] [--archs=archs] [-v versions] [--versions,versions]
-archs: 32-bit,3-way,intel (values separated by commas)
+archs: 32-bit,3-way (values separated by commas)
versions: 2.6,2.7,3.1,3.2 (values seperated by commas)
"""
@@ -52,11 +52,8 @@
gFrameworkNameTemplate="DbgPython-{archs}"
-gVersions=["2.6", "2.7", "3.1", "3.2"]
-gArchs=["32-bit", "3-way", "intel"]
-
-gVersions=["3.2", "2.7"]
-gArchs=["3-way"]
+gVersions=["3.2", "2.7", "3.1", "2.6"]
+gArchs=["32-bit", "3-way"]
gArchMap={
'3-way': ['ppc', 'i386', 'x86_64'],
@@ -64,12 +61,6 @@
'intel': ['i386', 'x86_64'],
}
-# XXX: Temporary workaround for structure of
-# my local work environment.
-gPyObjCCore="pyobjc-core"
-if os.path.exists(os.path.join(gRootDir, "pyobjc-core-py3k")):
- gPyObjCCore="pyobjc-core-py3k"
-
def supports_arch_command(version):
@@ -217,6 +208,9 @@
if version[0] == '3':
base_python += '3'
+ if os.path.exists(base_python + "-all"):
+ base_python = base_python + "-all"
+
lg.debug("Interpreter: %s", base_python)
if not os.path.exists(base_python):
@@ -246,7 +240,7 @@
lg.debug("Install base packages")
- if sys.version_info[0] == 3:
+ if version[0] == '3':
python = os.path.join(subdir, "bin", "python3")
else:
python = os.path.join(subdir, "bin", "python")
@@ -257,10 +251,7 @@
if not os.path.exists(os.path.join(resultdir, pkg)):
os.makedirs(os.path.join(resultdir, pkg))
- if pkg == "pyobjc-core":
- pkgroot = os.path.join(gRootDir, gPyObjCCore)
- else:
- pkgroot = os.path.join(gRootDir, pkg)
+ pkgroot = os.path.join(gRootDir, pkg)
pkgbuild = os.path.join(pkgroot, "build")
if os.path.exists(pkgbuild):
lg.debug("Remove build directory for %s", pkg)
@@ -286,10 +277,7 @@
if not os.path.exists(os.path.join(resultdir, pkg)):
os.makedirs(os.path.join(resultdir, pkg))
- if pkg == "pyobjc-core":
- pkgroot = os.path.join(gRootDir, gPyObjCCore)
- else:
- pkgroot = os.path.join(gRootDir, pkg)
+ pkgroot = os.path.join(gRootDir, pkg)
if pkg == "pyobjc-framework-InterfaceBuilderKit":
env = os.environ.copy()
@@ -347,6 +335,9 @@
xit = p.wait()
if xit != 0:
lg.warning("Test %s failed", pkg)
+
+ with open(os.path.join(resultdir, pkg, "test-stdout-{0}.exit".format(a)), "w") as fd:
+ fd.write(str(xit))
else:
lg.debug("Test %s for %s", pkg, os.path.basename(subdir))
@@ -556,6 +547,7 @@
for fn in os.listdir(moddir):
if not fn.startswith('test'): continue
+ if fn.endswith('exit'): continue
if fn == 'test-stdout.txt':
a = 'all'
@@ -566,12 +558,19 @@
info['archs'].append(a)
info[a] = parse_tests(os.path.join(moddir, fn))
+ with open (os.path.join(moddir, fn)[:-3] + 'exit') as fd:
+ info[a]['exit'] = fd.read().strip()
+
+
if info[a]['test_fail'] and (info['class'] is None):
info['class'] = 'warning'
if info[a]['test_error']:
info['class'] = 'error'
+ if info[a]['exit'] != 0:
+ info['class'] = 'crash'
+
if info['class'] is None:
info['class'] = 'ok'
Modified: trunk/pyobjc/build-support/set-version.py
==============================================================================
--- trunk/pyobjc/build-support/set-version.py (original)
+++ trunk/pyobjc/build-support/set-version.py Sun Jul 18 04:28:48 2010
@@ -11,7 +11,7 @@
"""
import os, sys, re
-DRYRUN=True
+DRYRUN=False
topdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -58,7 +58,7 @@
print ("Updating '%s'"%(subdir,))
fn = os.path.join(topdir, subdir, "setup.py")
r = re.compile('^\s*version=.*$', re.MULTILINE)
- data = r.sub(' version="%s"'%(VERSION,), load_file(fn))
+ data = r.sub(' version="%s",'%(VERSION,), load_file(fn))
r = re.compile('^\s*\'pyobjc-core>=.*$', re.MULTILINE)
data = r.sub(' \'pyobjc-core>=%s\','%(VERSION,), data)
Modified: trunk/pyobjc/build-support/templates/index.html
==============================================================================
--- trunk/pyobjc/build-support/templates/index.html (original)
+++ trunk/pyobjc/build-support/templates/index.html Sun Jul 18 04:28:48 2010
@@ -53,6 +53,10 @@
table#summary td.error {
background-color: red;
}
+ table#summary td.crash {
+ background-color: red;
+ text-decoration: underline;
+ }
</style>
</head>
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first