Set up pluggy before calling hooks in jupyter_config.py

This commit is contained in:
yuvipanda
2019-06-01 00:32:23 -07:00
parent b584bd1b2a
commit b7f72a9f9e

View File

@@ -4,6 +4,7 @@ JupyterHub config for the littlest jupyterhub.
from glob import glob from glob import glob
import os import os
import pluggy
from systemdspawner import SystemdSpawner from systemdspawner import SystemdSpawner
from tljh import configurer, user, hooks from tljh import configurer, user, hooks
@@ -58,7 +59,13 @@ tljh_config = configurer.load_config()
configurer.apply_config(tljh_config, c) configurer.apply_config(tljh_config, c)
# Let TLJH hooks modify `c` if they want # Let TLJH hooks modify `c` if they want
hooks.tljh_custom_jupyterhub_config(c)
# Set up plugin infrastructure
pm = pluggy.PluginManager('tljh')
pm.add_hookspecs(hooks)
pm.load_setuptools_entrypoints('tljh')
# Call our custom configuration plugin
pm.hook.tljh_custom_jupyterhub_config(c=c)
# Load arbitrary .py config files if they exist. # Load arbitrary .py config files if they exist.
# This is our escape hatch # This is our escape hatch