From: robk-tahoe Date: Tue, 15 Jan 2008 23:59:41 +0000 (-0700) Subject: tweak py2exe setup.py to link in xmlplus iff present X-Git-Url: https://git.rkrishnan.org/pf/content/en/seg/...?a=commitdiff_plain;h=6c2944d4e119d534e1dc2d42cfaa90309344cca8;p=tahoe-lafs%2Ftahoe-lafs.git tweak py2exe setup.py to link in xmlplus iff present so in the build slave's environment, everything builds and runs fine without '_xmlplus'. In my existing local environment everything builds and runs only if I tell py2exe to explicitly link in '_xmlplus'. the _xmlplus module, tested for by the python standard library, comes from PyXML ( http://pyxml.sf.net ) a project which is no longer maintained and, for instance, hasn't released a build for windows past python 2.4 hence something about the way nevow and the std lib import xml dependencies causes build environment incompatabilities between my box (which is running py24 currently) and the buildslave (which is on py25, and doesn't have PyXML) (if I remove _xmlplus from my environment, then a different set of nevow/xml import problems emerge, which do not occur in the buildslave's py25 env) this change tests the environment the build is happening in, and if the _xmlplus package is importable, then py2exe is directed to link it into the build. otherwise the package is left out. as far as I comprehend the issue this should make both of these environments work. if other people have problems around this issue, obviously I'm interested in learning more. --- diff --git a/windows/setup.py b/windows/setup.py index 35cba7f4..df2f2930 100644 --- a/windows/setup.py +++ b/windows/setup.py @@ -29,6 +29,14 @@ manifestVersion="1.0"> """ +packages = ['encodings'] + +try: + import _xmlplus +except ImportError: + pass +else: + packages.append('_xmlplus') setup_args = { 'name': 'Tahoe', @@ -60,10 +68,7 @@ setup_args = { ], "includes": [ ], - "packages": [ - "encodings", - "_xmlplus", - ], + "packages": packages, #"optimize" : 2, }, },