Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# cloudpathlib Changelog

## UNRELEASED

- Fixed mypy 2.x type errors in `Client` and `CloudPath` that caused CI lint failures (Issue [#563](https://github.com/drivendataorg/cloudpathlib/issues/563), PR [#566](https://github.com/drivendataorg/cloudpathlib/pull/566))

## v0.24.0 (2026-04-29)
- Added support for S3 Multi-Region Access Point (MRAP) URLs in `S3Path` (Issue [#556](https://github.com/drivendataorg/cloudpathlib/issues/556), PR [#557](https://github.com/drivendataorg/cloudpathlib/pull/557))
- Added support for Pydantic serialization (Issue [#537](https://github.com/drivendataorg/cloudpathlib/issues/537), PR [#538](https://github.com/drivendataorg/cloudpathlib/pull/538))
Expand Down
6 changes: 3 additions & 3 deletions cloudpathlib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pathlib import Path
import shutil
from tempfile import TemporaryDirectory
from typing import Generic, Callable, Iterable, Optional, Tuple, TypeVar, Union
from typing import ClassVar, Generic, Callable, Iterable, Optional, Tuple, TypeVar, Union

from .cloudpath import CloudImplementation, CloudPath, implementation_registry
from .enums import FileCacheMode
Expand All @@ -27,7 +27,7 @@ def decorator(cls: type) -> type:

class Client(abc.ABC, Generic[BoundedCloudPath]):
_cloud_meta: CloudImplementation
_default_client = None
_default_client: ClassVar[Optional["Client[BoundedCloudPath]"]] = None

def __init__(
self,
Expand Down Expand Up @@ -95,7 +95,7 @@ def __del__(self) -> None:
self._local_cache_dir.rmdir()

@classmethod
def get_default_client(cls) -> "Client":
def get_default_client(cls) -> "Client[BoundedCloudPath]":
"""Get the default client, which the one that is used when instantiating a cloud path
instance for this cloud without a client specified.
"""
Expand Down
6 changes: 4 additions & 2 deletions cloudpathlib/cloudpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,8 +907,10 @@ def _dispatch_to_path(self, func: str, *args, **kwargs) -> Any:
sequence_class = (
type(path_version) if not isinstance(path_version, _PathParents) else tuple
)
return sequence_class( # type: ignore
self._new_cloudpath(_resolve(p)) for p in path_version if _resolve(p) != p.root
return sequence_class( # type: ignore[call-arg]
self._new_cloudpath(_resolve(p))
for p in path_version
if isinstance(p, PurePosixPath) and _resolve(p) != p.root
)

# when pathlib returns something else, we probably just want that thing
Expand Down
Loading