passerelle/setup.py

59 lines
1.8 KiB
Python
Raw Normal View History

2013-02-11 11:06:47 +01:00
#!/usr/bin/python
2013-02-11 11:06:47 +01:00
import os
import subprocess
from distutils.command.sdist import sdist
from setuptools import setup, find_packages
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','--match=v*'], stdout=subprocess.PIPE)
result = p.communicate()[0]
version = result.split()[0][1:]
version = version.replace('-', '.')
return version
return '0'
class eo_sdist(sdist):
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')
2013-02-11 11:06:47 +01:00
setup(name='passerelle',
version=get_version(),
2013-02-11 11:06:47 +01:00
license='AGPLv3',
2014-10-02 10:08:49 +02:00
description='Passerelle provides an uniform access to multiple data sources and services.',
2013-02-11 11:06:47 +01:00
url='https://dev.entrouvert.org/projects/passerelle/',
download_url='http://repos.entrouvert.org/passerelle.git/',
author="Entr'ouvert",
author_email="info@entrouvert.com",
packages=find_packages(os.path.dirname(__file__) or '.'),
2014-10-02 10:08:49 +02:00
scripts=['manage.py'],
include_package_data=True,
2013-02-11 11:06:47 +01:00
install_requires=[
'django >= 1.7, <1.8',
2014-10-02 10:08:49 +02:00
'django-model-utils',
'django-jsonresponse==0.10',
2015-03-12 16:19:05 +01:00
'django-jsonfield >= 0.9.3',
'requests',
2014-10-02 10:08:49 +02:00
'gadjo',
2013-04-26 11:24:56 +02:00
],
cmdclass={'sdist': eo_sdist},
2013-02-11 11:06:47 +01:00
)