diff setup.py @ 2323:c58a403aa830

setup.py: install packagescan before any mercurial modules is imported Further the installation of packagescan over demandload is moved to the packagescan module. I added as well few more comments in the packagescan module to avoid the wrong use of package scan in the future. Reason: mercurial.packagescan acts as fake mercurial.demandload during a py2exe run. Unfortunatly the import of mercurial.version in setup.py is done before mercurial.packagescan is installed. This results in few imports without mercurial.packagescan in charge and therefore not all dependend modules are detected when running mercurial.packagescan.getmodules later e.g. winerror is missed.
author Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
date Fri, 19 May 2006 08:54:28 -0700
parents 7eb694a1c1af
children 7cbe8cd69d6b
line wrap: on
line diff
--- a/setup.py	Wed May 17 13:21:36 2006 -0500
+++ b/setup.py	Fri May 19 08:54:28 2006 -0700
@@ -13,6 +13,8 @@
 from distutils.core import setup, Extension
 from distutils.command.install_data import install_data
 
+# mercurial.packagescan must be the first mercurial module imported
+import mercurial.packagescan
 import mercurial.version
 
 # py2exe needs to be installed to work
@@ -36,7 +38,6 @@
     # Due to the use of demandload py2exe is not finding the modules.
     # packagescan.getmodules creates a list of modules included in
     # the mercurial package plus depdent modules.
-    import mercurial.packagescan
     from py2exe.build_exe import py2exe as build_exe
 
     class py2exe_for_demandload(build_exe):
@@ -54,10 +55,9 @@
                 self.includes = []
             else:
                 self.includes = self.includes.split(',')
-            self.includes += mercurial.packagescan.getmodules(self.build_lib,
-                                                              'mercurial')
-            self.includes += mercurial.packagescan.getmodules(self.build_lib,
-                                                              'hgext')
+            mercurial.packagescan.scan(self.build_lib,'mercurial')
+            mercurial.packagescan.scan(self.build_lib,'hgext')
+            self.includes += mercurial.packagescan.getmodules()
             build_exe.finalize_options(self)
 except ImportError:
     py2exe_for_demandload = None