Skip to content

Commit

Permalink
Add Python 3.13 compatibility
Browse files Browse the repository at this point in the history
Changes:
- `PurePath._flavour` is now known as `PurePath.parser`.
- `PurePath._load_parts()` is now gone and replaced by `PurePath._raw_path`.
  • Loading branch information
otetard committed Oct 13, 2024
1 parent 568b0ce commit 1f3d80d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]
python-version: [3.8, 3.9, "3.10", 3.11, 3.12, 3.13]
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand Down
9 changes: 8 additions & 1 deletion s3path/current_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ class PureS3Path(PurePath):
S3 is not a file-system but we can look at it like a POSIX system.
"""
_flavour = flavour

if sys.version_info >= (3, 13):
parser = _S3Flavour()

__slots__ = ()

def __init__(self, *args):
Expand All @@ -70,7 +74,10 @@ def __init__(self, *args):
new_parts.remove(part)

self._raw_paths = new_parts
self._load_parts()
if sys.version_info >= (3, 13):
self._drv, self._root, self._tail_cached = self._parse_path(self._raw_path)
else:
self._load_parts()

@classmethod
def from_uri(cls, uri: str):
Expand Down

0 comments on commit 1f3d80d

Please sign in to comment.