1 |
111b2d34
|
Benjamin Dauvergne
|
#!/usr/bin/python
|
2 |
|
|
from setuptools import setup, find_packages
|
3 |
|
|
import os
|
4 |
|
|
|
5 |
572bb040
|
Jérôme Schneider
|
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 |
c1ed0746
|
Jérôme Schneider
|
p = subprocess.Popen(['git','describe','--dirty'],
|
27 |
572bb040
|
Jérôme Schneider
|
stdout=subprocess.PIPE)
|
28 |
|
|
result = p.communicate()[0]
|
29 |
|
|
assert p.returncode == 0, 'git returned non-zero'
|
30 |
c1ed0746
|
Jérôme Schneider
|
new_version = result.split()[0]
|
31 |
572bb040
|
Jérôme Schneider
|
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 |
333a39ca
|
Benjamin Dauvergne
|
setup(name='calebasse',
|
37 |
572bb040
|
Jérôme Schneider
|
version=get_version(),
|
38 |
111b2d34
|
Benjamin Dauvergne
|
license='AGPLv3',
|
39 |
|
|
description='',
|
40 |
333a39ca
|
Benjamin Dauvergne
|
url='http://dev.entrouvert.org/projects/calebasse/',
|
41 |
|
|
download_url='http://repos.entrouvert.org/calebasse.git/',
|
42 |
111b2d34
|
Benjamin Dauvergne
|
author="Entr'ouvert",
|
43 |
|
|
author_email="info@entrouvert.com",
|
44 |
|
|
packages=find_packages(os.path.dirname(__file__) or '.'),
|
45 |
|
|
install_requires=[
|
46 |
1007d70a
|
Jérôme Schneider
|
'django >= 1.4.2, < 1.5',
|
47 |
111b2d34
|
Benjamin Dauvergne
|
'south >= 0.7',
|
48 |
e37c8bd1
|
Jérôme Schneider
|
'django-reversion >= 1.6.4',
|
49 |
1a622a74
|
Jérôme Schneider
|
'python-dateutil >=1.5, < 2.0',
|
50 |
0e67026e
|
Benjamin Dauvergne
|
'django-model-utils < 1.2.0',
|
51 |
7b28c0b2
|
Benjamin Dauvergne
|
'django-ajax-selects < 1.3.0',
|
52 |
7f9269be
|
Benjamin Dauvergne
|
'django-widget-tweaks < 1.2.0',
|
53 |
572bb040
|
Jérôme Schneider
|
'django-tastypie >= 0.9, < 1.0',
|
54 |
7a0a30d7
|
Benjamin Dauvergne
|
'interval == 1.0.0',
|
55 |
572bb040
|
Jérôme Schneider
|
'python-entrouvert >= 1.3'
|
56 |
92ea6229
|
Jérôme Schneider
|
'django-debug-toolbar',
|
57 |
111b2d34
|
Benjamin Dauvergne
|
],
|
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 |
|
|
)
|