##// END OF EJS Templates
Don't forget version at the end of setup.py, write it only if changed....
Thomas Arendsen Hein -
r1977:7eb694a1 default
parent child Browse files
Show More
@@ -28,8 +28,15 b' def get_version():'
28
28
29 def write_version(version):
29 def write_version(version):
30 """Overwrite version file."""
30 """Overwrite version file."""
31 filename = os.path.join(os.path.dirname(__file__), '__version__.py')
31 if version == get_version():
32 f = open(filename, 'w')
32 return
33 directory = os.path.dirname(__file__)
34 for suffix in ['py', 'pyc', 'pyo']:
35 try:
36 os.unlink(os.path.join(directory, '__version__.%s' % suffix))
37 except OSError:
38 pass
39 f = open(os.path.join(directory, '__version__.py'), 'w')
33 f.write("# This file is auto-generated.\n")
40 f.write("# This file is auto-generated.\n")
34 f.write("version = %r\n" % version)
41 f.write("version = %r\n" % version)
35 f.close()
42 f.close()
@@ -72,35 +72,32 b' class install_package_data(install_data)'
72 ('install_lib', 'install_dir'))
72 ('install_lib', 'install_dir'))
73 install_data.finalize_options(self)
73 install_data.finalize_options(self)
74
74
75 try:
75 mercurial.version.remember_version(version)
76 mercurial.version.remember_version(version)
76 cmdclass = {'install_data': install_package_data}
77 cmdclass = {'install_data': install_package_data}
77 py2exe_opts = {}
78 py2exe_opts = {}
78 if py2exe_for_demandload is not None:
79 if py2exe_for_demandload is not None:
79 cmdclass['py2exe'] = py2exe_for_demandload
80 cmdclass['py2exe'] = py2exe_for_demandload
80 py2exe_opts['console'] = ['hg']
81 py2exe_opts['console'] = ['hg']
81 setup(name='mercurial',
82 setup(name='mercurial',
82 version=mercurial.version.get_version(),
83 version=mercurial.version.get_version(),
83 author='Matt Mackall',
84 author='Matt Mackall',
84 author_email='mpm@selenic.com',
85 author_email='mpm@selenic.com',
85 url='http://selenic.com/mercurial',
86 url='http://selenic.com/mercurial',
86 description='Scalable distributed SCM',
87 description='Scalable distributed SCM',
87 license='GNU GPL',
88 license='GNU GPL',
88 packages=['mercurial', 'hgext'],
89 packages=['mercurial', 'hgext'],
89 ext_modules=[Extension('mercurial.mpatch', ['mercurial/mpatch.c']),
90 ext_modules=[Extension('mercurial.mpatch', ['mercurial/mpatch.c']),
90 Extension('mercurial.bdiff', ['mercurial/bdiff.c'])],
91 Extension('mercurial.bdiff', ['mercurial/bdiff.c'])],
91 data_files=[('mercurial/templates',
92 data_files=[('mercurial/templates',
92 ['templates/map'] +
93 ['templates/map'] +
93 glob.glob('templates/map-*') +
94 glob.glob('templates/map-*') +
94 glob.glob('templates/*.tmpl')),
95 glob.glob('templates/*.tmpl')),
95 ('mercurial/templates/static',
96 ('mercurial/templates/static',
96 glob.glob('templates/static/*'))],
97 glob.glob('templates/static/*'))],
97 cmdclass=cmdclass,
98 cmdclass=cmdclass,
98 scripts=['hg', 'hgmerge'],
99 scripts=['hg', 'hgmerge'],
99 options=dict(bdist_mpkg=dict(zipdist=True,
100 options=dict(bdist_mpkg=dict(zipdist=True,
100 license='COPYING',
101 license='COPYING',
101 readme='contrib/macosx/Readme.html',
102 readme='contrib/macosx/Readme.html',
102 welcome='contrib/macosx/Welcome.html')),
103 welcome='contrib/macosx/Welcome.html')),
103 **py2exe_opts)
104 **py2exe_opts)
105 finally:
106 mercurial.version.forget_version()
General Comments 0
You need to be logged in to leave comments. Login now