##// END OF EJS Templates
setup.py not executable: change instructions at beginning of file
Christian Ebert -
r4816:c10d3bc0 default
parent child Browse files
Show More
@@ -1,78 +1,78
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 # 'python setup.py install', or
6 # './setup.py --help' for more options
6 # 'python 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
17 import mercurial.demandimport
18 mercurial.demandimport.enable = lambda: None
18 mercurial.demandimport.enable = lambda: None
19
19
20 extra = {}
20 extra = {}
21
21
22 # py2exe needs to be installed to work
22 # py2exe needs to be installed to work
23 try:
23 try:
24 import py2exe
24 import py2exe
25
25
26 # Help py2exe to find win32com.shell
26 # Help py2exe to find win32com.shell
27 try:
27 try:
28 import modulefinder
28 import modulefinder
29 import win32com
29 import win32com
30 for p in win32com.__path__[1:]: # Take the path to win32comext
30 for p in win32com.__path__[1:]: # Take the path to win32comext
31 modulefinder.AddPackagePath("win32com", p)
31 modulefinder.AddPackagePath("win32com", p)
32 pn = "win32com.shell"
32 pn = "win32com.shell"
33 __import__(pn)
33 __import__(pn)
34 m = sys.modules[pn]
34 m = sys.modules[pn]
35 for p in m.__path__[1:]:
35 for p in m.__path__[1:]:
36 modulefinder.AddPackagePath(pn, p)
36 modulefinder.AddPackagePath(pn, p)
37 except ImportError:
37 except ImportError:
38 pass
38 pass
39
39
40 extra['console'] = ['hg']
40 extra['console'] = ['hg']
41
41
42 except ImportError:
42 except ImportError:
43 pass
43 pass
44
44
45 # specify version string, otherwise 'hg identify' will be used:
45 # specify version string, otherwise 'hg identify' will be used:
46 version = ''
46 version = ''
47
47
48 class install_package_data(install_data):
48 class install_package_data(install_data):
49 def finalize_options(self):
49 def finalize_options(self):
50 self.set_undefined_options('install',
50 self.set_undefined_options('install',
51 ('install_lib', 'install_dir'))
51 ('install_lib', 'install_dir'))
52 install_data.finalize_options(self)
52 install_data.finalize_options(self)
53
53
54 mercurial.version.remember_version(version)
54 mercurial.version.remember_version(version)
55 cmdclass = {'install_data': install_package_data}
55 cmdclass = {'install_data': install_package_data}
56
56
57 setup(name='mercurial',
57 setup(name='mercurial',
58 version=mercurial.version.get_version(),
58 version=mercurial.version.get_version(),
59 author='Matt Mackall',
59 author='Matt Mackall',
60 author_email='mpm@selenic.com',
60 author_email='mpm@selenic.com',
61 url='http://selenic.com/mercurial',
61 url='http://selenic.com/mercurial',
62 description='Scalable distributed SCM',
62 description='Scalable distributed SCM',
63 license='GNU GPL',
63 license='GNU GPL',
64 packages=['mercurial', 'mercurial.hgweb', 'hgext', 'hgext.convert'],
64 packages=['mercurial', 'mercurial.hgweb', 'hgext', 'hgext.convert'],
65 ext_modules=[Extension('mercurial.mpatch', ['mercurial/mpatch.c']),
65 ext_modules=[Extension('mercurial.mpatch', ['mercurial/mpatch.c']),
66 Extension('mercurial.bdiff', ['mercurial/bdiff.c']),
66 Extension('mercurial.bdiff', ['mercurial/bdiff.c']),
67 Extension('mercurial.base85', ['mercurial/base85.c'])],
67 Extension('mercurial.base85', ['mercurial/base85.c'])],
68 data_files=[(os.path.join('mercurial', root),
68 data_files=[(os.path.join('mercurial', root),
69 [os.path.join(root, file_) for file_ in files])
69 [os.path.join(root, file_) for file_ in files])
70 for root, dirs, files in os.walk('templates')],
70 for root, dirs, files in os.walk('templates')],
71 cmdclass=cmdclass,
71 cmdclass=cmdclass,
72 scripts=['hg', 'hgmerge'],
72 scripts=['hg', 'hgmerge'],
73 options=dict(py2exe=dict(packages=['hgext']),
73 options=dict(py2exe=dict(packages=['hgext']),
74 bdist_mpkg=dict(zipdist=True,
74 bdist_mpkg=dict(zipdist=True,
75 license='COPYING',
75 license='COPYING',
76 readme='contrib/macosx/Readme.html',
76 readme='contrib/macosx/Readme.html',
77 welcome='contrib/macosx/Welcome.html')),
77 welcome='contrib/macosx/Welcome.html')),
78 **extra)
78 **extra)
General Comments 0
You need to be logged in to leave comments. Login now