setup.py 3.3 KB

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