Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#24)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](pre-commit/pre-commit-hooks@v4.4.0...v4.5.0)
- [github.com/psf/black: 23.9.1 → 23.11.0](psf/black@23.9.1...23.11.0)
- [github.com/codespell-project/codespell: v2.2.5 → v2.2.6](codespell-project/codespell@v2.2.5...v2.2.6)
- [github.com/astral-sh/ruff-pre-commit: v0.0.290 → v0.1.6](astral-sh/ruff-pre-commit@v0.0.290...v0.1.6)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Nov 23, 2023
1 parent 0ce3fc7 commit 4f7b349
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -21,7 +21,7 @@ repos:
- id: sort-simple-yaml
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.9.1
rev: 23.11.0
hooks:
- id: black
additional_dependencies: [".[jupyter]"]
Expand All @@ -31,13 +31,13 @@ repos:
hooks:
- id: isort
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies: ["tomli"]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.0.290'
rev: 'v0.1.6'
hooks:
- id: ruff
args: ['--fix']
Expand Down
1 change: 1 addition & 0 deletions tests/test_AutomaticInit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for the automatic __init__."""

import datetime

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_descriptor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test ZnInit descriptors."""

import pytest

from zninit import Descriptor, get_descriptors
Expand Down
1 change: 1 addition & 0 deletions tests/test_i_zninit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""General 'ZnInit' integration tests."""

import pytest

import zninit
Expand Down
1 change: 1 addition & 0 deletions tests/test_subclass_automatic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test subclass handling."""

import pytest

from zninit import Descriptor, ZnInit
Expand Down
1 change: 1 addition & 0 deletions tests/test_u_core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""'ZnInit' unit tests."""

from zninit import Descriptor, ZnInit
from zninit.core import _get_auto_init_kwargs, get_args_type_error, get_init_type_error

Expand Down
1 change: 1 addition & 0 deletions tests/test_u_descriptor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Unit tests for 'ZnInit'."""

import collections.abc
import sys
import typing
Expand Down
1 change: 1 addition & 0 deletions zninit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""ZnInit Package for automatic __init__ generation."""

import importlib.metadata

from zninit.core import ZnInit
Expand Down
7 changes: 4 additions & 3 deletions zninit/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functionality to generate the automatic __init__."""

from __future__ import annotations

import logging
Expand Down Expand Up @@ -142,9 +143,9 @@ def auto_init(self, *args, **kwargs): # noqa: C901
if kwarg_name not in priority_kwargs:
required_keys.append(kwarg_name)

init_kwargs.update(
{name: kwargs.pop(name, value) for name, value in kwargs_with_default.items()}
)
init_kwargs.update({
name: kwargs.pop(name, value) for name, value in kwargs_with_default.items()
})
super_init(self, **kwargs) # call the super_init explicitly instead of super
# must call the super_init first e.g. it is required to set the node_name

Expand Down
1 change: 1 addition & 0 deletions zninit/descriptor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Definition and utils for the Descriptor class."""

from __future__ import annotations

import contextlib
Expand Down

0 comments on commit 4f7b349

Please sign in to comment.