1
|
#!/usr/bin/python
|
2
|
from setuptools import setup, find_packages
|
3
|
import os
|
4
|
|
5
|
def get_version():
|
6
|
import glob
|
7
|
import re
|
8
|
import os
|
9
|
|
10
|
version = None
|
11
|
for d in glob.glob('*'):
|
12
|
if not os.path.isdir(d):
|
13
|
continue
|
14
|
module_file = os.path.join(d, '__init__.py')
|
15
|
if not os.path.exists(module_file):
|
16
|
continue
|
17
|
for v in re.findall("""__version__ *= *['"](.*)['"]""",
|
18
|
open(module_file).read()):
|
19
|
assert version is None
|
20
|
version = v
|
21
|
if version:
|
22
|
break
|
23
|
assert version is not None
|
24
|
if os.path.exists('.git'):
|
25
|
import subprocess
|
26
|
p = subprocess.Popen(['git','describe','--dirty'],
|
27
|
stdout=subprocess.PIPE)
|
28
|
result = p.communicate()[0]
|
29
|
assert p.returncode == 0, 'git returned non-zero'
|
30
|
new_version = result.split()[0]
|
31
|
assert new_version.split('-')[0] == version, '__version__ must match the last git annotated tag'
|
32
|
version = new_version.replace('-', '.')
|
33
|
return version
|
34
|
|
35
|
|
36
|
setup(name='calebasse',
|
37
|
version=get_version(),
|
38
|
license='AGPLv3',
|
39
|
description='',
|
40
|
url='http://dev.entrouvert.org/projects/calebasse/',
|
41
|
download_url='http://repos.entrouvert.org/calebasse.git/',
|
42
|
author="Entr'ouvert",
|
43
|
author_email="info@entrouvert.com",
|
44
|
packages=find_packages(os.path.dirname(__file__) or '.'),
|
45
|
install_requires=[
|
46
|
'django >= 1.4.2, < 1.5',
|
47
|
'south >= 0.7',
|
48
|
'django-reversion >= 1.6.4',
|
49
|
'python-dateutil >=1.5, < 2.0',
|
50
|
'django-model-utils < 1.2.0',
|
51
|
'django-ajax-selects < 1.3.0',
|
52
|
'django-widget-tweaks < 1.2.0',
|
53
|
'django-tastypie >= 0.9, < 1.0',
|
54
|
'interval == 1.0.0',
|
55
|
'python-entrouvert >= 1.3'
|
56
|
'django-debug-toolbar',
|
57
|
],
|
58
|
dependency_links = [
|
59
|
'http://django-swingtime.googlecode.com/files/django-swingtime-0.2.1.tar.gz#egg=django-swingtime-0.2.1',
|
60
|
],
|
61
|
)
|