Skip to content

Commit

Permalink
Merge pull request #1823 from jupyterhub/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
consideRatio authored Feb 6, 2024
2 parents 160f80b + 693ba30 commit 45ad8fa
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:

# Autoformat: Python code
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
# args are not passed, but see the config in pyproject.toml
Expand Down Expand Up @@ -71,7 +71,7 @@ repos:

# Lint: Python code
- repo: https://github.com/PyCQA/flake8
rev: "6.1.0"
rev: "7.0.0"
hooks:
- id: flake8

Expand Down
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 45ad8fa

Please sign in to comment.