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 autoupdate #528

Merged
merged 2 commits into from
Feb 12, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ src

# Pycharm
.idea
.DS_Store

# test files
.pytest_cache
Expand Down
16 changes: 9 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
repos:
# Autoformat: Python code, syntax patterns are modernized
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.19.1
hooks:
- id: pyupgrade
args:
- --py38-plus

# Autoformat: Python code
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.1
rev: v2.3.1
hooks:
- id: autoflake
# args ref: https://github.com/PyCQA/autoflake#advanced-usage
Expand All @@ -26,13 +26,13 @@ repos:

# Autoformat: Python
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 6.0.0
hooks:
- id: isort

# Autoformat: Python
- repo: https://github.com/psf/black
rev: 23.10.1
rev: 25.1.0
hooks:
- id: black

Expand All @@ -41,22 +41,24 @@ repos:
rev: v6.2.1
hooks:
- id: beautysh
additional_dependencies:
- setuptools

# Autoformat: markdown, yaml
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v4.0.0-alpha.8
hooks:
- id: prettier

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

# Misc autoformatting and linting
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: requirements-txt-fixer
Expand Down
1 change: 1 addition & 0 deletions dockerspawner/dockerspawner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A Spawner for JupyterHub that runs each user's server in a separate docker container
"""

import asyncio
import inspect
import json
Expand Down
7 changes: 4 additions & 3 deletions dockerspawner/swarmspawner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A Spawner for JupyterHub that runs each user's server in a separate docker service
"""

import asyncio
from pprint import pformat
from textwrap import dedent
Expand Down Expand Up @@ -201,9 +202,9 @@ async def create_object(self):
mem_limit=self.mem_limit,
mem_reservation=self.mem_guarantee,
cpu_limit=int(self.cpu_limit * 1e9) if self.cpu_limit else None,
cpu_reservation=int(self.cpu_guarantee * 1e9)
if self.cpu_guarantee
else None,
cpu_reservation=(
int(self.cpu_guarantee * 1e9) if self.cpu_guarantee else None
),
)
resources_kwargs.update(self.extra_resources_spec)
resources_spec = Resources(**resources_kwargs)
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 config for dockerspawner tests"""

import inspect
import json
import os
Expand Down
1 change: 1 addition & 0 deletions tests/test_dockerspawner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for DockerSpawner class"""

import asyncio
import json
import logging
Expand Down
1 change: 1 addition & 0 deletions tests/test_swarmspawner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for SwarmSpawner"""

import asyncio

from jupyterhub.tests.mocking import public_url
Expand Down
1 change: 1 addition & 0 deletions tests/test_systemuserspawner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for SwarmSpawner"""

from getpass import getuser

from jupyterhub.tests.mocking import public_url
Expand Down
3 changes: 1 addition & 2 deletions tests/volumes_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Test volume manipulation logic
"""
"""Test volume manipulation logic"""

import types

Expand Down
Loading