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 0dac928 commit 01be5c2
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions kubespawner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
in your `jupyterhub_config.py` file.
"""

# We export KubeSpawner specifically here. This simplifies import for users.
# Users can simply import kubespawner.KubeSpawner in their applications
# instead of the more verbose import kubespawner.spawner.KubeSpawner.
Expand Down
1 change: 1 addition & 0 deletions kubespawner/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
The instances of these REST API clients are also patched to avoid the creation
of unused threads.
"""

import asyncio
from concurrent.futures import ThreadPoolExecutor
from functools import lru_cache
Expand Down
9 changes: 6 additions & 3 deletions kubespawner/objects.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Helper methods for generating k8s API objects.
"""

import base64
import ipaddress
import json
Expand Down Expand Up @@ -353,9 +354,11 @@ def make_pod(
# be a list, but it is allowed to have "a-string" elements or {"name":
# "a-string"} elements.
pod.spec.image_pull_secrets = [
V1LocalObjectReference(name=secret_ref)
if type(secret_ref) == str
else get_k8s_model(V1LocalObjectReference, secret_ref)
(
V1LocalObjectReference(name=secret_ref)
if type(secret_ref) == str
else get_k8s_model(V1LocalObjectReference, secret_ref)
)
for secret_ref in image_pull_secrets
]

Expand Down
1 change: 1 addition & 0 deletions kubespawner/spawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This module exports `KubeSpawner` class, which is the actual spawner
implementation that should be used by JupyterHub.
"""

import asyncio
import copy
import ipaddress
Expand Down
1 change: 1 addition & 0 deletions kubespawner/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Misc. general utility functions, not tied to KubeSpawner directly
"""

import copy
import hashlib

Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""pytest fixtures for kubespawner"""

import asyncio
import base64
import inspect
Expand Down
1 change: 1 addition & 0 deletions tests/jupyterhub_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Minimal jupyterhub config for hub pod"""

import json
import os
import socket
Expand Down
1 change: 1 addition & 0 deletions tests/test_objects.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test functions used to create k8s objects
"""

import pytest
from kubernetes_asyncio.client import ApiClient

Expand Down

0 comments on commit 01be5c2

Please sign in to comment.