Skip to content

Commit

Permalink
Merge pull request #696 from mih/relax-type-test
Browse files Browse the repository at this point in the history
Relax type assertion from PurePosixPath to PosixPath in RIA patches
  • Loading branch information
mih authored May 21, 2024
2 parents bba363d + 7503479 commit d31ef78
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions datalad_next/patches/add_method_url2transport_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def local_io_url2transport_path(
self,
url_path: PurePosixPath
) -> Path | PurePosixPath:
assert url_path.__class__ is PurePosixPath
assert isinstance(url_path, PurePosixPath)
if on_windows:
return str2windows_path(url_path)
else:
Expand All @@ -57,7 +57,7 @@ def http_remote_io_url2transport_path(
self,
url_path: PurePosixPath
) -> Path | PurePosixPath:
assert url_path.__class__ is PurePosixPath
assert isinstance(url_path, PurePosixPath)
return url_path


Expand Down
2 changes: 1 addition & 1 deletion datalad_next/patches/replace_ora_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def __init__(self, annex):
# PATCH: add a helper to assert the type of a path.
@staticmethod
def _assert_pure_posix_path(path):
assert path.__class__ is PurePosixPath
assert isinstance(path, PurePosixPath)

# PATCH: add a close function to ensure that all IO-abstraction objects are
# closed.
Expand Down
4 changes: 2 additions & 2 deletions datalad_next/patches/ria_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def ria_utils__ensure_version(io, base_path, version):
target layout version of the store (dataset tree)
"""
# PATCH: ensure that `base_path` is an instance of `PurePosixPath`.
assert base_path.__class__ is PurePosixPath
assert isinstance(base_path, PurePosixPath)

# PATCH: convert abstract `ria-layout-version`-path to concrete IO-specific
# path
Expand Down Expand Up @@ -137,7 +137,7 @@ def ria_utils_create_ds_in_store(io,
'annex/objects')
"""
# PATCH: ensure that `base_path` is an instance of `PurePosixPath`.
assert base_path.__class__ is PurePosixPath
assert isinstance(base_path, PurePosixPath)

# TODO: Note for RF'ing, that this is about setting up a valid target
# for the special remote not a replacement for create-sibling-ria.
Expand Down

0 comments on commit d31ef78

Please sign in to comment.