def _alembic(args):
    """Run an alembic command with a temporary alembic.ini"""
    from .app import JupyterHub

    hub = JupyterHub()
    hub.load_config_file(hub.config_file)
    db_url = hub.db_url
    with _temp_alembic_ini(db_url) as alembic_ini:
        check_call(['alembic', '-c', alembic_ini] + args)
Run an alembic command with a temporary alembic.ini
jupyterhub/dbutil.py