setup.py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/usr/bin/env python
  2. import re
  3. from setuptools import find_packages
  4. from os import path
  5. try:
  6. from setuptools import setup
  7. extra = dict(test_suite="tests.test.suite", include_package_data=True)
  8. except ImportError:
  9. extra = {}
  10. def parse_requirements(file_name):
  11. requirements = []
  12. for line in open(file_name, 'r').read().split('\n'):
  13. if re.match(r'(\s*#)|(\s*$)', line):
  14. continue
  15. if re.match(r'\s*-e\s+', line):
  16. requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1', line))
  17. elif re.match(r'\s*-f\s+', line):
  18. pass
  19. else:
  20. requirements.append(line)
  21. return requirements
  22. def parse_dependency_links(file_name):
  23. dependency_links = []
  24. for line in open(file_name, 'r').read().split('\n'):
  25. if re.match(r'\s*-[ef]\s+', line):
  26. dependency_links.append(re.sub(r'\s*-[ef]\s+', '', line))
  27. return dependency_links
  28. def get_file_contents(filename):
  29. fd = file(path.join(path.dirname(__file__), filename), "r")
  30. content = fd.read()
  31. fd.close()
  32. return content
  33. setup(
  34. name="mico",
  35. version="0.1",
  36. description="A monkey driven cloud management",
  37. author='Andres J. Diaz',
  38. author_email='ajdiaz@connectical.com',
  39. url='http://ajdiaz.github.com/mico',
  40. packages=find_packages(),
  41. install_requires=parse_requirements('requirements.txt'),
  42. dependency_links=parse_dependency_links('requirements.txt'),
  43. license="GPL",
  44. entry_points={
  45. 'console_scripts': [
  46. 'mico = mico.script.cmdline:main',
  47. ]
  48. },
  49. classifiers=[
  50. 'Development Status :: 4 - Beta',
  51. 'Intended Audience :: Developers',
  52. 'Natural Language :: English',
  53. 'License :: OSI Approved :: GNU General Public License (GPL)',
  54. 'Programming Language :: Python :: 2.7',
  55. 'Programming Language :: Python :: 2.6',
  56. 'Operating System :: OS Independent',
  57. 'Programming Language :: Python'
  58. ],
  59. **extra
  60. )