Skip to content
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

[pre-commit.ci] pre-commit autoupdate #823

Merged
merged 2 commits into from
Feb 6, 2024
Merged
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
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
Loading