Skip to content

Commit

Permalink
pre-commit autoupdate & typing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dhimmel committed Jul 20, 2024
1 parent ff97d7d commit cc2e7b2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: mixed-line-ending
- id: check-case-conflict
- id: check-yaml
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.253
rev: v0.5.3
hooks:
- id: ruff
args:
- --fix
- repo: https://github.com/python/black
rev: 23.1.0
rev: 24.4.2
hooks:
- id: black
language_version: python3
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.0.1
rev: v1.11.0
hooks:
- id: mypy
5 changes: 1 addition & 4 deletions obonet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@

def _get_version() -> str | None:
try:
version_ = version("obonet")
# encountered mypy error [no-any-return] on Python 3.11
assert isinstance(version_, str)
return version_
return version("obonet")
except PackageNotFoundError:
return None

Expand Down
4 changes: 2 additions & 2 deletions obonet/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import mimetypes
import os
import re
from typing import Callable, TextIO, Union
from typing import Any, Callable, TextIO, Union
from urllib.request import urlopen

PathType = Union[str, os.PathLike, TextIO]
PathType = Union[str, os.PathLike[Any], TextIO]


def open_read_file(path: PathType, encoding: str | None = None) -> TextIO:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ select = [
]

[tool.mypy]
python_version = "3.7"
python_version = "3.8"
strict = true


Expand Down

0 comments on commit cc2e7b2

Please sign in to comment.