]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
tweak py2exe setup.py to link in xmlplus iff present
authorrobk-tahoe <robk-tahoe@allmydata.com>
Tue, 15 Jan 2008 23:59:41 +0000 (16:59 -0700)
committerrobk-tahoe <robk-tahoe@allmydata.com>
Tue, 15 Jan 2008 23:59:41 +0000 (16:59 -0700)
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.

windows/setup.py

index 35cba7f4986494f3175d984feeca1df9a14a3281..df2f293040bb2d465878b4fbd207add74b74abdf 100644 (file)
@@ -29,6 +29,14 @@ manifestVersion="1.0">
 </assembly>
 """
 
+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,
         },
     },