setup.py
author Tero Marttila <tero.marttila@aalto.fi>
Tue, 24 Feb 2015 12:47:09 +0200
changeset 437 5100b359906c
parent 436 18805b3bf382
child 438 d45fc43c6073
permissions -rw-r--r--
specify external library requirements in setup.py
#!/usr/bin/env python
# encoding: utf-8

from distutils.core import setup
from glob import glob

def _globs (*pats) :
    for pat in pats :
        for file in glob(pat) :
            yield file

def globs (*pats) :
    return list(_globs(*pats))

# TODO: fix to use PEP-396 once available:
#   https://www.python.org/dev/peps/pep-0396/#classic-distutils
for line in open('pvl/verkko/__init__.py'):
    if '__version__' in line:
        _, line_version = line.split('=')
        __version__ = line_version.strip().strip("''")

setup(
    name            = 'pvl-verkko',
    version         = __version__,
    description     = "verkko.paivola.fi WSGI",
    url             = 'http://verkko.paivola.fi/hg/pvl-verkko',

    author          = "Tero Marttila",
    author_email    = "terom@paivola.fi",
    
    # deps
    install_requires    = [
        # pvl.args
        # pvl.invoke
        'pvl-common',

        # pvl.hosts-import
        'pvl-ldap',
        
        # pvl.verkko.db ->
        'sqlalchemy',

        # pvl.hosts
        'ipaddr',
    ],
    
    # lib
    namespace_packages = [ 'pvl' ],
    py_modules = [
        'pvl.hosts',
    ],
    packages    = [
        'pvl',
        'pvl.web',
        'pvl.dhcp',
        'pvl.dns',
        'pvl.rrd',
        'pvl.verkko',
    ],
    
    # bin
    scripts     = globs('bin/pvl.*-*'),
    
    # etc, static
    data_files  = [
        ( 'etc/pvl/verkko', [  ] ),
        ( 'share/pvl/verkko/static/dhcp',   globs('static/dhcp/*.css', 'static/dhcp/*.js')),
        ( 'share/pvl/verkko/static/rrd',    globs('static/rrd/*.css', 'static/rrd/*.js')),
        ( 'share/pvl/verkko/static',        globs('static/*.css')),
    ],
)