Allow passing in traitlets via commandline
Without this, you *always* needed a repo2docker_config.py
file to configure anything. This PR makes r2d match the
behavior of most traitlets based applications (like jupyter_server,
jupyterhub, nbconvert, etc)
Fixes
MODIFY
repo2docker/__main__.py
repo2docker/__main__.py
@@ -251,9 +251,10 @@ def make_r2d(argv=None):
print(__version__)
sys.exit(0)
- args = get_argparser().parse_args(argv)
+ args, traitlet_args = get_argparser().parse_known_args(argv)
r2d = Repo2Docker()
+ r2d.parse_command_line(traitlet_args)
if args.debug:
r2d.log_level = logging.DEBUG

MODIFY
repo2docker/app.py
repo2docker/app.py
@@ -490,7 +490,7 @@ class Repo2Docker(Application):
extra=dict(phase="failed"),
)
- def initialize(self):
+ def initialize(self, *args, **kwargs):
"""Init repo2docker configuration before start"""
# FIXME: Remove this function, move it to setters / traitlet reactors
if self.json_logs:

Allow passing in traitlets via commandline

Without this, you *always* needed a repo2docker_config.py
file to configure anything. This PR makes r2d match the
behavior of most traitlets based applications (like jupyter_server,
jupyterhub, nbconvert, etc)

Fixes https://github.com/jupyterhub/repo2docker/issues/1112