Compare commits
2 Commits
a2820774d5
...
d97e426bca
Author | SHA1 | Date |
---|---|---|
|
d97e426bca | |
|
c69877ea6f |
|
@ -54,7 +54,7 @@ dev = [
|
|||
# test suite
|
||||
# TODO: maybe some of these layout choices?
|
||||
# https://docs.pytest.org/en/8.0.x/explanation/goodpractices.html#choosing-a-test-layout-import-rules
|
||||
"pytest>=8.2.0,<9",
|
||||
"pytest>=8.3.5",
|
||||
"pexpect>=4.9.0,<5",
|
||||
# `tractor.devx` tooling
|
||||
"greenback>=1.2.1,<2",
|
||||
|
|
|
@ -23,12 +23,10 @@ import asyncio
|
|||
from asyncio.exceptions import (
|
||||
CancelledError,
|
||||
)
|
||||
from asyncio import (
|
||||
QueueShutDown,
|
||||
)
|
||||
from contextlib import asynccontextmanager as acm
|
||||
from dataclasses import dataclass
|
||||
import inspect
|
||||
import platform
|
||||
import traceback
|
||||
from typing import (
|
||||
Any,
|
||||
|
@ -79,6 +77,20 @@ __all__ = [
|
|||
'run_as_asyncio_guest',
|
||||
]
|
||||
|
||||
if (_py_313 := (
|
||||
('3', '13')
|
||||
==
|
||||
platform.python_version_tuple()[:-1]
|
||||
)
|
||||
):
|
||||
# 3.13+ only.. lel.
|
||||
# https://docs.python.org/3.13/library/asyncio-queue.html#asyncio.QueueShutDown
|
||||
from asyncio import (
|
||||
QueueShutDown,
|
||||
)
|
||||
else:
|
||||
QueueShutDown = False
|
||||
|
||||
|
||||
# TODO, generally speaking we can generalize this abstraction, a "SC linked
|
||||
# parent->child task pair", as the same "supervision scope primitive"
|
||||
|
@ -575,7 +587,11 @@ def _run_asyncio_task(
|
|||
# normally suppressed unless the trio.Task also errors
|
||||
#
|
||||
# ?TODO, is this even needed (does it happen) now?
|
||||
elif isinstance(aio_err, QueueShutDown):
|
||||
elif (
|
||||
_py_313
|
||||
and
|
||||
isinstance(aio_err, QueueShutDown)
|
||||
):
|
||||
# import pdbp; pdbp.set_trace()
|
||||
trio_err = AsyncioTaskExited(
|
||||
'Task exited before `trio` side'
|
||||
|
@ -955,9 +971,10 @@ async def translate_aio_errors(
|
|||
# or an error, we ensure the aio-side gets signalled via
|
||||
# an explicit exception and its `Queue` is shutdown.
|
||||
if ya_trio_exited:
|
||||
# raise `QueueShutDown` on next `Queue.get()` call on
|
||||
# aio side.
|
||||
chan._to_aio.shutdown()
|
||||
# XXX py3.13+ ONLY..
|
||||
# raise `QueueShutDown` on next `Queue.get/put()`
|
||||
if _py_313:
|
||||
chan._to_aio.shutdown()
|
||||
|
||||
# pump this event-loop (well `Runner` but ya)
|
||||
#
|
||||
|
|
8
uv.lock
8
uv.lock
|
@ -264,7 +264,7 @@ wheels = [
|
|||
|
||||
[[package]]
|
||||
name = "pytest"
|
||||
version = "8.3.4"
|
||||
version = "8.3.5"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||
|
@ -272,9 +272,9 @@ dependencies = [
|
|||
{ name = "packaging" },
|
||||
{ name = "pluggy" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919 }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/ae/3c/c9d525a414d506893f0cd8a8d0de7706446213181570cdbd766691164e40/pytest-8.3.5.tar.gz", hash = "sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845", size = 1450891 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 },
|
||||
{ url = "https://files.pythonhosted.org/packages/30/3d/64ad57c803f1fa1e963a7946b6e0fea4a70df53c1a7fed304586539c2bac/pytest-8.3.5-py3-none-any.whl", hash = "sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820", size = 343634 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -358,7 +358,7 @@ dev = [
|
|||
{ name = "pexpect", specifier = ">=4.9.0,<5" },
|
||||
{ name = "prompt-toolkit", specifier = ">=3.0.50" },
|
||||
{ name = "pyperclip", specifier = ">=1.9.0" },
|
||||
{ name = "pytest", specifier = ">=8.2.0,<9" },
|
||||
{ name = "pytest", specifier = ">=8.3.5" },
|
||||
{ name = "stackscope", specifier = ">=0.2.2,<0.3" },
|
||||
{ name = "xonsh", specifier = ">=0.19.2" },
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue