Skip to content

Commit

Permalink
Merge pull request #823 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 4aeea8d + 01be5c2 commit f99b98f
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:

# Autoformat: Python code
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black

Expand Down Expand Up @@ -57,7 +57,7 @@ repos:

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

Expand Down
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 f99b98f

Please sign in to comment.