version for setup.py

This commit is contained in:
gwen 2013-08-29 16:38:23 +02:00
parent 4c4d664c2e
commit 4d6d8bf201
1 changed files with 16 additions and 1 deletions

View File

@ -1,6 +1,8 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from distutils.core import setup from distutils.core import setup
from os.path import dirname, abspath, join, normpath, isdir, basename
from os import listdir
import os import os
import subprocess import subprocess
@ -26,6 +28,19 @@ def fetch_version():
return 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( setup(
author='cadoles team', author='cadoles team',
@ -34,5 +49,5 @@ setup(
version=fetch_version(), version=fetch_version(),
description='configuration management tool', description='configuration management tool',
url='http://labs.libre-entreprise.org/projects/tiramisu', url='http://labs.libre-entreprise.org/projects/tiramisu',
packages=['tiramisu'] packages=packages
) )