Merge pull request #208 from bigchaindb/feat/204/print-version-number

Feat/204/print version number
This commit is contained in:
Rodolphe Marques 2016-04-21 17:04:47 +02:00
commit 6da2603e28
5 changed files with 23 additions and 5 deletions

View File

@ -37,4 +37,4 @@ config = {
# for more info.
_config = copy.deepcopy(config)
from bigchaindb.core import Bigchain # noqa
from bigchaindb.version import __version__ # noqa

View File

@ -5,6 +5,8 @@ for ``argparse.ArgumentParser``.
import argparse
import multiprocessing as mp
from bigchaindb.version import __version__
def start(parser, scope):
"""Utility function to execute a subcommand.
@ -46,7 +48,7 @@ def start(parser, scope):
func(args)
base_parser = argparse.ArgumentParser(add_help=False)
base_parser = argparse.ArgumentParser(add_help=False, prog='bigchaindb')
base_parser.add_argument('-c', '--config',
help='Specify the location of the configuration file')
@ -55,3 +57,7 @@ base_parser.add_argument('-y', '--yes', '--yes-please',
action='store_true',
help='Assume "yes" as answer to all prompts and run '
'non-interactively')
base_parser.add_argument('-v', '--version',
action='version',
version='%(prog)s {}'.format(__version__))

2
bigchaindb/version.py Normal file
View File

@ -0,0 +1,2 @@
__version__ = '0.1.5'
__short_version__ = '0.1'

View File

@ -30,6 +30,11 @@ from recommonmark.parser import CommonMarkParser
# ones.
import sphinx_rtd_theme
# get version
_version = {}
with open('../../bigchaindb/version.py') as fp:
exec(fp.read(), _version)
extensions = [
'sphinx.ext.autodoc',
@ -69,9 +74,9 @@ author = 'BigchainDB Contributors'
# built documents.
#
# The short X.Y version.
version = '0.1'
version = _version['__short_version__']
# The full version, including alpha/beta/rc tags.
release = '0.1.5'
release = _version['__version__']
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View File

@ -6,6 +6,11 @@ For full docs visit https://bigchaindb.readthedocs.org
"""
from setuptools import setup, find_packages
# get the version
version = {}
with open('bigchaindb/version.py') as fp:
exec(fp.read(), version)
tests_require = [
'pytest',
'coverage',
@ -32,7 +37,7 @@ docs_require = [
setup(
name='BigchainDB',
version='0.1.5',
version=version['__version__'],
description='BigchainDB: A Scalable Blockchain Database',
long_description=__doc__,
url='https://github.com/BigchainDB/bigchaindb/',