Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.11 compatibility #317

Merged
merged 2 commits into from
Feb 3, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions cloudpathlib/azure/azblobclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions cloudpathlib/cloudpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions cloudpathlib/gs/gsclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion tests/mock_clients/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


def delete_empty_parents_up_to_root(path: Path, root: Path):

for parent in path.parents:
if parent == root:
return
Expand Down