mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
Adding a way to see the git SHA from the website (#1956)
* Adding a way to see the git SHA from the website * Fixing py3 bug
This commit is contained in:
committed by
GitHub
parent
470a6e9d76
commit
0ce7fc18a8
24
setup.py
24
setup.py
@@ -1,5 +1,5 @@
|
||||
import imp
|
||||
import os
|
||||
import subprocess
|
||||
import json
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
@@ -9,6 +9,28 @@ PACKAGE_FILE = os.path.join(PACKAGE_DIR, 'package.json')
|
||||
with open(PACKAGE_FILE) as package_file:
|
||||
version_string = json.load(package_file)['version']
|
||||
|
||||
|
||||
def get_git_sha():
|
||||
try:
|
||||
s = str(subprocess.check_output(['git', 'rev-parse', 'HEAD']))
|
||||
return s.strip()
|
||||
except:
|
||||
pass
|
||||
|
||||
GIT_SHA = get_git_sha()
|
||||
version_info = {
|
||||
'GIT_SHA': GIT_SHA,
|
||||
'version': version_string,
|
||||
}
|
||||
print("-==-" * 15)
|
||||
print("VERSION: " + version_string)
|
||||
print("GIT SHA: " + GIT_SHA)
|
||||
print("-==-" * 15)
|
||||
|
||||
with open(os.path.join(PACKAGE_DIR, 'version_info.json'), 'w') as version_file:
|
||||
json.dump(version_info, version_file)
|
||||
|
||||
|
||||
setup(
|
||||
name='superset',
|
||||
description=(
|
||||
|
||||
Reference in New Issue
Block a user