mirror of https://github.com/apache/superset.git
Adding version subcommand to CLI (#329)
This commit is contained in:
parent
21b3a5f199
commit
0a94b36d3d
|
@ -13,6 +13,8 @@ from flask.ext.appbuilder.baseviews import expose
|
||||||
from flask.ext.cache import Cache
|
from flask.ext.cache import Cache
|
||||||
from flask.ext.migrate import Migrate
|
from flask.ext.migrate import Migrate
|
||||||
|
|
||||||
|
VERSION = '0.8.6'
|
||||||
|
|
||||||
APP_DIR = os.path.dirname(__file__)
|
APP_DIR = os.path.dirname(__file__)
|
||||||
CONFIG_MODULE = os.environ.get('CARAVEL_CONFIG', 'caravel.config')
|
CONFIG_MODULE = os.environ.get('CARAVEL_CONFIG', 'caravel.config')
|
||||||
|
|
||||||
|
|
|
@ -71,3 +71,12 @@ stacktrace="""
|
||||||
=======================================================================================================
|
=======================================================================================================
|
||||||
-------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
boat = """\
|
||||||
|
+ +
|
||||||
|
)`.).
|
||||||
|
)``)``) .~~
|
||||||
|
).-'.-')|)
|
||||||
|
|-).-).-'_'-/
|
||||||
|
~~~\ `o-o-o' /~~~~
|
||||||
|
~~~'---.____/~~~"""
|
||||||
|
|
|
@ -7,14 +7,13 @@ from __future__ import unicode_literals
|
||||||
import logging
|
import logging
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from subprocess import Popen
|
from subprocess import Popen
|
||||||
|
import textwrap
|
||||||
|
|
||||||
from flask.ext.migrate import MigrateCommand
|
from flask.ext.migrate import MigrateCommand
|
||||||
from flask.ext.script import Manager
|
from flask.ext.script import Manager
|
||||||
|
|
||||||
import caravel
|
import caravel
|
||||||
from caravel import app
|
from caravel import app, ascii_art, db, data, utils
|
||||||
from caravel import data, utils
|
|
||||||
from caravel import db
|
|
||||||
|
|
||||||
config = app.config
|
config = app.config
|
||||||
|
|
||||||
|
@ -57,6 +56,17 @@ def init():
|
||||||
"""Inits the Caravel application"""
|
"""Inits the Caravel application"""
|
||||||
utils.init(caravel)
|
utils.init(caravel)
|
||||||
|
|
||||||
|
@manager.command
|
||||||
|
def version():
|
||||||
|
"""Prints the current version number"""
|
||||||
|
s = (
|
||||||
|
"\n{boat}\n\n"
|
||||||
|
"-----------------------\n"
|
||||||
|
"Caravel {version}\n"
|
||||||
|
"-----------------------\n").format(
|
||||||
|
boat=ascii_art.boat, version=caravel.VERSION)
|
||||||
|
print(s)
|
||||||
|
|
||||||
@manager.option(
|
@manager.option(
|
||||||
'-s', '--sample', action='store_true',
|
'-s', '--sample', action='store_true',
|
||||||
help="Only load 1000 rows (faster, used for testing)")
|
help="Only load 1000 rows (faster, used for testing)")
|
||||||
|
|
7
setup.py
7
setup.py
|
@ -1,13 +1,14 @@
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
version = '0.8.6'
|
VERSION = '0.8.6'
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='caravel',
|
name='caravel',
|
||||||
description=(
|
description=(
|
||||||
"A interactive data visualization platform build on SqlAlchemy "
|
"A interactive data visualization platform build on SqlAlchemy "
|
||||||
"and druid.io"),
|
"and druid.io"),
|
||||||
version=version,
|
version=VERSION,
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
|
@ -40,5 +41,5 @@ setup(
|
||||||
author_email='maximebeauchemin@gmail.com',
|
author_email='maximebeauchemin@gmail.com',
|
||||||
url='https://github.com/airbnb/caravel',
|
url='https://github.com/airbnb/caravel',
|
||||||
download_url=(
|
download_url=(
|
||||||
'https://github.com/airbnb/caravel/tarball/' + version),
|
'https://github.com/airbnb/caravel/tarball/' + VERSION),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue