Skip to content

Commit

Permalink
bumping version and adding CLI for version (jupyter-book#242)
Browse files Browse the repository at this point in the history
bumping version and adding CLI for version
  • Loading branch information
choldgraf authored Jul 26, 2019
2 parents 5a90d18 + 8a09b31 commit 467494d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jupyter_book/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""Build an online book using Jupyter Notebooks and Jekyll."""
__version__ = "0.5.2dev0"
__version__ = "0.5.2"
1 change: 1 addition & 0 deletions jupyter_book/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
from .create import create
from .upgrade import upgrade
from .run import run
from .version import version
9 changes: 9 additions & 0 deletions jupyter_book/commands/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import sys
import argparse
from jupyter_book import __version__

def version():
parser = argparse.ArgumentParser(
description="Print the version of Jupyter Book currently in-use.")

print("Running Jupyter Book version: {}".format(__version__))
5 changes: 3 additions & 2 deletions jupyter_book/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import argparse

from .commands import build, create, upgrade
from .commands import build, create, upgrade, version
from .run import run_book
from .toc import build_toc

Expand All @@ -12,7 +12,8 @@
'build': build,
'upgrade': upgrade,
'run': run_book,
'toc': build_toc}
'toc': build_toc,
'version': version}
parser = argparse.ArgumentParser(description=DESCRIPTION)
parser.add_argument("command", help="The command you'd like to run. Allowed commands: {}".format(
list(commands.keys())))
Expand Down

0 comments on commit 467494d

Please sign in to comment.