Skip to content

Commit

Permalink
Sane mypy settings (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky authored Aug 15, 2024
1 parent 53f6442 commit 05074a7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,18 @@ markers = [
"setup_args : kwargs for setup fixture.",
"slow: slow tests",
]

[tool.mypy]
allow_incomplete_defs = true # FIXME
allow_untyped_decorators = false
allow_untyped_defs = true # FIXME
ignore_missing_imports = true
no_implicit_optional = true
show_error_codes = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_unreachable = true

[[tool.mypy.overrides]]
module = ["*.tests.*"]
allow_untyped_defs = true
10 changes: 5 additions & 5 deletions versioned_hdf5/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ def current_version(self):
"""
return self._versions.attrs["current_version"]

@current_version.setter
def current_version(self, version_name):
set_current_version(self.f, version_name)
self._version_cache.clear()

@property
def data_version_identifier(self) -> str:
"""Return the data version identifier.
Expand Down Expand Up @@ -180,11 +185,6 @@ def data_version_identifier(self, version: int):
"""
self.f["_version_data/versions"].attrs["data_version"] = version

@current_version.setter
def current_version(self, version_name):
set_current_version(self.f, version_name)
self._version_cache.clear()

def get_version_by_name(self, version):
if version.startswith("/"):
raise ValueError(
Expand Down
2 changes: 1 addition & 1 deletion versioned_hdf5/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def _verify_new_chunk_reuse(
assert_array_equal(to_be_reused, to_be_written)
except AssertionError as e:
raise ValueError(
f"Hash {data_hash} of existing data chunk {reused_chunk} "
f"Hash {data_hash!r} of existing data chunk {reused_chunk} "
f"matches the hash of new data chunk {chunk_being_written}, "
"but data does not."
) from e
Expand Down

0 comments on commit 05074a7

Please sign in to comment.