Skip to content

Fix to work with _api_request from Jupyterhub > 3 #255

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ repos:
# Lint: Checks that non-binary executables have a proper shebang.
- id: check-executables-have-shebangs


# pre-commit.ci config reference: https://pre-commit.ci/#configuration
ci:
autoupdate_schedule: monthly
12 changes: 8 additions & 4 deletions batchspawner/singleuser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import os
import sys
import asyncio
import json

from runpy import run_path
from shutil import which
Expand All @@ -14,10 +16,12 @@ def main(argv=None):
hub_auth.client_ca = os.environ.get("JUPYTERHUB_SSL_CLIENT_CA", "")
hub_auth.certfile = os.environ.get("JUPYTERHUB_SSL_CERTFILE", "")
hub_auth.keyfile = os.environ.get("JUPYTERHUB_SSL_KEYFILE", "")
hub_auth._api_request(
method="POST",
url=url_path_join(hub_auth.api_url, "batchspawner"),
json={"port": port},
asyncio.run(
hub_auth._api_request(
method="POST",
url=url_path_join(hub_auth.api_url, "batchspawner"),
body=json.dumps({"port": port}),
)
)

cmd_path = which(sys.argv[1])
Expand Down