diff --git a/MANIFEST.in b/MANIFEST.in index c90b2c9..41f8bd9 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ recursive-include mellon/templates *.html *.xml recursive-include mellon/locale *.po *.mo include MANIFEST.in +include VERSION diff --git a/setup.py b/setup.py index 45e8b0e..2958cde 100755 --- a/setup.py +++ b/setup.py @@ -35,8 +35,21 @@ class compile_translations(Command): class build(_build): sub_commands = [('compile_translations', None)] + _build.sub_commands -class sdist(_sdist): - sub_commands = [('compile_translations', None)] + _sdist.sub_commands +class eo_sdist(_sdist): + sub_commands = [('compile_translations', None)] + _build.sub_commands + + def run(self): + print "creating VERSION file" + if os.path.exists('VERSION'): + os.remove('VERSION') + version = get_version() + version_file = open('VERSION', 'w') + version_file.write(version) + version_file.close() + _sdist.run(self) + print "removing VERSION file" + if os.path.exists('VERSION'): + os.remove('VERSION') class install_lib(_install_lib): def run(self): @@ -87,6 +100,6 @@ setup(name="django-mellon", 'build': build, 'install_lib': install_lib, 'compile_translations': compile_translations, - 'sdist': sdist, + 'sdist': eo_sdist, }, )