New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load arbitrary .py config files from a conf.d dir #87
Conversation
tljh/jupyterhub_config.py
Outdated
|
||
# Load arbitrary .py config files if they exist. | ||
# This is our escape hatch | ||
extra_configs = sorted(glob(os.path.join(INSTALL_PREFIX, 'config.d', '*.py'))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's call it 'jupyterhub_config.d' to make it clearer that it's really jupyterhub_config.py
split into multiple files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, @minrk! Will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh - does .d
indicate for historial reasons that a file is a partial file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@consideRatio yep! I picked it up from linux distros like debian - you have a /etc/sudoers file and a /etc/sudoers.d directory that can contain partials.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! I love when a piece like that falls into place! ❤️ @minrk @yuvipanda
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's even a plan to support this directly in traitlets by default, so we could get this for free in the future. There the pattern is exactly: anywhere you find app_config.py
, also look in app_config.d
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, @minrk
Should we create the |
@minrk since i consider this an 'advanced use case', I think it's fine to not do that. But I'll add a note to the docs about needing to create the directory. |
We want to keep the amount of custom code we support extremely small. This provides a nice escape hatch for everything else.
Makes it clearer that these are jupyterhub_config.py snippets rather than config.yaml snippets
No tests for this, need to land #97 first. |
We want to keep the amount of custom code we support extremely
small. This provides a nice escape hatch for everything else.