setup.py 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. # Licensed to the Apache Software Foundation (ASF) under one
  2. # or more contributor license agreements. See the NOTICE file
  3. # distributed with this work for additional information
  4. # regarding copyright ownership. The ASF licenses this file
  5. # to you under the Apache License, Version 2.0 (the
  6. # "License"); you may not use this file except in compliance
  7. # with the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing,
  12. # software distributed under the License is distributed on an
  13. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. # KIND, either express or implied. See the License for the
  15. # specific language governing permissions and limitations
  16. # under the License.
  17. import io
  18. import json
  19. import os
  20. import subprocess
  21. import sys
  22. from setuptools import find_packages, setup
  23. if sys.version_info < (3, 6):
  24. sys.exit("Sorry, Python < 3.6 is not supported")
  25. BASE_DIR = os.path.abspath(os.path.dirname(__file__))
  26. PACKAGE_JSON = os.path.join(BASE_DIR, "superset-frontend", "package.json")
  27. with open(PACKAGE_JSON, "r") as package_file:
  28. version_string = json.load(package_file)["version"]
  29. with io.open("README.md", "r", encoding="utf-8") as f:
  30. long_description = f.read()
  31. def get_git_sha():
  32. try:
  33. s = subprocess.check_output(["git", "rev-parse", "HEAD"])
  34. return s.decode().strip()
  35. except Exception:
  36. return ""
  37. GIT_SHA = get_git_sha()
  38. version_info = {"GIT_SHA": GIT_SHA, "version": version_string}
  39. print("-==-" * 15)
  40. print("VERSION: " + version_string)
  41. print("GIT SHA: " + GIT_SHA)
  42. print("-==-" * 15)
  43. VERSION_INFO_FILE = os.path.join(BASE_DIR, "superset", "static", "version_info.json")
  44. with open(VERSION_INFO_FILE, "w") as version_file:
  45. json.dump(version_info, version_file)
  46. setup(
  47. name="apache-superset",
  48. description=("A modern, enterprise-ready business intelligence web application"),
  49. long_description=long_description,
  50. long_description_content_type="text/markdown",
  51. version=version_string,
  52. packages=find_packages(),
  53. include_package_data=True,
  54. zip_safe=False,
  55. scripts=["superset/bin/superset"],
  56. install_requires=[
  57. "backoff>=1.8.0",
  58. "bleach>=3.0.2, <4.0.0",
  59. "celery>=4.3.0, <5.0.0",
  60. "click>=6.0, <7.0.0", # `click`>=7 forces "-" instead of "_"
  61. "colorama",
  62. "contextlib2",
  63. "croniter>=0.3.28",
  64. "cryptography>=2.4.2",
  65. "flask>=1.1.0, <2.0.0",
  66. "flask-appbuilder>=2.2.3, <2.3.0",
  67. "flask-caching",
  68. "flask-compress",
  69. "flask-talisman",
  70. "flask-migrate",
  71. "flask-wtf",
  72. "geopy",
  73. "gunicorn>=20.0.2, <20.1",
  74. "humanize",
  75. "isodate",
  76. "markdown>=3.0",
  77. "msgpack>=0.6.1, <0.7.0",
  78. "pandas>=0.25.3, <1.0",
  79. "parsedatetime",
  80. "pathlib2",
  81. "polyline",
  82. "python-dateutil",
  83. "python-dotenv",
  84. "python-geohash",
  85. "pyarrow>=0.15.1, <0.16.0",
  86. "pyyaml>=5.1",
  87. "retry>=0.9.2",
  88. "selenium>=3.141.0",
  89. "simplejson>=3.15.0",
  90. "sqlalchemy>=1.3.5, <2.0",
  91. "sqlalchemy-utils>=0.33.2",
  92. "sqlparse>=0.3.0, <0.4",
  93. "wtforms-json",
  94. ],
  95. extras_require={
  96. "bigquery": ["pybigquery>=0.4.10", "pandas_gbq>=0.10.0"],
  97. "cors": ["flask-cors>=2.0.0"],
  98. "gsheets": ["gsheetsdb>=0.1.9"],
  99. "hive": ["pyhive[hive]>=0.6.1", "tableschema", "thrift>=0.11.0, <1.0.0"],
  100. "mysql": ["mysqlclient==1.4.2.post1"],
  101. "postgres": ["psycopg2-binary==2.7.5"],
  102. "presto": ["pyhive[presto]>=0.4.0"],
  103. "elasticsearch": ["elasticsearch-dbapi>=0.1.0, <0.2.0"],
  104. "druid": ["pydruid==0.5.7", "requests==2.22.0"],
  105. "hana": ["hdbcli==2.4.162", "sqlalchemy_hana==0.4.0"],
  106. "dremio": ["sqlalchemy_dremio>=0.5.0dev0"],
  107. "cockroachdb": ["cockroachdb==0.3.3"],
  108. },
  109. python_requires="~=3.6",
  110. author="Apache Software Foundation",
  111. author_email="dev@superset.incubator.apache.org",
  112. url="https://superset.apache.org/",
  113. download_url="https://www.apache.org/dist/incubator/superset/" + version_string,
  114. classifiers=[
  115. "Programming Language :: Python :: 3.6",
  116. "Programming Language :: Python :: 3.7",
  117. ],
  118. tests_require=["flask-testing==0.7.1"],
  119. )