Skip to content

Commit

Permalink
Merge pull request #528 from minrk/pre-commit
Browse files Browse the repository at this point in the history
pre-commit autoupdate
  • Loading branch information
minrk authored Feb 12, 2025
2 parents 3befb25 + af7f08e commit adf9f43
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 12 deletions.
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

0 comments on commit adf9f43

Please sign in to comment.