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.migrate import Migrate
|
||||
|
||||
VERSION = '0.8.6'
|
||||
|
||||
APP_DIR = os.path.dirname(__file__)
|
||||
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
|
||||
from datetime import datetime
|
||||
from subprocess import Popen
|
||||
import textwrap
|
||||
|
||||
from flask.ext.migrate import MigrateCommand
|
||||
from flask.ext.script import Manager
|
||||
|
||||
import caravel
|
||||
from caravel import app
|
||||
from caravel import data, utils
|
||||
from caravel import db
|
||||
from caravel import app, ascii_art, db, data, utils
|
||||
|
||||
config = app.config
|
||||
|
||||
|
@ -57,6 +56,17 @@ def init():
|
|||
"""Inits the Caravel application"""
|
||||
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(
|
||||
'-s', '--sample', action='store_true',
|
||||
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
|
||||
|
||||
version = '0.8.6'
|
||||
VERSION = '0.8.6'
|
||||
|
||||
|
||||
setup(
|
||||
name='caravel',
|
||||
description=(
|
||||
"A interactive data visualization platform build on SqlAlchemy "
|
||||
"and druid.io"),
|
||||
version=version,
|
||||
version=VERSION,
|
||||
packages=find_packages(),
|
||||
include_package_data=True,
|
||||
zip_safe=False,
|
||||
|
@ -40,5 +41,5 @@ setup(
|
|||
author_email='maximebeauchemin@gmail.com',
|
||||
url='https://github.com/airbnb/caravel',
|
||||
download_url=(
|
||||
'https://github.com/airbnb/caravel/tarball/' + version),
|
||||
'https://github.com/airbnb/caravel/tarball/' + VERSION),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue