2019-01-15 18:53:27 -05:00
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one
|
|
|
|
# or more contributor license agreements. See the NOTICE file
|
|
|
|
# distributed with this work for additional information
|
|
|
|
# regarding copyright ownership. The ASF licenses this file
|
|
|
|
# to you under the Apache License, Version 2.0 (the
|
|
|
|
# "License"); you may not use this file except in compliance
|
|
|
|
# with the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing,
|
|
|
|
# software distributed under the License is distributed on an
|
|
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
# KIND, either express or implied. See the License for the
|
|
|
|
# specific language governing permissions and limitations
|
|
|
|
# under the License.
|
2017-11-07 23:23:40 -05:00
|
|
|
import json
|
2016-06-09 21:05:58 -04:00
|
|
|
import os
|
2017-01-12 15:32:06 -05:00
|
|
|
import subprocess
|
2017-11-07 23:23:40 -05:00
|
|
|
|
|
|
|
from setuptools import find_packages, setup
|
2015-09-05 12:23:46 -04:00
|
|
|
|
2016-09-15 20:20:18 -04:00
|
|
|
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
|
2020-02-09 20:53:56 -05:00
|
|
|
PACKAGE_JSON = os.path.join(BASE_DIR, "superset-frontend", "package.json")
|
2022-03-30 03:13:09 -04:00
|
|
|
|
2024-04-15 17:44:47 -04:00
|
|
|
|
2023-06-01 15:01:10 -04:00
|
|
|
with open(PACKAGE_JSON) as package_file:
|
2019-06-25 16:34:48 -04:00
|
|
|
version_string = json.load(package_file)["version"]
|
2015-09-05 12:23:46 -04:00
|
|
|
|
2017-01-12 15:32:06 -05:00
|
|
|
|
2021-07-21 14:46:43 -04:00
|
|
|
def get_git_sha() -> str:
|
2017-01-12 15:32:06 -05:00
|
|
|
try:
|
2024-04-25 10:58:44 -04:00
|
|
|
output = subprocess.check_output(["git", "rev-parse", "HEAD"])
|
|
|
|
return output.decode().strip()
|
|
|
|
except Exception: # pylint: disable=broad-except
|
2019-06-25 16:34:48 -04:00
|
|
|
return ""
|
2017-01-12 15:32:06 -05:00
|
|
|
|
2017-11-10 20:52:34 -05:00
|
|
|
|
2017-01-12 15:32:06 -05:00
|
|
|
GIT_SHA = get_git_sha()
|
2019-06-25 16:34:48 -04:00
|
|
|
version_info = {"GIT_SHA": GIT_SHA, "version": version_string}
|
|
|
|
print("-==-" * 15)
|
|
|
|
print("VERSION: " + version_string)
|
|
|
|
print("GIT SHA: " + GIT_SHA)
|
|
|
|
print("-==-" * 15)
|
2017-01-12 15:32:06 -05:00
|
|
|
|
2020-02-12 10:48:24 -05:00
|
|
|
VERSION_INFO_FILE = os.path.join(BASE_DIR, "superset", "static", "version_info.json")
|
2019-09-11 01:25:58 -04:00
|
|
|
|
|
|
|
with open(VERSION_INFO_FILE, "w") as version_file:
|
2017-01-12 15:32:06 -05:00
|
|
|
json.dump(version_info, version_file)
|
|
|
|
|
2024-04-02 19:53:14 -04:00
|
|
|
# translating 'no version' from npm to pypi to prevent warning msg
|
|
|
|
version_string = version_string.replace("-dev", ".dev0")
|
|
|
|
|
2015-09-05 12:23:46 -04:00
|
|
|
setup(
|
2016-09-15 20:20:18 -04:00
|
|
|
version=version_string,
|
2015-09-05 12:23:46 -04:00
|
|
|
packages=find_packages(),
|
|
|
|
include_package_data=True,
|
|
|
|
zip_safe=False,
|
2022-02-11 20:40:20 -05:00
|
|
|
entry_points={
|
|
|
|
"console_scripts": ["superset=superset.cli.main:superset"],
|
2022-08-10 21:07:31 -04:00
|
|
|
# the `postgres` and `postgres+psycopg2://` schemes were removed in SQLAlchemy 1.4
|
|
|
|
# add an alias here to prevent breaking existing databases
|
2022-07-29 16:03:41 -04:00
|
|
|
"sqlalchemy.dialects": [
|
2022-08-10 21:07:31 -04:00
|
|
|
"postgres.psycopg2 = sqlalchemy.dialects.postgresql:dialect",
|
|
|
|
"postgres = sqlalchemy.dialects.postgresql:dialect",
|
2023-08-18 15:21:36 -04:00
|
|
|
"superset = superset.extensions.metadb:SupersetAPSWDialect",
|
|
|
|
],
|
|
|
|
"shillelagh.adapter": [
|
|
|
|
"superset=superset.extensions.metadb:SupersetShillelaghAdapter"
|
2022-07-29 16:03:41 -04:00
|
|
|
],
|
2022-02-11 20:40:20 -05:00
|
|
|
},
|
2021-01-06 06:45:19 -05:00
|
|
|
download_url="https://www.apache.org/dist/superset/" + version_string,
|
2015-09-05 12:23:46 -04:00
|
|
|
)
|