diff --git a/setup.py b/setup.py index f320843..1b73eea 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,27 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- from distutils.core import setup +from os.path import dirname, abspath, join, normpath, isdir, basename +from os import listdir def fetch_version(): """Get version from version.in""" return file('VERSION', 'r').readline().strip() +def return_storages(): + "returns all the storage plugins that are living in tiramisu/storage" + here = dirname(abspath(__file__)) + storages_path = normpath(join(here, 'tiramisu', 'storage')) + dir_content = [ content for content in listdir(storages_path) \ + if not content =='__pycache__'] + storages = filter(isdir, [join(storages_path, content) \ + for content in dir_content]) + storage_list = [basename(storage) for storage in storages] + return storage_list + +packages = ['tiramisu', 'tiramisu.storage'] +packages.extend(return_storages()) setup( author="Tiramisu's team", @@ -15,7 +30,6 @@ setup( version=fetch_version(), description='an options controller tool', url='http://tiramisu.labs.libre-entreprise.org/', - packages=['tiramisu'], classifiers=[ "Programming Language :: Python", "Programming Language :: Python :: 2", @@ -45,4 +59,5 @@ producing flexible and fast options access. This version requires Python 2.6 or later. """ + packages=packages )