def _load_jupyterhub_info():
    """
    The equivalent of

        from jupyterhub import __version__
        from jupyterhub.scopes import scope_definitions

    but without needing to install JupyterHub and dependencies
    so that we can run this pre-commit
    """
    root = HERE / ".." / ".." / ".."
    g = {}
    exec((root / "jupyterhub" / "_version.py").read_text(), g)

    # To avoid parsing the whole of scope_definitions.py just pull out
    # the relevant lines
    scopes_file = root / "jupyterhub" / "scopes.py"
    scopes_lines = []
    for line in scopes_file.read_text().splitlines():
        if not scopes_lines and line == "scope_definitions = {":
            scopes_lines.append(line)
        elif scopes_lines:
            scopes_lines.append(line)
            if line == "}":
                break

    exec("\n".join(scopes_lines), g)

    return g["__version__"], g["scope_definitions"]
The equivalent of

from jupyterhub import __version__
from jupyterhub.scopes import scope_definitions

but without needing to install JupyterHub and dependencies
so that we can run this pre-commit
docs/source/rbac/generate-scope-table.py