Skip to content

Commit

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

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.1 → v0.8.6](astral-sh/ruff-pre-commit@v0.8.1...v0.8.6)
- [github.com/pre-commit/mirrors-mypy: v1.13.0 → v1.14.1](pre-commit/mirrors-mypy@v1.13.0...v1.14.1)

* fix: types

Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
pre-commit-ci[bot] authored Jan 13, 2025
1 parent 5148adc commit f0ad0c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ci:
autoupdate_schedule: monthly
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.8.1'
rev: 'v0.8.6'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
Expand All @@ -16,7 +16,7 @@ repos:
- tomli

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v1.14.1
hooks:
- id: mypy
args: [src]
Expand Down
6 changes: 3 additions & 3 deletions src/pdm/cli/commands/publish/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def parse_metadata(fp: IO[bytes]) -> email.message.Message:
Note that this function will close fp. See https://github.com/python/cpython/issues/65562.
"""
with io.TextIOWrapper(fp, encoding="utf-8", errors="surrogateescape") as file:
return email.message_from_file(file, policy=UTF8_POLICY)
return email.message_from_file(file, policy=UTF8_POLICY) # type: ignore[arg-type]


@dataclass
Expand All @@ -61,7 +61,7 @@ def get_hashes(self) -> dict[str, str]:
except ValueError:
pass
try:
hashers["blake2_256_digest"] = hashlib.blake2b(digest_size=256 // 8)
hashers["blake2_256_digest"] = hashlib.blake2b(digest_size=256 // 8) # type: ignore[assignment]
except (TypeError, ValueError):
pass
with open(self.filename, "rb") as f:
Expand Down Expand Up @@ -107,7 +107,7 @@ def read_metadata_from_tar(filename: str) -> email.message.Message:
else:
logger.warning(f"Can't determine the compression mode for {filename}")
mode = "r:*"
with tarfile.open(filename, mode) as tar:
with tarfile.open(filename, mode) as tar: # type: ignore[call-overload]
members = tar.getmembers()
has_leading = has_leading_dir(m.name for m in members)
for m in members:
Expand Down

0 comments on commit f0ad0c0

Please sign in to comment.