setup.py 2.51 KB
Newer Older
Christophe Siraut's avatar
Christophe Siraut committed
1
#!/usr/bin/env python
2
from distutils.core import setup
chris's avatar
chris committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
import os
import re


def find_package_data(basedir):
    pkgdata = {}
    pkgdir = {}
    EXCLUDE_FROM_DATA=('.py', '.pyc', '.pyo')
    for directory, _, files in os.walk(basedir):
        package = '.'.join(directory.split(os.sep))
        if '__init__.py' in files:
            # Record real packages and their directories
            pkgdata[package] = [
                f for f in files
                if not f.endswith(EXCLUDE_FROM_DATA)
            ]
            pkgdir[package] = directory
        else:
            # Find parent package
            while package not in pkgdata and package:
                package = ".".join(package.split(".")[:-1])
            # Add data files relative to their parent package
            reldir = os.path.relpath(directory, pkgdir[package])
            pkgdata[package].extend(
                os.path.join(reldir, f)
                for f in files
                if not f.endswith(EXCLUDE_FROM_DATA)
            )
    return pkgdata


with open('debian/changelog') as f:
    res = re.search('\((\d.*)\)', f.readline())
    version = res.group(1)
Christophe Siraut's avatar
Christophe Siraut committed
37

38
setup(
chris's avatar
chris committed
39 40
    name='Nuages',
    version=version,
41 42 43 44 45 46 47 48 49 50
    description='Nuages web application',
    author='Christophe Siraut',
    author_email='d@tobald.eu.org',
    url='http://nuages.domainepublic.net/',
    packages=[
        'nuages',
        'nuages_templates',
        'meetingpoll',
        'registration_templates'
    ],
chris's avatar
chris committed
51
    package_data=find_package_data('nuages'),
52 53 54 55 56
    install_requires=[
        'django',
        'django-jquery',
        'django-registration',
        'django-datetime-widget',
chris's avatar
chris committed
57 58
        'django-bootstrap-staticfiles',
        'django-meetingpoll'
59 60 61 62 63 64 65 66 67 68 69 70 71 72
    ],
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU General Public License (GPL) License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Utilities'
    ],
)
chris's avatar
chris committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88

setup(
    name='MeetingPoll',
    version=version,
    description='Meeting poll Django Application',
    author='Christophe Siraut',
    author_email='d@tobald.eu.org',
    url='http://nuages.domainepublic.net/',
    packages=[
        'meetingpoll',
    ],
    package_data=find_package_data('meetingpoll'),
    install_requires=[
        'django',
    ],
)