1
0

setup.py 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. from __future__ import absolute_import
  4. from __future__ import unicode_literals
  5. import codecs
  6. import logging
  7. import os
  8. import re
  9. import sys
  10. import pkg_resources
  11. from setuptools import find_packages
  12. from setuptools import setup
  13. def read(*parts):
  14. path = os.path.join(os.path.dirname(__file__), *parts)
  15. with codecs.open(path, encoding='utf-8') as fobj:
  16. return fobj.read()
  17. def find_version(*file_paths):
  18. version_file = read(*file_paths)
  19. version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
  20. version_file, re.M)
  21. if version_match:
  22. return version_match.group(1)
  23. raise RuntimeError("Unable to find version string.")
  24. install_requires = [
  25. 'cached-property >= 1.2.0, < 2',
  26. 'colorama >= 0.3.7, < 0.4',
  27. 'docopt >= 0.6.1, < 0.7',
  28. 'PyYAML >= 3.10, < 4',
  29. 'requests >= 2.6.1, != 2.11.0, < 2.12',
  30. 'texttable >= 0.8.1, < 0.9',
  31. 'websocket-client >= 0.32.0, < 1.0',
  32. 'docker >= 2.0.0, < 3.0',
  33. 'dockerpty >= 0.4.1, < 0.5',
  34. 'six >= 1.3.0, < 2',
  35. 'jsonschema >= 2.5.1, < 3',
  36. ]
  37. tests_require = [
  38. 'pytest',
  39. ]
  40. if sys.version_info[:2] < (3, 4):
  41. tests_require.append('mock >= 1.0.1')
  42. extras_require = {
  43. ':python_version < "3.4"': ['enum34 >= 1.0.4, < 2']
  44. }
  45. try:
  46. if 'bdist_wheel' not in sys.argv:
  47. for key, value in extras_require.items():
  48. if key.startswith(':') and pkg_resources.evaluate_marker(key[1:]):
  49. install_requires.extend(value)
  50. except Exception:
  51. logging.getLogger(__name__).exception(
  52. 'Something went wrong calculating platform specific dependencies, so '
  53. "you're getting them all!"
  54. )
  55. for key, value in extras_require.items():
  56. if key.startswith(':'):
  57. install_requires.extend(value)
  58. setup(
  59. name='docker-compose',
  60. version=find_version("compose", "__init__.py"),
  61. description='Multi-container orchestration for Docker',
  62. url='https://www.docker.com/',
  63. author='Docker, Inc.',
  64. license='Apache License 2.0',
  65. packages=find_packages(exclude=['tests.*', 'tests']),
  66. include_package_data=True,
  67. test_suite='nose.collector',
  68. install_requires=install_requires,
  69. extras_require=extras_require,
  70. tests_require=tests_require,
  71. entry_points="""
  72. [console_scripts]
  73. docker-compose=compose.cli.main:main
  74. """,
  75. classifiers=[
  76. 'Development Status :: 5 - Production/Stable',
  77. 'Environment :: Console',
  78. 'Intended Audience :: Developers',
  79. 'License :: OSI Approved :: Apache Software License',
  80. 'Programming Language :: Python :: 2',
  81. 'Programming Language :: Python :: 2.7',
  82. 'Programming Language :: Python :: 3',
  83. 'Programming Language :: Python :: 3.4',
  84. ],
  85. )