From 4d6d8bf20113d22926b2bd740d14e48d6906481c Mon Sep 17 00:00:00 2001 From: gwen Date: Thu, 29 Aug 2013 16:38:23 +0200 Subject: [PATCH] version for setup.py --- setup.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1ca3915..2b57b1c 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,8 @@ #!/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 import os import subprocess @@ -26,6 +28,19 @@ def fetch_version(): return version +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='cadoles team', @@ -34,5 +49,5 @@ setup( version=fetch_version(), description='configuration management tool', url='http://labs.libre-entreprise.org/projects/tiramisu', - packages=['tiramisu'] + packages=packages )