setup.py 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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, < 1',
  27. 'PyYAML >= 3.10, < 6',
  28. 'requests >= 2.20.0, < 3',
  29. 'texttable >= 0.9.0, < 2',
  30. 'websocket-client >= 0.32.0, < 1',
  31. 'docker[ssh] >= 3.7.0, < 5',
  32. 'dockerpty >= 0.4.1, < 1',
  33. 'six >= 1.3.0, < 2',
  34. 'jsonschema >= 2.5.1, < 4',
  35. ]
  36. tests_require = [
  37. 'ddt >= 1.2.2, < 2',
  38. 'pytest < 6',
  39. ]
  40. if sys.version_info[:2] < (3, 4):
  41. tests_require.append('mock >= 1.0.1, < 4')
  42. extras_require = {
  43. ':python_version < "3.2"': ['subprocess32 >= 3.5.4, < 4'],
  44. ':python_version < "3.4"': ['enum34 >= 1.0.4, < 2'],
  45. ':python_version < "3.5"': ['backports.ssl_match_hostname >= 3.5, < 4'],
  46. ':python_version < "3.3"': ['backports.shutil_get_terminal_size == 1.0.0',
  47. 'ipaddress >= 1.0.16, < 2'],
  48. ':sys_platform == "win32"': ['colorama >= 0.4, < 1'],
  49. 'socks': ['PySocks >= 1.5.6, != 1.5.7, < 2'],
  50. 'tests': tests_require,
  51. }
  52. try:
  53. if 'bdist_wheel' not in sys.argv:
  54. for key, value in extras_require.items():
  55. if key.startswith(':') and pkg_resources.evaluate_marker(key[1:]):
  56. install_requires.extend(value)
  57. except Exception as e:
  58. print("Failed to compute platform dependencies: {}. ".format(e) +
  59. "All dependencies will be installed as a result.", file=sys.stderr)
  60. for key, value in extras_require.items():
  61. if key.startswith(':'):
  62. install_requires.extend(value)
  63. setup(
  64. name='docker-compose',
  65. version=find_version("compose", "__init__.py"),
  66. description='Multi-container orchestration for Docker',
  67. long_description=read('README.md'),
  68. long_description_content_type='text/markdown',
  69. url='https://www.docker.com/',
  70. project_urls={
  71. 'Documentation': 'https://docs.docker.com/compose/overview',
  72. 'Changelog': 'https://github.com/docker/compose/blob/release/CHANGELOG.md',
  73. 'Source': 'https://github.com/docker/compose',
  74. 'Tracker': 'https://github.com/docker/compose/issues',
  75. },
  76. author='Docker, Inc.',
  77. license='Apache License 2.0',
  78. packages=find_packages(exclude=['tests.*', 'tests']),
  79. include_package_data=True,
  80. install_requires=install_requires,
  81. extras_require=extras_require,
  82. tests_require=tests_require,
  83. python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
  84. entry_points={
  85. 'console_scripts': ['docker-compose=compose.cli.main:main'],
  86. },
  87. classifiers=[
  88. 'Development Status :: 5 - Production/Stable',
  89. 'Environment :: Console',
  90. 'Intended Audience :: Developers',
  91. 'License :: OSI Approved :: Apache Software License',
  92. 'Programming Language :: Python :: 2',
  93. 'Programming Language :: Python :: 2.7',
  94. 'Programming Language :: Python :: 3',
  95. 'Programming Language :: Python :: 3.4',
  96. 'Programming Language :: Python :: 3.6',
  97. 'Programming Language :: Python :: 3.7',
  98. ],
  99. )