setup.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. from __future__ import absolute_import
  4. from __future__ import print_function
  5. from __future__ import unicode_literals
  6. import codecs
  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. 'docopt >= 0.6.1, < 0.7',
  27. 'PyYAML >= 3.10, < 4',
  28. 'requests >= 2.6.1, != 2.11.0, != 2.12.2, != 2.18.0, < 2.19',
  29. 'texttable >= 0.9.0, < 0.10',
  30. 'websocket-client >= 0.32.0, < 1.0',
  31. 'docker >= 3.0.0, < 4.0',
  32. 'dockerpty >= 0.4.1, < 0.5',
  33. 'six >= 1.3.0, < 2',
  34. 'jsonschema >= 2.5.1, < 3',
  35. ]
  36. tests_require = [
  37. 'pytest',
  38. ]
  39. if sys.version_info[:2] < (3, 4):
  40. tests_require.append('mock >= 1.0.1')
  41. extras_require = {
  42. ':python_version < "3.4"': ['enum34 >= 1.0.4, < 2'],
  43. ':python_version < "3.5"': ['backports.ssl_match_hostname >= 3.5'],
  44. ':python_version < "3.3"': ['ipaddress >= 1.0.16'],
  45. ':sys_platform == "win32"': ['colorama >= 0.3.9, < 0.4'],
  46. 'socks': ['PySocks >= 1.5.6, != 1.5.7, < 2'],
  47. }
  48. try:
  49. if 'bdist_wheel' not in sys.argv:
  50. for key, value in extras_require.items():
  51. if key.startswith(':') and pkg_resources.evaluate_marker(key[1:]):
  52. install_requires.extend(value)
  53. except Exception as e:
  54. print("Failed to compute platform dependencies: {}. ".format(e) +
  55. "All dependencies will be installed as a result.", file=sys.stderr)
  56. for key, value in extras_require.items():
  57. if key.startswith(':'):
  58. install_requires.extend(value)
  59. setup(
  60. name='docker-compose',
  61. version=find_version("compose", "__init__.py"),
  62. description='Multi-container orchestration for Docker',
  63. url='https://www.docker.com/',
  64. author='Docker, Inc.',
  65. license='Apache License 2.0',
  66. packages=find_packages(exclude=['tests.*', 'tests']),
  67. include_package_data=True,
  68. test_suite='nose.collector',
  69. install_requires=install_requires,
  70. extras_require=extras_require,
  71. tests_require=tests_require,
  72. entry_points="""
  73. [console_scripts]
  74. docker-compose=compose.cli.main:main
  75. """,
  76. classifiers=[
  77. 'Development Status :: 5 - Production/Stable',
  78. 'Environment :: Console',
  79. 'Intended Audience :: Developers',
  80. 'License :: OSI Approved :: Apache Software License',
  81. 'Programming Language :: Python :: 2',
  82. 'Programming Language :: Python :: 2.7',
  83. 'Programming Language :: Python :: 3',
  84. 'Programming Language :: Python :: 3.4',
  85. 'Programming Language :: Python :: 3.6',
  86. ],
  87. )