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