From 3fd36a9fdd9eb78a658c153f925e1a6c99322438 Mon Sep 17 00:00:00 2001 From: Jiri Kuncar Date: Tue, 6 Mar 2018 17:48:12 +0100 Subject: [PATCH] setup: fix installation without extras (closes #132) --- renga/cli/notebooks.py | 3 ++- renga/cli/runner.py | 9 ++++----- setup.py | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/renga/cli/notebooks.py b/renga/cli/notebooks.py index 6bf32ec288..eb7ec6892c 100644 --- a/renga/cli/notebooks.py +++ b/renga/cli/notebooks.py @@ -21,7 +21,6 @@ from binascii import hexlify import click -from notebook.services.config import ConfigManager from renga.cli._options import option_endpoint @@ -52,6 +51,8 @@ def notebooks(): ) def configure(url, client_id): """Configure the Jupyter server extension.""" + from notebook.services.config import ConfigManager + cm = ConfigManager() cm.update('renga.notebook.oic', { 'client_id': client_id, diff --git a/renga/cli/runner.py b/renga/cli/runner.py index 2b5fb3a6c3..78d12d306e 100644 --- a/renga/cli/runner.py +++ b/renga/cli/runner.py @@ -27,8 +27,6 @@ import pkg_resources import yaml -from renga.notebook import generate_launch_args, generate_notebook_token - from ._client import pass_local_client _GITLAB_CI = '.gitlab-ci.yml' @@ -121,12 +119,13 @@ def default_base_url(): ) @click.option('--base-url', default=default_base_url) @click.option('--repo-url', envvar='CI_REPOSITORY_URL') -@click.option( - '--token', envvar='RENGA_NOTEBOOK_TOKEN', default=generate_notebook_token -) +@click.option('--token', envvar='RENGA_NOTEBOOK_TOKEN', default=None) @pass_local_client def notebook(client, name, network, image, base_url, repo_url, token): """Launch notebook in a container.""" + from renga.notebook import generate_launch_args, generate_notebook_token + + token = token if token is not None else generate_notebook_token() try: call(['docker', 'rm', '--force', name]) except Exception: diff --git a/setup.py b/setup.py index 1dac8ce8b5..d1412d9a1b 100644 --- a/setup.py +++ b/setup.py @@ -77,6 +77,7 @@ 'gitpython>=2.1.8', 'networkx>=2.1', 'pyld>=0.8.2', + 'python-dateutil>=2.6.1', 'requests-oauthlib>=0.8.0', 'requests>=2.18.4', 'tabulate>=0.7.7',