##// END OF EJS Templates
Disable demandloading in setup.py
Matt Mackall -
r3892:d6cc510d default
parent child Browse files
Show More
@@ -1,71 +1,73 b''
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2 #
2 #
3 # This is the mercurial setup script.
3 # This is the mercurial setup script.
4 #
4 #
5 # './setup.py install', or
5 # './setup.py install', or
6 # './setup.py --help' for more options
6 # './setup.py --help' for more options
7
7
8 import sys
8 import sys
9 if not hasattr(sys, 'version_info') or sys.version_info < (2, 3, 0, 'final'):
9 if not hasattr(sys, 'version_info') or sys.version_info < (2, 3, 0, 'final'):
10 raise SystemExit, "Mercurial requires python 2.3 or later."
10 raise SystemExit, "Mercurial requires python 2.3 or later."
11
11
12 import os
12 import os
13 from distutils.core import setup, Extension
13 from distutils.core import setup, Extension
14 from distutils.command.install_data import install_data
14 from distutils.command.install_data import install_data
15
15
16 import mercurial.version
16 import mercurial.version
17 import mercurial.demandimport
18 mercurial.demandimport.enable = lambda: None
17
19
18 # py2exe needs to be installed to work
20 # py2exe needs to be installed to work
19 try:
21 try:
20 import py2exe
22 import py2exe
21
23
22 # Help py2exe to find win32com.shell
24 # Help py2exe to find win32com.shell
23 try:
25 try:
24 import modulefinder
26 import modulefinder
25 import win32com
27 import win32com
26 for p in win32com.__path__[1:]: # Take the path to win32comext
28 for p in win32com.__path__[1:]: # Take the path to win32comext
27 modulefinder.AddPackagePath("win32com", p)
29 modulefinder.AddPackagePath("win32com", p)
28 pn = "win32com.shell"
30 pn = "win32com.shell"
29 __import__(pn)
31 __import__(pn)
30 m = sys.modules[pn]
32 m = sys.modules[pn]
31 for p in m.__path__[1:]:
33 for p in m.__path__[1:]:
32 modulefinder.AddPackagePath(pn, p)
34 modulefinder.AddPackagePath(pn, p)
33 except ImportError:
35 except ImportError:
34 pass
36 pass
35
37
36 except ImportError:
38 except ImportError:
37 pass
39 pass
38
40
39 # specify version string, otherwise 'hg identify' will be used:
41 # specify version string, otherwise 'hg identify' will be used:
40 version = ''
42 version = ''
41
43
42 class install_package_data(install_data):
44 class install_package_data(install_data):
43 def finalize_options(self):
45 def finalize_options(self):
44 self.set_undefined_options('install',
46 self.set_undefined_options('install',
45 ('install_lib', 'install_dir'))
47 ('install_lib', 'install_dir'))
46 install_data.finalize_options(self)
48 install_data.finalize_options(self)
47
49
48 mercurial.version.remember_version(version)
50 mercurial.version.remember_version(version)
49 cmdclass = {'install_data': install_package_data}
51 cmdclass = {'install_data': install_package_data}
50
52
51 setup(name='mercurial',
53 setup(name='mercurial',
52 version=mercurial.version.get_version(),
54 version=mercurial.version.get_version(),
53 author='Matt Mackall',
55 author='Matt Mackall',
54 author_email='mpm@selenic.com',
56 author_email='mpm@selenic.com',
55 url='http://selenic.com/mercurial',
57 url='http://selenic.com/mercurial',
56 description='Scalable distributed SCM',
58 description='Scalable distributed SCM',
57 license='GNU GPL',
59 license='GNU GPL',
58 packages=['mercurial', 'mercurial.hgweb', 'hgext'],
60 packages=['mercurial', 'mercurial.hgweb', 'hgext'],
59 ext_modules=[Extension('mercurial.mpatch', ['mercurial/mpatch.c']),
61 ext_modules=[Extension('mercurial.mpatch', ['mercurial/mpatch.c']),
60 Extension('mercurial.bdiff', ['mercurial/bdiff.c']),
62 Extension('mercurial.bdiff', ['mercurial/bdiff.c']),
61 Extension('mercurial.base85', ['mercurial/base85.c'])],
63 Extension('mercurial.base85', ['mercurial/base85.c'])],
62 data_files=[(os.path.join('mercurial', root),
64 data_files=[(os.path.join('mercurial', root),
63 [os.path.join(root, file_) for file_ in files])
65 [os.path.join(root, file_) for file_ in files])
64 for root, dirs, files in os.walk('templates')],
66 for root, dirs, files in os.walk('templates')],
65 cmdclass=cmdclass,
67 cmdclass=cmdclass,
66 scripts=['hg', 'hgmerge'],
68 scripts=['hg', 'hgmerge'],
67 options=dict(bdist_mpkg=dict(zipdist=True,
69 options=dict(bdist_mpkg=dict(zipdist=True,
68 license='COPYING',
70 license='COPYING',
69 readme='contrib/macosx/Readme.html',
71 readme='contrib/macosx/Readme.html',
70 welcome='contrib/macosx/Welcome.html')),
72 welcome='contrib/macosx/Welcome.html')),
71 console=['hg'])
73 console=['hg'])
General Comments 0
You need to be logged in to leave comments. Login now