diff --git a/MANIFEST.in b/MANIFEST.in index 57fcb6e..5b0a3fd 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,7 @@ -recursive-include mandaye/templates *.html -recursive-include mandaye/static * +include MANIFEST +include VERSION include mandaye/alembic.ini + recursive-include mandaye/alembic * +recursive-include mandaye/static * +recursive-include mandaye/templates *.html diff --git a/setup.py b/setup.py index 7e45fc0..7685c41 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,8 @@ Setup script for Mandaye ''' -import mandaye +import os +import subprocess from setuptools import setup, find_packages from sys import version @@ -23,8 +24,21 @@ install_requires=[ if version < '2.7': install_requires.append('importlib') +def get_version(): + if os.path.exists('VERSION'): + version_file = open('VERSION', 'r') + version = version_file.read() + version_file.close() + return version + if os.path.exists('.git'): + p = subprocess.Popen(['git','describe','--long'], stdout=subprocess.PIPE) + result = p.communicate()[0] + return result.split()[0].replace('-','.') + import mandaye + return mandaye.VERSION + setup(name="mandaye", - version=mandaye.VERSION, + version=get_version(), license="AGPLv3 or later", description="Mandaye, modular reverse proxy to authenticate", url="http://dev.entrouvert.org/projects/reverse-proxy/",