diff --git a/cloudpathlib/cloudpath.py b/cloudpathlib/cloudpath.py index 01dc8205..6a12a21f 100644 --- a/cloudpathlib/cloudpath.py +++ b/cloudpathlib/cloudpath.py @@ -129,14 +129,14 @@ def decorator(cls: Type[CloudPathT]) -> Type[CloudPathT]: class CloudPathMeta(abc.ABCMeta): @overload - def __call__(cls: Type[T], cloud_path: CloudPathT, *args: Any, **kwargs: Any) -> CloudPathT: - ... + def __call__( + cls: Type[T], cloud_path: CloudPathT, *args: Any, **kwargs: Any + ) -> CloudPathT: ... @overload def __call__( cls: Type[T], cloud_path: Union[str, "CloudPath"], *args: Any, **kwargs: Any - ) -> T: - ... + ) -> T: ... def __call__( cls: Type[T], cloud_path: Union[str, CloudPathT], *args: Any, **kwargs: Any @@ -274,13 +274,13 @@ def _no_prefix_no_drive(self) -> str: @overload @classmethod - def is_valid_cloudpath(cls, path: "CloudPath", raise_on_error: bool = ...) -> TypeGuard[Self]: - ... + def is_valid_cloudpath( + cls, path: "CloudPath", raise_on_error: bool = ... + ) -> TypeGuard[Self]: ... @overload @classmethod - def is_valid_cloudpath(cls, path: str, raise_on_error: bool = ...) -> bool: - ... + def is_valid_cloudpath(cls, path: str, raise_on_error: bool = ...) -> bool: ... @classmethod def is_valid_cloudpath( @@ -940,24 +940,21 @@ def copy( self, destination: Self, force_overwrite_to_cloud: bool = False, - ) -> Self: - ... + ) -> Self: ... @overload def copy( self, destination: Path, force_overwrite_to_cloud: bool = False, - ) -> Path: - ... + ) -> Path: ... @overload def copy( self, destination: str, force_overwrite_to_cloud: bool = False, - ) -> Union[Path, "CloudPath"]: - ... + ) -> Union[Path, "CloudPath"]: ... def copy(self, destination, force_overwrite_to_cloud=False): """Copy self to destination folder of file, if self is a file.""" @@ -1007,8 +1004,7 @@ def copytree( destination: Self, force_overwrite_to_cloud: bool = False, ignore: Optional[Callable[[str, Iterable[str]], Container[str]]] = None, - ) -> Self: - ... + ) -> Self: ... @overload def copytree( @@ -1016,8 +1012,7 @@ def copytree( destination: Path, force_overwrite_to_cloud: bool = False, ignore: Optional[Callable[[str, Iterable[str]], Container[str]]] = None, - ) -> Path: - ... + ) -> Path: ... @overload def copytree( @@ -1025,8 +1020,7 @@ def copytree( destination: str, force_overwrite_to_cloud: bool = False, ignore: Optional[Callable[[str, Iterable[str]], Container[str]]] = None, - ) -> Union[Path, "CloudPath"]: - ... + ) -> Union[Path, "CloudPath"]: ... def copytree(self, destination, force_overwrite_to_cloud=False, ignore=None): """Copy self to a directory, if self is a directory.""" diff --git a/requirements-dev.txt b/requirements-dev.txt index ade42b38..19730fdd 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,6 @@ -e .[all] -black[jupyter] +black[jupyter]>=24.1.0;python_version>='3.8' build flake8 ipytest @@ -19,9 +19,8 @@ pandas pillow psutil pydantic -pytest -# pytest-cases -git+https://github.com/jayqi/python-pytest-cases@packaging-version +pytest<8 +pytest-cases>=3.7.0 pytest-cov pytest-xdist python-dotenv diff --git a/setup.cfg b/setup.cfg index 46fa9c4e..0e0037e2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [flake8] -ignore = E731,E266,E501,C901,W503,E203 +ignore = E731,E266,E501,C901,W503,E203,E704 max-line-length = 99 exclude = .git, diff --git a/tests/mock_clients/mock_azureblob.py b/tests/mock_clients/mock_azureblob.py index 198badae..689da039 100644 --- a/tests/mock_clients/mock_azureblob.py +++ b/tests/mock_clients/mock_azureblob.py @@ -96,9 +96,9 @@ def upload_blob(self, data, overwrite, content_settings=None): path.write_bytes(data) if content_settings is not None: - self.service_client.metadata_cache[ - self.root / self.key - ] = content_settings.content_type + self.service_client.metadata_cache[self.root / self.key] = ( + content_settings.content_type + ) class MockStorageStreamDownloader: diff --git a/tests/mock_clients/mock_s3.py b/tests/mock_clients/mock_s3.py index 5476989d..fc1ede18 100644 --- a/tests/mock_clients/mock_s3.py +++ b/tests/mock_clients/mock_s3.py @@ -259,9 +259,11 @@ def paginate(self, Bucket=None, Prefix="", Delimiter=None): files = [ { "Key": str(_.relative_to(self.root).as_posix()), - "Size": 123 - if not _.relative_to(self.root).exists() - else _.relative_to(self.root).stat().st_size, + "Size": ( + 123 + if not _.relative_to(self.root).exists() + else _.relative_to(self.root).stat().st_size + ), } for _ in page if _.is_file()