from distutils.core import setup

### Add find_packages function, see
# https://wiki.python.org/moin/Distutils/Cookbook/AutoPackageDiscovery
import os

def is_package(path):
    return (
        os.path.isdir(path) and
        os.path.isfile(os.path.join(path, '__init__.py'))
        )

def find_packages(path=".", base="", exclude=None):
    """ Find all packages in path """
    if not exclude:
        exclude = []
    packages = {}
    for item in os.listdir(path):
        dir = os.path.join(path, item)
        if is_package( dir ) and dir not in exclude:
            if base:
                module_name = "%(base)s.%(item)s" % vars()
            else:
                module_name = item
            packages[module_name] = dir
            packages.update(find_packages(dir, module_name))
    return packages
###

setup(name='raco',
      version='1.0.0',
      description='Relational Algebra COmpiler',
      author='Bill Howe, Andrew Whitaker, Daniel Halperin',
      author_email='raco@cs.washington.edu',
      url='https://github.com/uwescience/datalogcompiler',
      packages=find_packages(exclude=['clang']),
      install_requires=['networkx','ply','pyparsing'],
      )

add setup.py for distutils