Skip to content

Commit

Permalink
Allow passing in traitlets via commandline
Browse files Browse the repository at this point in the history
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 jupyterhub#1112
  • Loading branch information
yuvipanda committed Jan 26, 2022
1 parent 6ab41ef commit 885cb46
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion repo2docker/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion repo2docker/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ def json_excepthook(self, etype, evalue, traceback):
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:
Expand Down

0 comments on commit 885cb46

Please sign in to comment.