From 7deb36c086c67a18558828252060029122fc5e39 Mon Sep 17 00:00:00 2001 From: Andreas Poehlmann Date: Sun, 8 Sep 2024 12:18:34 +0200 Subject: [PATCH 1/8] nox: add 3.13 session --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 485c9d32..63d3ed2c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -10,7 +10,7 @@ locations = ("upath",) -@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.8", "pypy3.9"]) +@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]) def tests(session: nox.Session) -> None: # workaround in case no aiohttp binary wheels are available session.env["AIOHTTP_NO_EXTENSIONS"] = "1" From eee33b60282b9bd659f5990a6e6414752c054c71 Mon Sep 17 00:00:00 2001 From: Andreas Poehlmann Date: Sun, 8 Sep 2024 12:19:48 +0200 Subject: [PATCH 2/8] tests: xfail unsupported access to private attrs _drv, _root, _parts --- upath/tests/cases.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/upath/tests/cases.py b/upath/tests/cases.py index f539c6d3..6c9b914d 100644 --- a/upath/tests/cases.py +++ b/upath/tests/cases.py @@ -532,6 +532,10 @@ def test_read_with_fsspec(self): with fs.open(path) as f: assert f.read() == b"hello world" + @pytest.mark.xfail( + sys.version_info >= (3, 13), + reason="no support for private `._drv`, `._root`, `._parts` in 3.13", + ) def test_access_to_private_api(self): # DO NOT access these private attributes in your code p = UPath(str(self.path), **self.path.storage_options) From 5956aafc613e272b8f001cbbd3fc27fa02114458 Mon Sep 17 00:00:00 2001 From: Andreas Poehlmann Date: Sun, 8 Sep 2024 12:22:51 +0200 Subject: [PATCH 3/8] upath.core: add parser alias for _flavour --- upath/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/upath/core.py b/upath/core.py index 45efd609..eecccc9e 100644 --- a/upath/core.py +++ b/upath/core.py @@ -135,6 +135,9 @@ def with_suffix(self, suffix: str) -> Self: ... _protocol_dispatch: bool | None = None _flavour = LazyFlavourDescriptor() + if sys.version_info >= (3, 13): + parser = _flavour + # === upath.UPath constructor ===================================== def __new__( From 5e57dd888f0c2571fe680cb616248623aa38b894 Mon Sep 17 00:00:00 2001 From: Andreas Poehlmann Date: Sun, 8 Sep 2024 12:23:36 +0200 Subject: [PATCH 4/8] upath.core: replace _make_child_relpath usage in iterdir --- upath/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upath/core.py b/upath/core.py index eecccc9e..2003fa95 100644 --- a/upath/core.py +++ b/upath/core.py @@ -871,7 +871,7 @@ def iterdir(self) -> Generator[UPath, None, None]: continue # only want the path name with iterdir _, _, name = str_remove_suffix(name, "/").rpartition(self._flavour.sep) - yield self._make_child_relpath(name) + yield self.with_segments(*self.parts, name) def _scandir(self): raise NotImplementedError # todo From 858d10dca02221dc9eb3816dbcc1fa45d9e99d69 Mon Sep 17 00:00:00 2001 From: Andreas Poehlmann Date: Sun, 8 Sep 2024 12:29:14 +0200 Subject: [PATCH 5/8] ci: add 3.13 to tests --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1c6c67e5..d30c1d44 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-20.04, windows-latest, macos-latest] - pyv: ['3.8', '3.9', '3.10', '3.11', '3.12'] + pyv: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] fsspec: [''] include: @@ -41,6 +41,7 @@ jobs: PIP_DISABLE_PIP_VERSION_CHECK: ${{ matrix.pyv == '3.8' && matrix.os == 'macos-latest' }} with: python-version: ${{ matrix.pyv }} + allow-prereleases: true - name: Upgrade pip and nox run: | From 87c5fc2727420666c33e21c91795e8989205c339 Mon Sep 17 00:00:00 2001 From: Andreas Poehlmann Date: Sun, 8 Sep 2024 12:38:03 +0200 Subject: [PATCH 6/8] upath: update classifier in package metadata --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index d6ee777f..9bc19c4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Development Status :: 4 - Beta", ] keywords = ["filesystem-spec", "pathlib"] From ad03d65f142bda67428ff53834cbe862750c9482 Mon Sep 17 00:00:00 2001 From: Andreas Poehlmann Date: Sun, 8 Sep 2024 20:44:38 +0200 Subject: [PATCH 7/8] tests: don't install moto on 3.13 windows for now (skips s3 windows tests) --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9bc19c4a..f6c190ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,8 @@ dev = [ "requests", "gcsfs", "s3fs", - "moto[s3,server]", + # exclude moto installation on 3.13 windows until pywin32 wheels are available: + "moto[s3,server]; python_version<='3.12' or (python_version>'3.12' and os_name!='nt') ", "webdav4[fsspec]", "paramiko", "wsgidav", From 6b25e56ded287b7c0aa02306ea457e0f244695ac Mon Sep 17 00:00:00 2001 From: Andreas Poehlmann Date: Sun, 8 Sep 2024 21:04:11 +0200 Subject: [PATCH 8/8] upath: prevent pywin32 installation on windows 3.13 until release available --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f6c190ba..54b638e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ tests = [ "packaging", ] dev = [ - "adlfs", + "adlfs; python_version<='3.12' or (python_version>'3.12' and os_name!='nt') ", "aiohttp", "requests", "gcsfs",