Project

General

Profile

Download (2.12 KB) Statistics
| Branch: | Tag: | Revision:

calebasse / setup.py @ a9efa997

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

    
9
    version = None
10
    for d in glob.glob('*'):
11
        if not os.path.isdir(d):
12
            continue
13
        module_file = os.path.join(d, '__init__.py')
14
        if not os.path.exists(module_file):
15
            continue
16
        for v in re.findall("""__version__ *= *['"](.*)['"]""",
17
                open(module_file).read()):
18
            assert version is None
19
            version = v
20
        if version:
21
            break
22
    assert version is not None
23
    if os.path.exists('.git'):
24
        import subprocess
25
        p = subprocess.Popen(['git','describe','--dirty'],
26
                stdout=subprocess.PIPE)
27
        result = p.communicate()[0]
28
        assert p.returncode == 0, 'git returned non-zero'
29
        new_version = result.split()[0]
30
        assert new_version.split('-')[0] == version, '__version__ must match the last git annotated tag'
31
        version = new_version.replace('-', '.')
32
    return version
33

    
34

    
35
setup(name='calebasse',
36
        version=get_version(),
37
        license='AGPLv3',
38
        description='',
39
        url='http://dev.entrouvert.org/projects/calebasse/',
40
        download_url='http://repos.entrouvert.org/calebasse.git/',
41
        author="Entr'ouvert",
42
        author_email="info@entrouvert.com",
43
        packages=find_packages(os.path.dirname(__file__) or '.'),
44
        install_requires=[
45
            'Django >= 1.5, < 1.6',
46
            'south >= 0.8.4',
47
            'django-reversion == 1.6.6',
48
            'python-dateutil >= 2.2, < 2.3',
49
            'django-model-utils >= 1.5.0',
50
            'django-ajax-selects < 1.3.0',
51
            'django-widget-tweaks < 1.2.0',
52
            'django-tastypie == 0.9.14',
53
            'django-select2 < 4.3',
54
            'interval == 1.0.0',
55
            'python-entrouvert >= 1.3'
56
            'django-localflavor',
57
            'PyGTK',
58
            'xhtml2pdf',
59
            'M2Crypto',
60
            'pycairo',
61
        ],
62
        dependency_links = [
63
            'http://django-swingtime.googlecode.com/files/django-swingtime-0.2.1.tar.gz#egg=django-swingtime-0.2.1',
64
        ],
65
)
(15-15/15)