setup.py 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import codecs
  4. import os
  5. import re
  6. import sys
  7. import pkg_resources
  8. from setuptools import find_packages
  9. from setuptools import setup
  10. def read(*parts):
  11. path = os.path.join(os.path.dirname(__file__), *parts)
  12. with codecs.open(path, encoding='utf-8') as fobj:
  13. return fobj.read()
  14. def find_version(*file_paths):
  15. version_file = read(*file_paths)
  16. version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
  17. version_file, re.M)
  18. if version_match:
  19. return version_match.group(1)
  20. raise RuntimeError("Unable to find version string.")
  21. install_requires = [
  22. 'cached-property >= 1.2.0, < 2',
  23. 'docopt >= 0.6.1, < 1',
  24. 'PyYAML >= 3.10, < 6',
  25. 'requests >= 2.20.0, < 3',
  26. 'texttable >= 0.9.0, < 2',
  27. 'websocket-client >= 0.32.0, < 1',
  28. 'distro >= 1.5.0, < 2',
  29. 'docker[ssh] >= 3.7.0, < 5',
  30. 'dockerpty >= 0.4.1, < 1',
  31. 'six >= 1.3.0, < 2',
  32. 'jsonschema >= 2.5.1, < 4',
  33. 'python-dotenv >= 0.13.0, < 1',
  34. ]
  35. tests_require = [
  36. 'ddt >= 1.2.2, < 2',
  37. 'pytest < 6',
  38. ]
  39. if sys.version_info[:2] < (3, 4):
  40. tests_require.append('mock >= 1.0.1, < 4')
  41. extras_require = {
  42. ':python_version < "3.2"': ['subprocess32 >= 3.5.4, < 4'],
  43. ':python_version < "3.4"': ['enum34 >= 1.0.4, < 2'],
  44. ':python_version < "3.5"': ['backports.ssl_match_hostname >= 3.5, < 4'],
  45. ':python_version < "3.3"': ['backports.shutil_get_terminal_size == 1.0.0',
  46. 'ipaddress >= 1.0.16, < 2'],
  47. ':sys_platform == "win32"': ['colorama >= 0.4, < 1'],
  48. 'socks': ['PySocks >= 1.5.6, != 1.5.7, < 2'],
  49. 'tests': tests_require,
  50. }
  51. try:
  52. if 'bdist_wheel' not in sys.argv:
  53. for key, value in extras_require.items():
  54. if key.startswith(':') and pkg_resources.evaluate_marker(key[1:]):
  55. install_requires.extend(value)
  56. except Exception as e:
  57. print("Failed to compute platform dependencies: {}. ".format(e) +
  58. "All dependencies will be installed as a result.", file=sys.stderr)
  59. for key, value in extras_require.items():
  60. if key.startswith(':'):
  61. install_requires.extend(value)
  62. setup(
  63. name='docker-compose',
  64. version=find_version("compose", "__init__.py"),
  65. description='Multi-container orchestration for Docker',
  66. long_description=read('README.md'),
  67. long_description_content_type='text/markdown',
  68. url='https://www.docker.com/',
  69. project_urls={
  70. 'Documentation': 'https://docs.docker.com/compose/overview',
  71. 'Changelog': 'https://github.com/docker/compose/blob/release/CHANGELOG.md',
  72. 'Source': 'https://github.com/docker/compose',
  73. 'Tracker': 'https://github.com/docker/compose/issues',
  74. },
  75. author='Docker, Inc.',
  76. license='Apache License 2.0',
  77. packages=find_packages(exclude=['tests.*', 'tests']),
  78. include_package_data=True,
  79. install_requires=install_requires,
  80. extras_require=extras_require,
  81. tests_require=tests_require,
  82. python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
  83. entry_points={
  84. 'console_scripts': ['docker-compose=compose.cli.main:main'],
  85. },
  86. classifiers=[
  87. 'Development Status :: 5 - Production/Stable',
  88. 'Environment :: Console',
  89. 'Intended Audience :: Developers',
  90. 'License :: OSI Approved :: Apache Software License',
  91. 'Programming Language :: Python :: 3',
  92. 'Programming Language :: Python :: 3.4',
  93. 'Programming Language :: Python :: 3.6',
  94. 'Programming Language :: Python :: 3.7',
  95. ],
  96. )