Skip to content

Commit

Permalink
fixes to automatic versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
o-smirnov committed Nov 17, 2020
1 parent e8ca093 commit 0932105
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
8 changes: 4 additions & 4 deletions bin/run-radiopadre
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ from collections import OrderedDict
# ### some globals
import iglesia
from radiopadre_client import config, sessions
from radiopadre_client.default_config import __version__
from radiopadre_client.default_config import __version__, __release__, __tag_prefix__

from iglesia.utils import message, debug, bye, ff, INPUT

from iglesia import logger

parser = argparse.ArgumentParser(description="""
run-radiopadre (v{}): manage local or remote Jupyter sessions for radiopadre notebooks.
""".format(__version__),
run-radiopadre ({}{}): manage local or remote Jupyter sessions for radiopadre notebooks.
""".format(__tag_prefix__, __version__),
formatter_class=argparse.RawTextHelpFormatter)

parser.add_argument("-b", "--browser", type=str, metavar="COMMAND[:OPT[:OPT...]]", default=config.DEFAULT_VALUE,
Expand Down Expand Up @@ -179,7 +179,7 @@ logger.init('radiopadre.client', boring=options.boring or options.non_interactiv
if options.non_interactive:
logger.logger.setLevel(logging.ERROR)

message("Welcome to the radiopadre client version {}!".format(__version__), color="GREEN")
message("Welcome to the radiopadre client {} {}!".format("release" if __release__ else "dev version", __version__), color="GREEN")

# recent session management: only done for front-end sessions
manage_last_sessions = not options.remote and not options.inside_container and not options.non_interactive \
Expand Down
2 changes: 1 addition & 1 deletion radiopadre_client/backends/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def update_installation(enable_pull=False):
docker_image = config.DOCKER_IMAGE
if check_output(ff("docker image inspect {docker_image}")) is None:
if not enable_pull:
bye(ff(" Radiopadre docker image {docker_image} not found. Re-run with --update perhaps?"))
bye(ff(" Radiopadre docker image {docker_image} not found. Re-run with --update or --auto-init perhaps?"))
message(ff(" Radiopadre docker image {docker_image} not found locally"))
else:
message(ff(" Using radiopadre docker image {docker_image}"))
Expand Down
23 changes: 19 additions & 4 deletions radiopadre_client/default_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections import OrderedDict


# This defines default values for the config settings, which will also be propagated into the
# ArgumentParser, and saved to/loaded from {config.CONFIG_FILE}

Expand All @@ -10,8 +11,22 @@
# registered default is None, or a "--no-option" argument is the registered default is 0

import os.path
import re

# change this to a proper patch release number for a real release
__version__ = "1.1.x"

# if True, this is a stable release e.g. 1.1.0. If False, this is an dev version e.g. 1.1.x
__release__ = re.match("^(\d+)\.(\d+)\.(d+)$", __version__)

# git tag or branch to use: vXXX for releases and bXXX for devs
__tag_prefix__ = "v" if __release__ else "b"

__version__ = "1.1.0"
# release x.y.z pulls x.y.latest image
if __release__:
__image_version__ = ".".join([__release__.group(1), __release__.group(2), "latest"])
else:
__image_version__ = __version__

DefaultConfig = OrderedDict(
AUTO_LOAD="radiopadre-auto.ipynb",
Expand All @@ -22,17 +37,17 @@
CARTA_BROWSER=True,
CONTAINER_DEV=False,
DEFAULT_NOTEBOOK="radiopadre-default.ipynb",
DOCKER_IMAGE="osmirnov/radiopadre:1.1.0", # change for each release
DOCKER_IMAGE="osmirnov/radiopadre:" + __image_version__, # change for each release
CONTAINER_DEBUG=False,
GRIM_REAPER=True,
REMOTE_RADIOPADRE_DIR="~/.radiopadre",
CLIENT_INSTALL_PATH="~/radiopadre-client",
CLIENT_INSTALL_REPO="", #"https://github.com/ratt-ru/radiopadre-client.git", # empty for pip release
CLIENT_INSTALL_BRANCH="b1.1.0", # change for each release
CLIENT_INSTALL_BRANCH=__tag_prefix__ + __version__, # change for each release
CLIENT_INSTALL_PIP="radiopadre-client",
SERVER_INSTALL_PATH="~/radiopadre",
SERVER_INSTALL_REPO="", #"https://github.com/ratt-ru/radiopadre.git", # empty for pip release
SERVER_INSTALL_BRANCH="b1.1.0", # change for each release
SERVER_INSTALL_BRANCH=__tag_prefix__ + __version__, # change for each release
SERVER_INSTALL_PIP="radiopadre",
SINGULARITY_IMAGE_DIR="",
SINGULARITY_AUTO_BUILD=True,
Expand Down

0 comments on commit 0932105

Please sign in to comment.