diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 292ba669..c17323ad 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.7, 3.8, 3.9, "3.10"] + python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] steps: - uses: actions/checkout@v2 diff --git a/cloudpathlib/azure/azblobclient.py b/cloudpathlib/azure/azblobclient.py index aaa45e4c..89eca193 100644 --- a/cloudpathlib/azure/azblobclient.py +++ b/cloudpathlib/azure/azblobclient.py @@ -177,10 +177,8 @@ def _list_dir( for o in container_client.list_blobs(name_starts_with=prefix): # get directory from this path for parent in PurePosixPath(o.name[len(prefix) :]).parents: - # if we haven't surfaced this directory already if parent not in yielded_dirs and str(parent) != ".": - # skip if not recursive and this is beyond our depth if not recursive and "/" in str(parent): continue diff --git a/cloudpathlib/cloudpath.py b/cloudpathlib/cloudpath.py index a4e91db3..a0651531 100644 --- a/cloudpathlib/cloudpath.py +++ b/cloudpathlib/cloudpath.py @@ -1142,3 +1142,5 @@ def scandir( _CloudPathSelectable(child, root._parents + [root._name], grand_children) for child, grand_children in root._all_children.items() ) + + _scandir = scandir # Py 3.11 compatibility diff --git a/cloudpathlib/gs/gsclient.py b/cloudpathlib/gs/gsclient.py index 099fa5f1..27028d46 100644 --- a/cloudpathlib/gs/gsclient.py +++ b/cloudpathlib/gs/gsclient.py @@ -173,10 +173,8 @@ def _list_dir(self, cloud_path: GSPath, recursive=False) -> Iterable[Tuple[GSPat for o in bucket.list_blobs(prefix=prefix): # get directory from this path for parent in PurePosixPath(o.name[len(prefix) :]).parents: - # if we haven't surfaced thei directory already if parent not in yielded_dirs and str(parent) != ".": - # skip if not recursive and this is beyond our depth if not recursive and "/" in str(parent): continue diff --git a/setup.py b/setup.py index 6b1b8040..3c1df8c1 100644 --- a/setup.py +++ b/setup.py @@ -45,6 +45,7 @@ def load_requirements(path: Path): "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ], description=("pathlib-style classes for cloud storage services"), extras_require=extra_reqs, diff --git a/tests/mock_clients/utils.py b/tests/mock_clients/utils.py index 8802577c..a115383b 100644 --- a/tests/mock_clients/utils.py +++ b/tests/mock_clients/utils.py @@ -2,7 +2,6 @@ def delete_empty_parents_up_to_root(path: Path, root: Path): - for parent in path.parents: if parent == root: return