import click
import importlib
import os

from setuptools import setup, find_packages


def get_plugins():
    folders = [folder for folder in os.listdir('plugins') if os.path.isdir('plugins/{}'.format(folder))]

    plugins = []
    for folder in folders:
        full_path = 'plugins/{}/'.format(folder)
        files = [filename for filename in os.listdir(full_path) if os.path.isfile(full_path + filename) and filename.endswith('.py')]
        for plugin in files:
            module_name = '{}{}'.format(full_path, plugin).replace('/', '.')[:-3]
            module = importlib.import_module(module_name, package=None)
            if hasattr(module, plugin[:-3]):
                print(click.style('Loading {} from {}{}'.format(module_name, full_path, plugin), fg='green'))
                plugins.append('{0}={1}:{0}'.format(plugin[:-3], module_name))
            else:
                print(click.style('Could not load {} from {}{}'.format(module_name, full_path, plugin), fg='red'))

    if len(plugins) is 0:
        return ''

    return '[lamp.plugins]\n' + '\n'.join(plugins)


setup(name='docker-lamp',
      version='0.5',
      description='A stack based on docker to run PHP Applications',
      url='http://github.com/inetprocess/lamp',
      author='Emmanuel Dyan',
      author_email='emmanuel.dyan@inetprocess.com',
      license='Apache 2.0',
      packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
      py_modules=['lamp'],
      entry_points='''
        [console_scripts]
        lamp=lamp:main
        {}
      '''.format(get_plugins()),
      install_requires=[
        'clint',
        'click', 'click-plugins',
        'requests'])

@@ -1087,16 +1087,21 @@
 %0A%0Asetup(
+%0A    
 name='do
@@ -1116,18 +1116,16 @@
 p',%0A    
- 
- 
 version=
@@ -1131,18 +1131,16 @@
 ='0.5',%0A
-  
     desc
@@ -1202,18 +1202,16 @@
 s',%0A    
-  
 url='htt
@@ -1244,26 +1244,24 @@
 /lamp',%0A    
- 
- 
 author='Emma
@@ -1272,18 +1272,16 @@
  Dyan',%0A
-  
     auth
@@ -1326,18 +1326,16 @@
 m',%0A    
-  
 license=
@@ -1352,18 +1352,16 @@
 0',%0A    
- 
- 
 packages
@@ -1419,18 +1419,16 @@
 %5D),%0A    
-  
 py_modul
@@ -1440,18 +1440,16 @@
 lamp'%5D,%0A
-  
     entr
@@ -1554,18 +1554,16 @@
 ins()),%0A
-  
     inst
@@ -1577,16 +1577,16 @@
 uires=%5B%0A
+
         
@@ -1645,12 +1645,62 @@
 requests
-'%5D
+%3E=2.11.0,%3C2.12',%0A        'docker-compose'%0A        %5D%0A
 )%0A

Add docker-compose in virtualenv.