From dad9ed2d07e181bad500de534271739e16665cc7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 20:17:43 -0400 Subject: [PATCH] chore: update pre-commit hooks (#237) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update pre-commit hooks updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) - [github.com/astral-sh/ruff-pre-commit: v0.4.1 → v0.4.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.1...v0.4.10) - [github.com/pre-commit/mirrors-mypy: v1.9.0 → v1.10.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.9.0...v1.10.0) - [github.com/codespell-project/codespell: v2.2.6 → v2.3.0](https://github.com/codespell-project/codespell/compare/v2.2.6...v2.3.0) * style: pre-commit fixes * chore: update pre-commit hooks updates: - [github.com/psf/black: 24.4.2 → 24.8.0](https://github.com/psf/black/compare/24.4.2...24.8.0) - [github.com/astral-sh/ruff-pre-commit: v0.5.0 → v0.5.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.0...v0.5.6) - [github.com/pre-commit/mirrors-mypy: v1.10.1 → v1.11.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.1...v1.11.1) * Fix is None pre-commit check * test revert * test is instead of equality --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Connor Stone --- .pre-commit-config.yaml | 6 +++--- src/caustics/models/utils.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 74056e63..145fbad3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ ci: repos: - repo: https://github.com/psf/black - rev: "24.4.2" + rev: "24.8.0" hooks: - id: black-jupyter @@ -51,13 +51,13 @@ repos: args: [--prose-wrap=always] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.0" + rev: "v0.5.6" hooks: - id: ruff args: ["--fix", "--show-fixes"] - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v1.10.1" + rev: "v1.11.1" hooks: - id: mypy files: src diff --git a/src/caustics/models/utils.py b/src/caustics/models/utils.py index 27060b75..6626e691 100644 --- a/src/caustics/models/utils.py +++ b/src/caustics/models/utils.py @@ -150,7 +150,7 @@ def _init_kwargs_field_check(cls, v, info: ValidationInfo): field_name = info.field_name field = cls.model_fields[field_name] anno_args = typing.get_args(field.annotation) - if len(anno_args) == 2 and anno_args[1] == type(None): + if len(anno_args) == 2 and anno_args[1] is type(None): # This means that the anno is optional expected_type = next( filter(lambda x: x is not None, typing.get_args(field.annotation))