python-anyio: FTBFS against python 3.15rc1

Maximiliano Curia <[email protected]>
Newsgroups gmane.linux.debian.devel.python
Message-ID <[email protected]>
Package: src:python-anyio
Version: 4.12.1-3
User: [email protected]
Usertags: python3.15
Tags: patch, ftbfs, forky, sid

Hi!

While rebuilding the python related packages against the Python 3.15rc1
version we found that python-anyio fails to build from source [1]. 

I backported the relevant parts of the upstream commits that add support
for 3.15 [2] [3]. Note that upstream disables blockbuster in the
pyproject.toml, but that doesn't work for our builds. Also, blockbuster
will get support for python 3.15 once forbiddenfruit add it[5].

I applied the upstream fixes in the sandbox [4] to be able to build the
packages that depend on python-anyio, please consider applying the
patches to support the upcoming 3.15 version.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/work-request/1113809/
[2]: https://github.com/agronholm/anyio/commit/2370032396438b0279bacb3ff2f5c4ae2886f0d0
[3]: https://github.com/agronholm/anyio/commit/25b417fb497f1af25487cdcb7a89fe1e5f91b59d
[4]: https://debusine.debian.net/debian/r-python-python3.15/
[5]: https://github.com/clarete/forbiddenfruit/pull/86
-- 
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
Added-Python-3.15-support.patch (text/x-diff, 1.5 KB)
From: Alex Grönholm <[email protected]>
Date: Wed, 3 Jun 2026 19:40:04 +0300
Subject: Added Python 3.15 support (#1159)

Blockbuster does not yet work on 3.15, so it was disabled for that version.
Uvloop doesn't work with 3.15 yet either.
Origin: upstream, https://github.com/agronholm/anyio/commit/2370032396438b0279bacb3ff2f5c4ae2886f0d0

Index: python-anyio/pyproject.toml
===================================================================
--- python-anyio.orig/pyproject.toml
+++ python-anyio/pyproject.toml
@@ -124,6 +124,8 @@ filterwarnings = [
     "ignore:unclosed transport <_ProactorSocketTransport.*:ResourceWarning",
     # Workaround for Python 3.9.7 (see https://bugs.python.org/issue45097)
     "ignore:The loop argument is deprecated since Python 3\\.8, and scheduled for removal in Python 3\\.10\\.:DeprecationWarning:asyncio",
+    # Ignore deprecation warning occurring under coverage.py on Python 3.15
+    "ignore:Module globals; __loader__ != __spec__.loader:DeprecationWarning:",
 ]
 markers = [
     "network: marks tests as requiring Internet access",
Index: python-anyio/tests/conftest.py
===================================================================
--- python-anyio.orig/tests/conftest.py
+++ python-anyio/tests/conftest.py
@@ -89,6 +89,10 @@ for backend_name in get_all_backends():
 
 @pytest.fixture(autouse=True)
 def blockbuster() -> Iterator[BlockBuster | None]:
+    if sys.version_info >= (3, 15):
+        yield None
+        return
+
     try:
         from blockbuster import blockbuster_ctx
     except ImportError:
Handled-Python-3.15-path-API-changes.patch (text/x-diff, 2 KB)
From: Varun Chawla <[email protected]>
Date: Sun, 8 Feb 2026 14:00:48 -0800
Subject: Handled Python 3.15 path API changes (#1065)

- Conditionally remove is_reserved() on Python 3.15+ (removed in CPython)
- Add __vfspath__() on Python 3.15+ (new in CPython)
- Skip test_is_reserved on Python 3.15+

Fixes #1061.
Origin: upstream, https://github.com/agronholm/anyio/commit/25b417fb497f1af25487cdcb7a89fe1e5f91b59d

Index: python-anyio/src/anyio/_core/_fileio.py
===================================================================
--- python-anyio.orig/src/anyio/_core/_fileio.py
+++ python-anyio/src/anyio/_core/_fileio.py
@@ -301,6 +301,11 @@ class Path:
     def __fspath__(self) -> str:
         return self._path.__fspath__()
 
+    if sys.version_info >= (3, 15):
+
+        def __vfspath__(self) -> str:
+            return self._path.__vfspath__()
+
     def __str__(self) -> str:
         return self._path.__str__()
 
@@ -561,8 +566,10 @@ class Path:
             os.path.ismount, self._path, abandon_on_cancel=True
         )
 
-    def is_reserved(self) -> bool:
-        return self._path.is_reserved()
+    if sys.version_info < (3, 15):
+
+        def is_reserved(self) -> bool:
+            return self._path.is_reserved()
 
     async def is_socket(self) -> bool:
         return await to_thread.run_sync(self._path.is_socket, abandon_on_cancel=True)
Index: python-anyio/tests/test_fileio.py
===================================================================
--- python-anyio.orig/tests/test_fileio.py
+++ python-anyio/tests/test_fileio.py
@@ -302,6 +302,10 @@ class TestPath:
         assert not await Path("/gfobj4ewiotj").is_mount()
         assert await Path("/").is_mount()
 
+    @pytest.mark.skipif(
+        sys.version_info >= (3, 15),
+        reason="is_reserved() was removed in Python 3.15",
+    )
     @pytest.mark.filterwarnings("ignore::DeprecationWarning")
     def test_is_reserved(self) -> None:
         expected_result = platform.system() == "Windows"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.