Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 5, 2024
1 parent cb53610 commit 693ba30
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 9 deletions.
7 changes: 4 additions & 3 deletions binderhub/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The binderhub application
"""

import asyncio
import ipaddress
import json
Expand Down Expand Up @@ -865,9 +866,9 @@ def initialize(self, *args, **kwargs):
kubernetes.config.load_incluster_config()
except kubernetes.config.ConfigException:
kubernetes.config.load_kube_config()
self.tornado_settings[
"kubernetes_client"
] = self.kube_client = kubernetes.client.CoreV1Api()
self.tornado_settings["kubernetes_client"] = self.kube_client = (
kubernetes.client.CoreV1Api()
)

# times 2 for log + build threads
self.build_pool = ThreadPoolExecutor(self.concurrent_build_limit * 2)
Expand Down
1 change: 1 addition & 0 deletions binderhub/binderspawner_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Override the Z2JH hub with a custom image built in this repository
- Duplicate the code here and in binderhub/binderspawner_mixin.py
"""

from tornado import web
from traitlets import Bool, Unicode
from traitlets.config import Configurable
Expand Down
16 changes: 10 additions & 6 deletions binderhub/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,11 @@ async def get(self, provider_prefix, _unescaped_spec):
"ref": ref,
"status": "success",
"build_token": self._have_build_token,
"origin": self.settings["normalized_origin"]
if self.settings["normalized_origin"]
else self.request.host,
"origin": (
self.settings["normalized_origin"]
if self.settings["normalized_origin"]
else self.request.host
),
},
)
return
Expand Down Expand Up @@ -606,9 +608,11 @@ def _check_result(future):
"ref": ref,
"status": "success",
"build_token": self._have_build_token,
"origin": self.settings["normalized_origin"]
if self.settings["normalized_origin"]
else self.request.host,
"origin": (
self.settings["normalized_origin"]
if self.settings["normalized_origin"]
else self.request.host
),
},
)

Expand Down
1 change: 1 addition & 0 deletions binderhub/events.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Emit structured, discrete events when various actions happen.
"""

import json
import logging
from datetime import datetime
Expand Down
1 change: 1 addition & 0 deletions binderhub/launcher.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Launch an image with a temporary user via JupyterHub
"""

import asyncio
import base64
import json
Expand Down
1 change: 1 addition & 0 deletions binderhub/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Main handler classes for requests
"""

import time
import urllib.parse

Expand Down
1 change: 1 addition & 0 deletions binderhub/registry.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Interaction with the Docker Registry
"""

import base64
import json
import os
Expand Down
1 change: 1 addition & 0 deletions binderhub/repoproviders.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
.. note:: When adding a new repo provider, add it to the allowed values for
repo providers in event-schemas/launch.json.
"""

import asyncio
import json
import os
Expand Down
1 change: 1 addition & 0 deletions binderhub/tests/test_quota.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test launch quotas"""

import concurrent.futures
import json
from unittest import mock
Expand Down
1 change: 1 addition & 0 deletions binderhub/tests/test_registry.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the registry"""

import base64
import json
import os
Expand Down
1 change: 1 addition & 0 deletions binderhub/tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Testing utilities"""

import asyncio
import io
from concurrent.futures import ThreadPoolExecutor
Expand Down
1 change: 1 addition & 0 deletions binderhub/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Miscellaneous utilities"""

import ipaddress
import time
from collections import OrderedDict
Expand Down
1 change: 1 addition & 0 deletions helm-chart/binderhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ jupyterhub:
- Override the Z2JH hub with a custom image built in this repository
- Duplicate the code here and in binderhub/binderspawner_mixin.py
"""
from tornado import web
from traitlets import Bool, Unicode
from traitlets.config import Configurable
Expand Down
1 change: 1 addition & 0 deletions testing/local-binder-local-hub/binderhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
environment variable JUPYTERHUB_EXTERNAL_URL
Host IP is needed in a few places
"""

import os
import socket

Expand Down
1 change: 1 addition & 0 deletions testing/local-binder-local-hub/jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Run `jupyterhub --config=binderhub_config.py` terminal
Host IP is needed in a few places
"""

import os
import socket

Expand Down

0 comments on commit 693ba30

Please sign in to comment.