setup.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one
  3. # or more contributor license agreements. See the NOTICE file
  4. # distributed with this work for additional information
  5. # regarding copyright ownership. The ASF licenses this file
  6. # to you under the Apache License, Version 2.0 (the
  7. # "License"); you may not use this file except in compliance
  8. # with the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing,
  13. # software distributed under the License is distributed on an
  14. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. # KIND, either express or implied. See the License for the
  16. # specific language governing permissions and limitations
  17. # under the License.
  18. #
  19. from setuptools import setup, find_packages
  20. import setuptools
  21. import sys
  22. cmdclass = {}
  23. try:
  24. from sphinx.setup_command import BuildDoc
  25. cmdclass['build_sphinx'] = BuildDoc
  26. except ImportError:
  27. pass
  28. def readme():
  29. with open('README.rst') as f:
  30. return f.read()
  31. if setuptools.__version__ < '20.8.1':
  32. # Workaround for source install on old setuptools
  33. # This won't be able to create a proper multi-version pacakage
  34. install_requires=[
  35. 'protobuf>=3.0.0',
  36. 'requests',
  37. 'requests-gssapi',
  38. 'SQLAlchemy'
  39. ]
  40. if sys.version_info < (3,6):
  41. install_requires.append('gssapi<1.6.0')
  42. #Don't build the docs on an old stack
  43. setup_requires=[]
  44. else:
  45. install_requires=[
  46. 'protobuf>=3.0.0',
  47. 'requests',
  48. 'requests-gssapi',
  49. 'gssapi<1.6.0;python_version<"3.6"',
  50. 'SQLAlchemy'
  51. ]
  52. setup_requires=[
  53. 'Sphinx;python_version>="3.6"',
  54. ],
  55. version = "1.1.0"
  56. setup(
  57. name="phoenixdb",
  58. version=version,
  59. description="Phoenix database adapter for Python",
  60. long_description=readme(),
  61. author="Apache Software Foundation",
  62. author_email="dev@phoenix.apache.org",
  63. url="http://phoenix.apache.org/python.html",
  64. license="Apache 2",
  65. packages=find_packages(),
  66. include_package_data=True,
  67. cmdclass=cmdclass,
  68. command_options={
  69. 'build_sphinx': {
  70. 'version': ('setup.py', version),
  71. 'release': ('setup.py', version),
  72. },
  73. },
  74. classifiers=[
  75. 'Programming Language :: Python',
  76. 'Programming Language :: Python :: 2',
  77. 'Programming Language :: Python :: 2.7',
  78. 'Programming Language :: Python :: 3',
  79. 'Programming Language :: Python :: 3.4',
  80. 'Programming Language :: Python :: 3.5',
  81. 'Programming Language :: Python :: 3.6',
  82. 'Programming Language :: Python :: 3.7',
  83. 'Programming Language :: Python :: 3.8',
  84. ],
  85. install_requires=install_requires,
  86. extras_require={
  87. 'SQLAlchemy': ['SQLAlchemy'],
  88. },
  89. tests_require=[
  90. 'SQLAlchemy',
  91. 'nose',
  92. 'flake8'
  93. ],
  94. setup_requires=setup_requires,
  95. entry_points={
  96. "sqlalchemy.dialects": [
  97. "phoenix = phoenixdb.sqlalchemy_phoenix:PhoenixDialect"
  98. ]
  99. },
  100. )