Skip to content

Commit

Permalink
Merge pull request #34 from csdms/mcflugen/update-pre-commit-hooks
Browse files Browse the repository at this point in the history
Update pre-commit hooks
  • Loading branch information
mcflugen authored Oct 15, 2024
2 parents 2af2bb8 + 2bfbbc5 commit 309905a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 15 deletions.
16 changes: 9 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.10.0
hooks:
- id: black
name: black
Expand All @@ -13,7 +13,7 @@ repos:
types_or: [python, pyi]

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -22,19 +22,19 @@ repos:
- flake8-simplify

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.18.0
hooks:
- id: pyupgrade
args: [--py310-plus]

- repo: https://github.com/asottile/reorder-python-imports
rev: v3.12.0
rev: v3.14.0
hooks:
- id: reorder-python-imports
args: [--py310-plus, --add-import, "from __future__ import annotations"]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-builtin-literals
- id: check-added-large-files
Expand Down Expand Up @@ -66,9 +66,11 @@ repos:
# additional_dependencies: [".[toml]"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.12.0
hooks:
- id: mypy
language_version: python3.12
additional_dependencies: [types-all]
additional_dependencies:
- tokenize-rt==3.2.0
- types-PyYAML
files: src/.*\.py$
2 changes: 1 addition & 1 deletion src/model_metadata/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def load_component(module_name: str, class_name: str) -> type[Any]:


@contextlib.contextmanager
def as_cwd(path: str, create: bool = True) -> Generator[None, None, None]:
def as_cwd(path: str, create: bool = True) -> Generator[None]:
prev_cwd = os.getcwd()

if create:
Expand Down
5 changes: 0 additions & 5 deletions src/model_metadata/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@


class ModelMetadataError(Exception):

"""Base error for model_metadata package."""

pass


class MetadataNotFoundError(ModelMetadataError):

"""Raise if metadata cannot be found."""

def __init__(self, path_to_metadata: str):
Expand All @@ -21,7 +19,6 @@ def __str__(self) -> str:


class MissingSectionError(ModelMetadataError):

"""Raise if a section in not found in the metadata."""

def __init__(self, name: str):
Expand All @@ -36,7 +33,6 @@ def __str__(self) -> str:


class MissingValueError(ModelMetadataError):

"""Raise if a value is not found in a metadata section."""

def __init__(self, name: str):
Expand All @@ -51,7 +47,6 @@ def __str__(self) -> str:


class BadEntryPointError(ModelMetadataError):

"""Raise if an entry-point string is bad, in some way."""

def __init__(self, entry_point: str, msg: str | None = None):
Expand Down
2 changes: 1 addition & 1 deletion src/model_metadata/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def _add_cmd(name: str, *, help: str) -> argparse.ArgumentParser:
help="Also emit status messages to stderr.",
)
parser.add_argument(
"--silent", action="store_true", help="Suppress status status messages"
"--silent", action="store_true", help="Suppress status messages"
)
return parser

Expand Down
1 change: 0 additions & 1 deletion src/model_metadata/model_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ def object_properties(obj: ModelInfo) -> tuple[tuple[str, Any], ...]:


class ModelInfo:

"""Information about a model."""

def __init__(
Expand Down

0 comments on commit 309905a

Please sign in to comment.