Compare commits
59 Commits
0fd43c3448
...
5cc2c238b7
Author | SHA1 | Date |
---|---|---|
|
5cc2c238b7 | |
|
127f2f2f68 | |
|
9ebc828283 | |
|
e7bb1edf97 | |
|
c9234fbd9c | |
|
8537ff4cd6 | |
|
0166304222 | |
|
b45874a216 | |
|
b93e0cb846 | |
|
986ada2ce9 | |
|
dfaae2238d | |
|
3d4aa22a79 | |
|
6ca15c8b4d | |
|
5d1eab0025 | |
|
6a41262667 | |
|
3a0ad0f53f | |
|
d5c3907295 | |
|
b048ad893b | |
|
387f989c05 | |
|
7e1ad860cd | |
|
e8eec89f46 | |
|
5a7cf5cc5b | |
|
a26f619e43 | |
|
ac9bf30d09 | |
|
d6a0c515ec | |
|
0607a31ddd | |
|
80e656b53f | |
|
0349d492ab | |
|
b90f3ce781 | |
|
9c18a083a5 | |
|
2733c78eb8 | |
|
34d6e3c981 | |
|
dd250fce46 | |
|
c53d6429c6 | |
|
a86774c40f | |
|
cb8c726012 | |
|
3b61731b4f | |
|
6cf4b4671f | |
|
74c1fb45e4 | |
|
63d5e65100 | |
|
e9d7f9cff4 | |
|
2a4f0b829b | |
|
1d5521bcbc | |
|
f9709e5aa2 | |
|
a1d75625e4 | |
|
85c60095ba | |
|
e2b9c3e769 | |
|
ae18ceb633 | |
|
917699417f | |
|
71a29d0106 | |
|
095bf28f5d | |
|
129dff575f | |
|
9167fbb0a8 | |
|
b6608e1c46 | |
|
33e5e2c06f | |
|
52238ade28 | |
|
f7cd8739a5 | |
|
7537c6f053 | |
|
9c83f02568 |
|
@ -62,7 +62,9 @@ async def recv_and_spawn_net_killers(
|
|||
await ctx.started()
|
||||
async with (
|
||||
ctx.open_stream() as stream,
|
||||
trio.open_nursery() as n,
|
||||
trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
) as tn,
|
||||
):
|
||||
async for i in stream:
|
||||
print(f'child echoing {i}')
|
||||
|
@ -77,11 +79,11 @@ async def recv_and_spawn_net_killers(
|
|||
i >= break_ipc_after
|
||||
):
|
||||
broke_ipc = True
|
||||
n.start_soon(
|
||||
tn.start_soon(
|
||||
iter_ipc_stream,
|
||||
stream,
|
||||
)
|
||||
n.start_soon(
|
||||
tn.start_soon(
|
||||
partial(
|
||||
break_ipc_then_error,
|
||||
stream=stream,
|
||||
|
|
|
@ -25,7 +25,7 @@ async def bp_then_error(
|
|||
|
||||
) -> None:
|
||||
|
||||
# sync with ``trio``-side (caller) task
|
||||
# sync with `trio`-side (caller) task
|
||||
to_trio.send_nowait('start')
|
||||
|
||||
# NOTE: what happens here inside the hook needs some refinement..
|
||||
|
@ -33,8 +33,7 @@ async def bp_then_error(
|
|||
# we set `Lock.local_task_in_debug = 'sync'`, we probably want
|
||||
# some further, at least, meta-data about the task/actor in debug
|
||||
# in terms of making it clear it's `asyncio` mucking about.
|
||||
breakpoint()
|
||||
|
||||
breakpoint() # asyncio-side
|
||||
|
||||
# short checkpoint / delay
|
||||
await asyncio.sleep(0.5) # asyncio-side
|
||||
|
@ -58,7 +57,6 @@ async def trio_ctx(
|
|||
# this will block until the ``asyncio`` task sends a "first"
|
||||
# message, see first line in above func.
|
||||
async with (
|
||||
|
||||
to_asyncio.open_channel_from(
|
||||
bp_then_error,
|
||||
# raise_after_bp=not bp_before_started,
|
||||
|
@ -69,7 +67,7 @@ async def trio_ctx(
|
|||
assert first == 'start'
|
||||
|
||||
if bp_before_started:
|
||||
await tractor.pause()
|
||||
await tractor.pause() # trio-side
|
||||
|
||||
await ctx.started(first) # trio-side
|
||||
|
||||
|
@ -111,7 +109,7 @@ async def main(
|
|||
|
||||
# pause in parent to ensure no cross-actor
|
||||
# locking problems exist!
|
||||
await tractor.pause()
|
||||
await tractor.pause() # trio-root
|
||||
|
||||
if cancel_from_root:
|
||||
await ctx.cancel()
|
||||
|
|
|
@ -21,11 +21,13 @@ async def name_error():
|
|||
|
||||
|
||||
async def main():
|
||||
"""Test breakpoint in a streaming actor.
|
||||
"""
|
||||
'''
|
||||
Test breakpoint in a streaming actor.
|
||||
|
||||
'''
|
||||
async with tractor.open_nursery(
|
||||
debug_mode=True,
|
||||
# loglevel='cancel',
|
||||
loglevel='cancel',
|
||||
# loglevel='devx',
|
||||
) as n:
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ async def main():
|
|||
"""
|
||||
async with tractor.open_nursery(
|
||||
debug_mode=True,
|
||||
# loglevel='cancel',
|
||||
loglevel='devx',
|
||||
) as n:
|
||||
|
||||
# spawn both actors
|
||||
|
|
|
@ -39,7 +39,6 @@ async def main(
|
|||
loglevel='devx',
|
||||
) as an,
|
||||
):
|
||||
|
||||
ptl: tractor.Portal = await an.start_actor(
|
||||
'hanger',
|
||||
enable_modules=[__name__],
|
||||
|
@ -54,13 +53,16 @@ async def main(
|
|||
|
||||
print(
|
||||
'Yo my child hanging..?\n'
|
||||
'Sending SIGUSR1 to see a tree-trace!\n'
|
||||
# "i'm a user who wants to see a `stackscope` tree!\n"
|
||||
)
|
||||
|
||||
# XXX simulate the wrapping test's "user actions"
|
||||
# (i.e. if a human didn't run this manually but wants to
|
||||
# know what they should do to reproduce test behaviour)
|
||||
if from_test:
|
||||
print(
|
||||
f'Sending SIGUSR1 to {cpid!r}!\n'
|
||||
)
|
||||
os.kill(
|
||||
cpid,
|
||||
signal.SIGUSR1,
|
||||
|
|
|
@ -91,7 +91,7 @@ async def main() -> list[int]:
|
|||
an: ActorNursery
|
||||
async with tractor.open_nursery(
|
||||
loglevel='cancel',
|
||||
debug_mode=True,
|
||||
# debug_mode=True,
|
||||
) as an:
|
||||
|
||||
seed = int(1e3)
|
||||
|
|
|
@ -3,20 +3,18 @@ import trio
|
|||
import tractor
|
||||
|
||||
|
||||
async def sleepy_jane():
|
||||
uid = tractor.current_actor().uid
|
||||
async def sleepy_jane() -> None:
|
||||
uid: tuple = tractor.current_actor().uid
|
||||
print(f'Yo i am actor {uid}')
|
||||
await trio.sleep_forever()
|
||||
|
||||
|
||||
async def main():
|
||||
'''
|
||||
Spawn a flat actor cluster, with one process per
|
||||
detected core.
|
||||
Spawn a flat actor cluster, with one process per detected core.
|
||||
|
||||
'''
|
||||
portal_map: dict[str, tractor.Portal]
|
||||
results: dict[str, str]
|
||||
|
||||
# look at this hip new syntax!
|
||||
async with (
|
||||
|
@ -25,11 +23,16 @@ async def main():
|
|||
modules=[__name__]
|
||||
) as portal_map,
|
||||
|
||||
trio.open_nursery() as n,
|
||||
trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
) as tn,
|
||||
):
|
||||
|
||||
for (name, portal) in portal_map.items():
|
||||
n.start_soon(portal.run, sleepy_jane)
|
||||
tn.start_soon(
|
||||
portal.run,
|
||||
sleepy_jane,
|
||||
)
|
||||
|
||||
await trio.sleep(0.5)
|
||||
|
||||
|
@ -41,4 +44,4 @@ if __name__ == '__main__':
|
|||
try:
|
||||
trio.run(main)
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
print('trio cancelled by KBI')
|
||||
|
|
170
pyproject.toml
170
pyproject.toml
|
@ -1,71 +1,83 @@
|
|||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
# ------ - ------
|
||||
# ------ build-system ------
|
||||
|
||||
[tool.poetry]
|
||||
[project]
|
||||
name = "tractor"
|
||||
version = "0.1.0a6dev0"
|
||||
description='structured concurrent `trio`-"actors"'
|
||||
authors = ["Tyler Goodlet <goodboy_foss@protonmail.com>"]
|
||||
license = "AGPlv3"
|
||||
description = 'structured concurrent `trio`-"actors"'
|
||||
authors = [{ name = "Tyler Goodlet", email = "goodboy_foss@protonmail.com" }]
|
||||
requires-python = ">= 3.11"
|
||||
readme = "docs/README.rst"
|
||||
|
||||
# TODO: do we need this xontrib loader at all given pep420
|
||||
# and xonsh's xontrib global-autoload-via-setuptools?
|
||||
# https://xon.sh/tutorial_xontrib.html#authoring-xontribs
|
||||
packages = [
|
||||
{include = 'tractor' },
|
||||
# {include = 'tractor.experimental' },
|
||||
# {include = 'tractor.trionics' },
|
||||
# {include = 'tractor.msg' },
|
||||
# {include = 'tractor.devx' },
|
||||
license = "AGPL-3.0-or-later"
|
||||
keywords = [
|
||||
"trio",
|
||||
"async",
|
||||
"concurrency",
|
||||
"structured concurrency",
|
||||
"actor model",
|
||||
"distributed",
|
||||
"multiprocessing",
|
||||
]
|
||||
classifiers = [
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Operating System :: POSIX :: Linux",
|
||||
"Framework :: Trio",
|
||||
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
|
||||
"Programming Language :: Python :: Implementation :: CPython",
|
||||
"Programming Language :: Python :: 3 :: Only",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Topic :: System :: Distributed Computing",
|
||||
]
|
||||
dependencies = [
|
||||
# trio runtime and friends
|
||||
# (poetry) proper range specs,
|
||||
# https://packaging.python.org/en/latest/discussions/install-requires-vs-requirements/#id5
|
||||
# TODO, for 3.13 we must go go `0.27` which means we have to
|
||||
# disable strict egs or port to handling them internally!
|
||||
"trio>0.27",
|
||||
"tricycle>=0.4.1,<0.5",
|
||||
"trio-typing>=0.10.0,<0.11",
|
||||
"wrapt>=1.16.0,<2",
|
||||
"colorlog>=6.8.2,<7",
|
||||
# built-in multi-actor `pdb` REPL
|
||||
"pdbp>=1.6,<2", # windows only (from `pdbp`)
|
||||
"tabcompleter>=1.4.0",
|
||||
# typed IPC msging
|
||||
# TODO, get back on release once 3.13 support is out!
|
||||
"msgspec>=0.19.0",
|
||||
]
|
||||
|
||||
# ------ - ------
|
||||
# ------ project ------
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.11"
|
||||
[dependency-groups]
|
||||
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",
|
||||
"pexpect>=4.9.0,<5",
|
||||
# `tractor.devx` tooling
|
||||
"greenback>=1.2.1,<2",
|
||||
"stackscope>=0.2.2,<0.3",
|
||||
"pyperclip>=1.9.0",
|
||||
"prompt-toolkit>=3.0.50",
|
||||
"xonsh>=0.19.2",
|
||||
]
|
||||
|
||||
# trio runtime related
|
||||
# proper range spec:
|
||||
# https://packaging.python.org/en/latest/discussions/install-requires-vs-requirements/#id5
|
||||
trio='^0.24'
|
||||
tricycle = "^0.4.1"
|
||||
trio-typing = "^0.10.0"
|
||||
|
||||
msgspec='^0.18.5' # interchange
|
||||
wrapt = "^1.16.0" # decorators
|
||||
colorlog = "^6.8.2" # logging
|
||||
|
||||
# built-in multi-actor `pdb` REPL
|
||||
pdbp = "^1.5.0"
|
||||
|
||||
|
||||
# TODO: distributed transport using
|
||||
# TODO, distributed (multi-host) extensions
|
||||
# linux kernel networking
|
||||
# 'pyroute2
|
||||
|
||||
# ------ - ------
|
||||
[tool.hatch.build.targets.sdist]
|
||||
include = ["tractor"]
|
||||
|
||||
[tool.poetry.group.dev]
|
||||
optional = false
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
# testing
|
||||
pytest = "^8.2.0"
|
||||
pexpect = "^4.9.0"
|
||||
[tool.hatch.build.targets.wheel]
|
||||
include = ["tractor"]
|
||||
|
||||
# .devx tooling
|
||||
greenback = "^1.2.1"
|
||||
stackscope = "^0.2.2"
|
||||
|
||||
# (light) xonsh usage/integration
|
||||
xontrib-vox = "^0.0.1"
|
||||
prompt-toolkit = "^3.0.43"
|
||||
xonsh-vox-tabcomplete = "^0.5"
|
||||
|
||||
# ------ - ------
|
||||
# ------ dependency-groups ------
|
||||
|
||||
[tool.towncrier]
|
||||
package = "tractor"
|
||||
|
@ -76,28 +88,26 @@ title_format = "tractor {version} ({project_date})"
|
|||
template = "nooz/_template.rst"
|
||||
all_bullets = true
|
||||
|
||||
[[tool.towncrier.type]]
|
||||
[[tool.towncrier.type]]
|
||||
directory = "feature"
|
||||
name = "Features"
|
||||
showcontent = true
|
||||
|
||||
[[tool.towncrier.type]]
|
||||
[[tool.towncrier.type]]
|
||||
directory = "bugfix"
|
||||
name = "Bug Fixes"
|
||||
showcontent = true
|
||||
|
||||
[[tool.towncrier.type]]
|
||||
[[tool.towncrier.type]]
|
||||
directory = "doc"
|
||||
name = "Improved Documentation"
|
||||
showcontent = true
|
||||
|
||||
[[tool.towncrier.type]]
|
||||
[[tool.towncrier.type]]
|
||||
directory = "trivial"
|
||||
name = "Trivial/Internal Changes"
|
||||
showcontent = true
|
||||
|
||||
# ------ - ------
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
minversion = '6.0'
|
||||
testpaths = [
|
||||
|
@ -113,29 +123,23 @@ addopts = [
|
|||
]
|
||||
log_cli = false
|
||||
|
||||
# TODO: maybe some of these layout choices?
|
||||
# https://docs.pytest.org/en/8.0.x/explanation/goodpractices.html#choosing-a-test-layout-import-rules
|
||||
# pythonpath = "src"
|
||||
# ------ tool.towncrier ------
|
||||
|
||||
# ------ - ------
|
||||
[tool.uv]
|
||||
# XXX NOTE, prefer the sys python bc apparently the distis from
|
||||
# `astral` are built in a way that breaks `pdbp`+`tabcompleter`'s
|
||||
# likely due to linking against `libedit` over `readline`..
|
||||
# |_https://docs.astral.sh/uv/concepts/python-versions/#managed-python-distributions
|
||||
# |_https://gregoryszorc.com/docs/python-build-standalone/main/quirks.html#use-of-libedit-on-linux
|
||||
#
|
||||
# https://docs.astral.sh/uv/reference/settings/#python-preference
|
||||
python-preference = 'system'
|
||||
|
||||
[project]
|
||||
keywords = [
|
||||
'trio',
|
||||
'async',
|
||||
'concurrency',
|
||||
'structured concurrency',
|
||||
'actor model',
|
||||
'distributed',
|
||||
'multiprocessing'
|
||||
]
|
||||
classifiers = [
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Operating System :: POSIX :: Linux",
|
||||
"Framework :: Trio",
|
||||
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
|
||||
"Programming Language :: Python :: Implementation :: CPython",
|
||||
"Programming Language :: Python :: 3 :: Only",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Topic :: System :: Distributed Computing",
|
||||
]
|
||||
# ------ tool.uv ------
|
||||
|
||||
[tool.uv.sources]
|
||||
# XXX NOTE, only for @goodboy's hacking on `pprint(sort_dicts=False)`
|
||||
# for the `pp` alias..
|
||||
# pdbp = { path = "../pdbp", editable = true }
|
||||
|
||||
# ------ tool.uv.sources ------
|
||||
|
|
|
@ -0,0 +1,82 @@
|
|||
# from default `ruff.toml` @
|
||||
# https://docs.astral.sh/ruff/configuration/
|
||||
|
||||
# Exclude a variety of commonly ignored directories.
|
||||
exclude = [
|
||||
".bzr",
|
||||
".direnv",
|
||||
".eggs",
|
||||
".git",
|
||||
".git-rewrite",
|
||||
".hg",
|
||||
".ipynb_checkpoints",
|
||||
".mypy_cache",
|
||||
".nox",
|
||||
".pants.d",
|
||||
".pyenv",
|
||||
".pytest_cache",
|
||||
".pytype",
|
||||
".ruff_cache",
|
||||
".svn",
|
||||
".tox",
|
||||
".venv",
|
||||
".vscode",
|
||||
"__pypackages__",
|
||||
"_build",
|
||||
"buck-out",
|
||||
"build",
|
||||
"dist",
|
||||
"node_modules",
|
||||
"site-packages",
|
||||
"venv",
|
||||
]
|
||||
|
||||
# Same as Black.
|
||||
line-length = 88
|
||||
indent-width = 4
|
||||
|
||||
# Assume Python 3.9
|
||||
target-version = "py311"
|
||||
|
||||
[lint]
|
||||
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
|
||||
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
|
||||
# McCabe complexity (`C901`) by default.
|
||||
select = ["E4", "E7", "E9", "F"]
|
||||
ignore = [
|
||||
'E402', # https://docs.astral.sh/ruff/rules/module-import-not-at-top-of-file/
|
||||
]
|
||||
|
||||
# Allow fix for all enabled rules (when `--fix`) is provided.
|
||||
fixable = ["ALL"]
|
||||
unfixable = []
|
||||
|
||||
# Allow unused variables when underscore-prefixed.
|
||||
# dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
||||
|
||||
[format]
|
||||
# Use single quotes in `ruff format`.
|
||||
quote-style = "single"
|
||||
|
||||
# Like Black, indent with spaces, rather than tabs.
|
||||
indent-style = "space"
|
||||
|
||||
# Like Black, respect magic trailing commas.
|
||||
skip-magic-trailing-comma = false
|
||||
|
||||
# Like Black, automatically detect the appropriate line ending.
|
||||
line-ending = "auto"
|
||||
|
||||
# Enable auto-formatting of code examples in docstrings. Markdown,
|
||||
# reStructuredText code/literal blocks and doctests are all supported.
|
||||
#
|
||||
# This is currently disabled by default, but it is planned for this
|
||||
# to be opt-out in the future.
|
||||
docstring-code-format = false
|
||||
|
||||
# Set the line length limit used when formatting code snippets in
|
||||
# docstrings.
|
||||
#
|
||||
# This only has an effect when the `docstring-code-format` setting is
|
||||
# enabled.
|
||||
docstring-code-line-length = "dynamic"
|
|
@ -75,7 +75,10 @@ def pytest_configure(config):
|
|||
|
||||
@pytest.fixture(scope='session')
|
||||
def debug_mode(request):
|
||||
return request.config.option.tractor_debug_mode
|
||||
debug_mode: bool = request.config.option.tractor_debug_mode
|
||||
# if debug_mode:
|
||||
# breakpoint()
|
||||
return debug_mode
|
||||
|
||||
|
||||
@pytest.fixture(scope='session', autouse=True)
|
||||
|
@ -92,6 +95,12 @@ def spawn_backend(request) -> str:
|
|||
return request.config.option.spawn_backend
|
||||
|
||||
|
||||
# @pytest.fixture(scope='function', autouse=True)
|
||||
# def debug_enabled(request) -> str:
|
||||
# from tractor import _state
|
||||
# if _state._runtime_vars['_debug_mode']:
|
||||
# breakpoint()
|
||||
|
||||
_ci_env: bool = os.environ.get('CI', False)
|
||||
|
||||
|
||||
|
@ -150,6 +159,18 @@ def pytest_generate_tests(metafunc):
|
|||
metafunc.parametrize("start_method", [spawn_backend], scope='module')
|
||||
|
||||
|
||||
# TODO: a way to let test scripts (like from `examples/`)
|
||||
# guarantee they won't registry addr collide!
|
||||
# @pytest.fixture
|
||||
# def open_test_runtime(
|
||||
# reg_addr: tuple,
|
||||
# ) -> AsyncContextManager:
|
||||
# return partial(
|
||||
# tractor.open_nursery,
|
||||
# registry_addrs=[reg_addr],
|
||||
# )
|
||||
|
||||
|
||||
def sig_prog(proc, sig):
|
||||
"Kill the actor-process with ``sig``."
|
||||
proc.send_signal(sig)
|
||||
|
|
|
@ -30,7 +30,7 @@ from conftest import (
|
|||
@pytest.fixture
|
||||
def spawn(
|
||||
start_method,
|
||||
testdir: pytest.Testdir,
|
||||
testdir: pytest.Pytester,
|
||||
reg_addr: tuple[str, int],
|
||||
|
||||
) -> Callable[[str], None]:
|
||||
|
@ -44,16 +44,32 @@ def spawn(
|
|||
'`pexpect` based tests only supported on `trio` backend'
|
||||
)
|
||||
|
||||
def unset_colors():
|
||||
'''
|
||||
Python 3.13 introduced colored tracebacks that break patt
|
||||
matching,
|
||||
|
||||
https://docs.python.org/3/using/cmdline.html#envvar-PYTHON_COLORS
|
||||
https://docs.python.org/3/using/cmdline.html#using-on-controlling-color
|
||||
|
||||
'''
|
||||
import os
|
||||
os.environ['PYTHON_COLORS'] = '0'
|
||||
|
||||
def _spawn(
|
||||
cmd: str,
|
||||
**mkcmd_kwargs,
|
||||
):
|
||||
unset_colors()
|
||||
return testdir.spawn(
|
||||
cmd=mk_cmd(
|
||||
cmd,
|
||||
**mkcmd_kwargs,
|
||||
),
|
||||
expect_timeout=3,
|
||||
# preexec_fn=unset_colors,
|
||||
# ^TODO? get `pytest` core to expose underlying
|
||||
# `pexpect.spawn()` stuff?
|
||||
)
|
||||
|
||||
# such that test-dep can pass input script name.
|
||||
|
@ -83,6 +99,14 @@ def ctlc(
|
|||
'https://github.com/goodboy/tractor/issues/320'
|
||||
)
|
||||
|
||||
if mark.name == 'ctlcs_bish':
|
||||
pytest.skip(
|
||||
f'Test {node} prolly uses something from the stdlib (namely `asyncio`..)\n'
|
||||
f'The test and/or underlying example script can *sometimes* run fine '
|
||||
f'locally but more then likely until the cpython peeps get their sh#$ together, '
|
||||
f'this test will definitely not behave like `trio` under SIGINT..\n'
|
||||
)
|
||||
|
||||
if use_ctlc:
|
||||
# XXX: disable pygments highlighting for auto-tests
|
||||
# since some envs (like actions CI) will struggle
|
||||
|
|
|
@ -309,10 +309,13 @@ def test_subactor_breakpoint(
|
|||
child.expect(EOF)
|
||||
|
||||
assert in_prompt_msg(
|
||||
child,
|
||||
['RemoteActorError:',
|
||||
child, [
|
||||
'MessagingError:',
|
||||
'RemoteActorError:',
|
||||
"('breakpoint_forever'",
|
||||
'bdb.BdbQuit',]
|
||||
'bdb.BdbQuit',
|
||||
],
|
||||
pause_on_false=True,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -6,6 +6,9 @@ All these tests can be understood (somewhat) by running the
|
|||
equivalent `examples/debugging/` scripts manually.
|
||||
|
||||
'''
|
||||
from contextlib import (
|
||||
contextmanager as cm,
|
||||
)
|
||||
# from functools import partial
|
||||
# import itertools
|
||||
import time
|
||||
|
@ -15,7 +18,7 @@ import time
|
|||
|
||||
import pytest
|
||||
from pexpect.exceptions import (
|
||||
# TIMEOUT,
|
||||
TIMEOUT,
|
||||
EOF,
|
||||
)
|
||||
|
||||
|
@ -32,7 +35,23 @@ from .conftest import (
|
|||
# _repl_fail_msg,
|
||||
)
|
||||
|
||||
@cm
|
||||
def maybe_expect_timeout(
|
||||
ctlc: bool = False,
|
||||
) -> None:
|
||||
try:
|
||||
yield
|
||||
except TIMEOUT:
|
||||
# breakpoint()
|
||||
if ctlc:
|
||||
pytest.xfail(
|
||||
'Some kinda redic threading SIGINT bug i think?\n'
|
||||
'See the notes in `examples/debugging/sync_bp.py`..\n'
|
||||
)
|
||||
raise
|
||||
|
||||
|
||||
@pytest.mark.ctlcs_bish
|
||||
def test_pause_from_sync(
|
||||
spawn,
|
||||
ctlc: bool,
|
||||
|
@ -67,10 +86,10 @@ def test_pause_from_sync(
|
|||
child.expect(PROMPT)
|
||||
|
||||
# XXX shouldn't see gb loaded message with PDB loglevel!
|
||||
assert not in_prompt_msg(
|
||||
child,
|
||||
['`greenback` portal opened!'],
|
||||
)
|
||||
# assert not in_prompt_msg(
|
||||
# child,
|
||||
# ['`greenback` portal opened!'],
|
||||
# )
|
||||
# should be same root task
|
||||
assert_before(
|
||||
child,
|
||||
|
@ -162,7 +181,14 @@ def test_pause_from_sync(
|
|||
)
|
||||
|
||||
child.sendline('c')
|
||||
child.expect(EOF)
|
||||
|
||||
# XXX TODO, weird threading bug it seems despite the
|
||||
# `abandon_on_cancel: bool` setting to
|
||||
# `trio.to_thread.run_sync()`..
|
||||
with maybe_expect_timeout(
|
||||
ctlc=ctlc,
|
||||
):
|
||||
child.expect(EOF)
|
||||
|
||||
|
||||
def expect_any_of(
|
||||
|
@ -218,11 +244,12 @@ def expect_any_of(
|
|||
)
|
||||
|
||||
return expected_patts
|
||||
# yield child
|
||||
|
||||
|
||||
def test_pause_from_asyncio_task(
|
||||
@pytest.mark.ctlcs_bish
|
||||
def test_sync_pause_from_aio_task(
|
||||
spawn,
|
||||
|
||||
ctlc: bool
|
||||
# ^TODO, fix for `asyncio`!!
|
||||
):
|
||||
|
@ -271,10 +298,12 @@ def test_pause_from_asyncio_task(
|
|||
# error raised in `asyncio.Task`
|
||||
"raise ValueError('asyncio side error!')": [
|
||||
_crash_msg,
|
||||
'return await chan.receive()', # `.to_asyncio` impl internals in tb
|
||||
"<Task 'trio_ctx'",
|
||||
"@ ('aio_daemon'",
|
||||
"ValueError: asyncio side error!",
|
||||
|
||||
# XXX, we no longer show this frame by default!
|
||||
# 'return await chan.receive()', # `.to_asyncio` impl internals in tb
|
||||
],
|
||||
|
||||
# parent-side propagation via actor-nursery/portal
|
||||
|
@ -326,4 +355,27 @@ def test_pause_from_asyncio_task(
|
|||
)
|
||||
|
||||
child.sendline('c')
|
||||
# with maybe_expect_timeout():
|
||||
child.expect(EOF)
|
||||
|
||||
|
||||
def test_sync_pause_from_non_greenbacked_aio_task():
|
||||
'''
|
||||
Where the `breakpoint()` caller task is NOT spawned by
|
||||
`tractor.to_asyncio` and thus never activates
|
||||
a `greenback.ensure_portal()` beforehand, presumably bc the task
|
||||
was started by some lib/dep as in often seen in the field.
|
||||
|
||||
Ensure sync pausing works when the pause is in,
|
||||
|
||||
- the root actor running in infected-mode?
|
||||
|_ since we don't need any IPC to acquire the debug lock?
|
||||
|_ is there some way to handle this like the non-main-thread case?
|
||||
|
||||
All other cases need to error out appropriately right?
|
||||
|
||||
- for any subactor we can't avoid needing the repl lock..
|
||||
|_ is there a way to hook into `asyncio.ensure_future(obj)`?
|
||||
|
||||
'''
|
||||
pass
|
||||
|
|
|
@ -15,6 +15,7 @@ TODO:
|
|||
'''
|
||||
import os
|
||||
import signal
|
||||
import time
|
||||
|
||||
from .conftest import (
|
||||
expect,
|
||||
|
@ -47,41 +48,39 @@ def test_shield_pause(
|
|||
]
|
||||
)
|
||||
|
||||
script_pid: int = child.pid
|
||||
print(
|
||||
'Sending SIGUSR1 to see a tree-trace!',
|
||||
f'Sending SIGUSR1 to {script_pid}\n'
|
||||
f'(kill -s SIGUSR1 {script_pid})\n'
|
||||
)
|
||||
os.kill(
|
||||
child.pid,
|
||||
script_pid,
|
||||
signal.SIGUSR1,
|
||||
)
|
||||
time.sleep(0.2)
|
||||
expect(
|
||||
child,
|
||||
# end-of-tree delimiter
|
||||
"------ \('root', ",
|
||||
"end-of-\('root'",
|
||||
)
|
||||
|
||||
assert_before(
|
||||
child,
|
||||
[
|
||||
'Trying to dump `stackscope` tree..',
|
||||
'Dumping `stackscope` tree for actor',
|
||||
# 'Srying to dump `stackscope` tree..',
|
||||
# 'Dumping `stackscope` tree for actor',
|
||||
"('root'", # uid line
|
||||
|
||||
# TODO!? this used to show?
|
||||
# -[ ] mk reproducable for @oremanj?
|
||||
#
|
||||
# parent block point (non-shielded)
|
||||
'await trio.sleep_forever() # in root',
|
||||
# 'await trio.sleep_forever() # in root',
|
||||
]
|
||||
)
|
||||
|
||||
# expect(
|
||||
# child,
|
||||
# # relay to the sub should be reported
|
||||
# 'Relaying `SIGUSR1`[10] to sub-actor',
|
||||
# )
|
||||
|
||||
expect(
|
||||
child,
|
||||
# end-of-tree delimiter
|
||||
"------ \('hanger', ",
|
||||
"end-of-\('hanger'",
|
||||
)
|
||||
assert_before(
|
||||
child,
|
||||
|
@ -91,11 +90,11 @@ def test_shield_pause(
|
|||
|
||||
"('hanger'", # uid line
|
||||
|
||||
# TODO!? SEE ABOVE
|
||||
# hanger LOC where it's shield-halted
|
||||
'await trio.sleep_forever() # in subactor',
|
||||
# 'await trio.sleep_forever() # in subactor',
|
||||
]
|
||||
)
|
||||
# breakpoint()
|
||||
|
||||
# simulate the user sending a ctl-c to the hanging program.
|
||||
# this should result in the terminator kicking in since
|
||||
|
|
|
@ -3,7 +3,6 @@ Sketchy network blackoutz, ugly byzantine gens, puedes eschuchar la
|
|||
cancelacion?..
|
||||
|
||||
'''
|
||||
import itertools
|
||||
from functools import partial
|
||||
from types import ModuleType
|
||||
|
||||
|
@ -230,13 +229,10 @@ def test_ipc_channel_break_during_stream(
|
|||
# get raw instance from pytest wrapper
|
||||
value = excinfo.value
|
||||
if isinstance(value, ExceptionGroup):
|
||||
value = next(
|
||||
itertools.dropwhile(
|
||||
lambda exc: not isinstance(exc, expect_final_exc),
|
||||
value.exceptions,
|
||||
)
|
||||
)
|
||||
assert value
|
||||
excs = value.exceptions
|
||||
assert len(excs) == 1
|
||||
final_exc = excs[0]
|
||||
assert isinstance(final_exc, expect_final_exc)
|
||||
|
||||
|
||||
@tractor.context
|
||||
|
@ -259,15 +255,16 @@ async def break_ipc_after_started(
|
|||
|
||||
def test_stream_closed_right_after_ipc_break_and_zombie_lord_engages():
|
||||
'''
|
||||
Verify that is a subactor's IPC goes down just after bringing up a stream
|
||||
the parent can trigger a SIGINT and the child will be reaped out-of-IPC by
|
||||
the localhost process supervision machinery: aka "zombie lord".
|
||||
Verify that is a subactor's IPC goes down just after bringing up
|
||||
a stream the parent can trigger a SIGINT and the child will be
|
||||
reaped out-of-IPC by the localhost process supervision machinery:
|
||||
aka "zombie lord".
|
||||
|
||||
'''
|
||||
async def main():
|
||||
with trio.fail_after(3):
|
||||
async with tractor.open_nursery() as n:
|
||||
portal = await n.start_actor(
|
||||
async with tractor.open_nursery() as an:
|
||||
portal = await an.start_actor(
|
||||
'ipc_breaker',
|
||||
enable_modules=[__name__],
|
||||
)
|
||||
|
|
|
@ -307,7 +307,15 @@ async def inf_streamer(
|
|||
|
||||
async with (
|
||||
ctx.open_stream() as stream,
|
||||
trio.open_nursery() as tn,
|
||||
|
||||
# XXX TODO, INTERESTING CASE!!
|
||||
# - if we don't collapse the eg then the embedded
|
||||
# `trio.EndOfChannel` doesn't propagate directly to the above
|
||||
# .open_stream() parent, resulting in it also raising instead
|
||||
# of gracefully absorbing as normal.. so how to handle?
|
||||
trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
) as tn,
|
||||
):
|
||||
async def close_stream_on_sentinel():
|
||||
async for msg in stream:
|
||||
|
|
|
@ -130,7 +130,7 @@ def test_multierror(
|
|||
try:
|
||||
await portal2.result()
|
||||
except tractor.RemoteActorError as err:
|
||||
assert err.boxed_type == AssertionError
|
||||
assert err.boxed_type is AssertionError
|
||||
print("Look Maa that first actor failed hard, hehh")
|
||||
raise
|
||||
|
||||
|
@ -182,7 +182,7 @@ def test_multierror_fast_nursery(reg_addr, start_method, num_subactors, delay):
|
|||
|
||||
for exc in exceptions:
|
||||
assert isinstance(exc, tractor.RemoteActorError)
|
||||
assert exc.boxed_type == AssertionError
|
||||
assert exc.boxed_type is AssertionError
|
||||
|
||||
|
||||
async def do_nothing():
|
||||
|
@ -504,7 +504,9 @@ def test_cancel_via_SIGINT_other_task(
|
|||
if is_win(): # smh
|
||||
timeout += 1
|
||||
|
||||
async def spawn_and_sleep_forever(task_status=trio.TASK_STATUS_IGNORED):
|
||||
async def spawn_and_sleep_forever(
|
||||
task_status=trio.TASK_STATUS_IGNORED
|
||||
):
|
||||
async with tractor.open_nursery() as tn:
|
||||
for i in range(3):
|
||||
await tn.run_in_actor(
|
||||
|
@ -517,7 +519,9 @@ def test_cancel_via_SIGINT_other_task(
|
|||
async def main():
|
||||
# should never timeout since SIGINT should cancel the current program
|
||||
with trio.fail_after(timeout):
|
||||
async with trio.open_nursery() as n:
|
||||
async with trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
) as n:
|
||||
await n.start(spawn_and_sleep_forever)
|
||||
if 'mp' in spawn_backend:
|
||||
time.sleep(0.1)
|
||||
|
@ -610,6 +614,12 @@ def test_fast_graceful_cancel_when_spawn_task_in_soft_proc_wait_for_daemon(
|
|||
nurse.start_soon(delayed_kbi)
|
||||
|
||||
await p.run(do_nuthin)
|
||||
|
||||
# need to explicitly re-raise the lone kbi..now
|
||||
except* KeyboardInterrupt as kbi_eg:
|
||||
assert (len(excs := kbi_eg.exceptions) == 1)
|
||||
raise excs[0]
|
||||
|
||||
finally:
|
||||
duration = time.time() - start
|
||||
if duration > timeout:
|
||||
|
|
|
@ -874,13 +874,13 @@ def chk_pld_type(
|
|||
return roundtrip
|
||||
|
||||
|
||||
def test_limit_msgspec():
|
||||
|
||||
def test_limit_msgspec(
|
||||
debug_mode: bool,
|
||||
):
|
||||
async def main():
|
||||
async with tractor.open_root_actor(
|
||||
debug_mode=True
|
||||
debug_mode=debug_mode,
|
||||
):
|
||||
|
||||
# ensure we can round-trip a boxing `PayloadMsg`
|
||||
assert chk_pld_type(
|
||||
payload_spec=Any,
|
||||
|
|
|
@ -95,8 +95,8 @@ async def trio_main(
|
|||
|
||||
# stash a "service nursery" as "actor local" (aka a Python global)
|
||||
global _nursery
|
||||
n = _nursery
|
||||
assert n
|
||||
tn = _nursery
|
||||
assert tn
|
||||
|
||||
async def consume_stream():
|
||||
async with wrapper_mngr() as stream:
|
||||
|
@ -104,10 +104,10 @@ async def trio_main(
|
|||
print(msg)
|
||||
|
||||
# run 2 tasks to ensure broadcaster chan use
|
||||
n.start_soon(consume_stream)
|
||||
n.start_soon(consume_stream)
|
||||
tn.start_soon(consume_stream)
|
||||
tn.start_soon(consume_stream)
|
||||
|
||||
n.start_soon(trio_sleep_and_err)
|
||||
tn.start_soon(trio_sleep_and_err)
|
||||
|
||||
await trio.sleep_forever()
|
||||
|
||||
|
@ -117,8 +117,10 @@ async def open_actor_local_nursery(
|
|||
ctx: tractor.Context,
|
||||
):
|
||||
global _nursery
|
||||
async with trio.open_nursery() as n:
|
||||
_nursery = n
|
||||
async with trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
) as tn:
|
||||
_nursery = tn
|
||||
await ctx.started()
|
||||
await trio.sleep(10)
|
||||
# await trio.sleep(1)
|
||||
|
@ -132,7 +134,7 @@ async def open_actor_local_nursery(
|
|||
# never yields back.. aka a scenario where the
|
||||
# ``tractor.context`` task IS NOT in the service n's cancel
|
||||
# scope.
|
||||
n.cancel_scope.cancel()
|
||||
tn.cancel_scope.cancel()
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
@ -157,7 +159,7 @@ def test_actor_managed_trio_nursery_task_error_cancels_aio(
|
|||
async with tractor.open_nursery() as n:
|
||||
p = await n.start_actor(
|
||||
'nursery_mngr',
|
||||
infect_asyncio=asyncio_mode,
|
||||
infect_asyncio=asyncio_mode, # TODO, is this enabling debug mode?
|
||||
enable_modules=[__name__],
|
||||
)
|
||||
async with (
|
||||
|
|
|
@ -181,7 +181,9 @@ async def spawn_and_check_registry(
|
|||
|
||||
try:
|
||||
async with tractor.open_nursery() as n:
|
||||
async with trio.open_nursery() as trion:
|
||||
async with trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
) as trion:
|
||||
|
||||
portals = {}
|
||||
for i in range(3):
|
||||
|
@ -316,7 +318,9 @@ async def close_chans_before_nursery(
|
|||
async with portal2.open_stream_from(
|
||||
stream_forever
|
||||
) as agen2:
|
||||
async with trio.open_nursery() as n:
|
||||
async with trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
) as n:
|
||||
n.start_soon(streamer, agen1)
|
||||
n.start_soon(cancel, use_signal, .5)
|
||||
try:
|
||||
|
|
|
@ -19,7 +19,7 @@ from tractor._testing import (
|
|||
@pytest.fixture
|
||||
def run_example_in_subproc(
|
||||
loglevel: str,
|
||||
testdir: pytest.Testdir,
|
||||
testdir: pytest.Pytester,
|
||||
reg_addr: tuple[str, int],
|
||||
):
|
||||
|
||||
|
@ -81,27 +81,37 @@ def run_example_in_subproc(
|
|||
|
||||
# walk yields: (dirpath, dirnames, filenames)
|
||||
[
|
||||
(p[0], f) for p in os.walk(examples_dir()) for f in p[2]
|
||||
(p[0], f)
|
||||
for p in os.walk(examples_dir())
|
||||
for f in p[2]
|
||||
|
||||
if '__' not in f
|
||||
and f[0] != '_'
|
||||
and 'debugging' not in p[0]
|
||||
and 'integration' not in p[0]
|
||||
and 'advanced_faults' not in p[0]
|
||||
if (
|
||||
'__' not in f
|
||||
and f[0] != '_'
|
||||
and 'debugging' not in p[0]
|
||||
and 'integration' not in p[0]
|
||||
and 'advanced_faults' not in p[0]
|
||||
and 'multihost' not in p[0]
|
||||
)
|
||||
],
|
||||
|
||||
ids=lambda t: t[1],
|
||||
)
|
||||
def test_example(run_example_in_subproc, example_script):
|
||||
"""Load and run scripts from this repo's ``examples/`` dir as a user
|
||||
def test_example(
|
||||
run_example_in_subproc,
|
||||
example_script,
|
||||
):
|
||||
'''
|
||||
Load and run scripts from this repo's ``examples/`` dir as a user
|
||||
would copy and pasing them into their editor.
|
||||
|
||||
On windows a little more "finessing" is done to make
|
||||
``multiprocessing`` play nice: we copy the ``__main__.py`` into the
|
||||
test directory and invoke the script as a module with ``python -m
|
||||
test_example``.
|
||||
"""
|
||||
ex_file = os.path.join(*example_script)
|
||||
|
||||
'''
|
||||
ex_file: str = os.path.join(*example_script)
|
||||
|
||||
if 'rpc_bidir_streaming' in ex_file and sys.version_info < (3, 9):
|
||||
pytest.skip("2-way streaming example requires py3.9 async with syntax")
|
||||
|
@ -127,7 +137,8 @@ def test_example(run_example_in_subproc, example_script):
|
|||
# shouldn't eventually once we figure out what's
|
||||
# a better way to be explicit about aio side
|
||||
# cancels?
|
||||
and 'asyncio.exceptions.CancelledError' not in last_error
|
||||
and
|
||||
'asyncio.exceptions.CancelledError' not in last_error
|
||||
):
|
||||
raise Exception(errmsg)
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ The hipster way to force SC onto the stdlib's "async": 'infection mode'.
|
|||
import asyncio
|
||||
import builtins
|
||||
from contextlib import ExitStack
|
||||
# from functools import partial
|
||||
import itertools
|
||||
import importlib
|
||||
import os
|
||||
|
@ -31,6 +32,16 @@ from tractor.trionics import BroadcastReceiver
|
|||
from tractor._testing import expect_ctxc
|
||||
|
||||
|
||||
@pytest.fixture(
|
||||
scope='module',
|
||||
)
|
||||
def delay(debug_mode: bool) -> int:
|
||||
if debug_mode:
|
||||
return 999
|
||||
else:
|
||||
return 1
|
||||
|
||||
|
||||
async def sleep_and_err(
|
||||
sleep_for: float = 0.1,
|
||||
|
||||
|
@ -58,20 +69,26 @@ async def trio_cancels_single_aio_task():
|
|||
await tractor.to_asyncio.run_task(aio_sleep_forever)
|
||||
|
||||
|
||||
def test_trio_cancels_aio_on_actor_side(reg_addr):
|
||||
def test_trio_cancels_aio_on_actor_side(
|
||||
reg_addr: tuple[str, int],
|
||||
delay: int,
|
||||
debug_mode: bool,
|
||||
):
|
||||
'''
|
||||
Spawn an infected actor that is cancelled by the ``trio`` side
|
||||
task using std cancel scope apis.
|
||||
|
||||
'''
|
||||
async def main():
|
||||
async with tractor.open_nursery(
|
||||
registry_addrs=[reg_addr]
|
||||
) as n:
|
||||
await n.run_in_actor(
|
||||
trio_cancels_single_aio_task,
|
||||
infect_asyncio=True,
|
||||
)
|
||||
with trio.fail_after(1 + delay):
|
||||
async with tractor.open_nursery(
|
||||
registry_addrs=[reg_addr],
|
||||
debug_mode=debug_mode,
|
||||
) as an:
|
||||
await an.run_in_actor(
|
||||
trio_cancels_single_aio_task,
|
||||
infect_asyncio=True,
|
||||
)
|
||||
|
||||
trio.run(main)
|
||||
|
||||
|
@ -108,12 +125,17 @@ async def asyncio_actor(
|
|||
|
||||
except BaseException as err:
|
||||
if expect_err:
|
||||
assert isinstance(err, error_type)
|
||||
assert isinstance(err, error_type), (
|
||||
f'{type(err)} is not {error_type}?'
|
||||
)
|
||||
|
||||
raise
|
||||
|
||||
|
||||
def test_aio_simple_error(reg_addr):
|
||||
def test_aio_simple_error(
|
||||
reg_addr: tuple[str, int],
|
||||
debug_mode: bool,
|
||||
):
|
||||
'''
|
||||
Verify a simple remote asyncio error propagates back through trio
|
||||
to the parent actor.
|
||||
|
@ -122,9 +144,10 @@ def test_aio_simple_error(reg_addr):
|
|||
'''
|
||||
async def main():
|
||||
async with tractor.open_nursery(
|
||||
registry_addrs=[reg_addr]
|
||||
) as n:
|
||||
await n.run_in_actor(
|
||||
registry_addrs=[reg_addr],
|
||||
debug_mode=debug_mode,
|
||||
) as an:
|
||||
await an.run_in_actor(
|
||||
asyncio_actor,
|
||||
target='sleep_and_err',
|
||||
expect_err='AssertionError',
|
||||
|
@ -150,14 +173,19 @@ def test_aio_simple_error(reg_addr):
|
|||
assert err.boxed_type is AssertionError
|
||||
|
||||
|
||||
def test_tractor_cancels_aio(reg_addr):
|
||||
def test_tractor_cancels_aio(
|
||||
reg_addr: tuple[str, int],
|
||||
debug_mode: bool,
|
||||
):
|
||||
'''
|
||||
Verify we can cancel a spawned asyncio task gracefully.
|
||||
|
||||
'''
|
||||
async def main():
|
||||
async with tractor.open_nursery() as n:
|
||||
portal = await n.run_in_actor(
|
||||
async with tractor.open_nursery(
|
||||
debug_mode=debug_mode,
|
||||
) as an:
|
||||
portal = await an.run_in_actor(
|
||||
asyncio_actor,
|
||||
target='aio_sleep_forever',
|
||||
expect_err='trio.Cancelled',
|
||||
|
@ -169,7 +197,9 @@ def test_tractor_cancels_aio(reg_addr):
|
|||
trio.run(main)
|
||||
|
||||
|
||||
def test_trio_cancels_aio(reg_addr):
|
||||
def test_trio_cancels_aio(
|
||||
reg_addr: tuple[str, int],
|
||||
):
|
||||
'''
|
||||
Much like the above test with ``tractor.Portal.cancel_actor()``
|
||||
except we just use a standard ``trio`` cancellation api.
|
||||
|
@ -180,8 +210,8 @@ def test_trio_cancels_aio(reg_addr):
|
|||
with trio.move_on_after(1):
|
||||
# cancel the nursery shortly after boot
|
||||
|
||||
async with tractor.open_nursery() as n:
|
||||
await n.run_in_actor(
|
||||
async with tractor.open_nursery() as tn:
|
||||
await tn.run_in_actor(
|
||||
asyncio_actor,
|
||||
target='aio_sleep_forever',
|
||||
expect_err='trio.Cancelled',
|
||||
|
@ -200,23 +230,35 @@ async def trio_ctx(
|
|||
|
||||
# this will block until the ``asyncio`` task sends a "first"
|
||||
# message.
|
||||
with trio.fail_after(2):
|
||||
async with (
|
||||
trio.open_nursery() as n,
|
||||
delay: int = 999 if tractor.debug_mode() else 1
|
||||
with trio.fail_after(1 + delay):
|
||||
try:
|
||||
async with (
|
||||
trio.open_nursery(
|
||||
# TODO, for new `trio` / py3.13
|
||||
# strict_exception_groups=False,
|
||||
) as tn,
|
||||
tractor.to_asyncio.open_channel_from(
|
||||
sleep_and_err,
|
||||
) as (first, chan),
|
||||
):
|
||||
|
||||
tractor.to_asyncio.open_channel_from(
|
||||
sleep_and_err,
|
||||
) as (first, chan),
|
||||
):
|
||||
assert first == 'start'
|
||||
|
||||
assert first == 'start'
|
||||
# spawn another asyncio task for the cuck of it.
|
||||
tn.start_soon(
|
||||
tractor.to_asyncio.run_task,
|
||||
aio_sleep_forever,
|
||||
)
|
||||
await trio.sleep_forever()
|
||||
|
||||
# spawn another asyncio task for the cuck of it.
|
||||
n.start_soon(
|
||||
tractor.to_asyncio.run_task,
|
||||
aio_sleep_forever,
|
||||
)
|
||||
await trio.sleep_forever()
|
||||
# TODO, factor this into a `trionics.collapse()`?
|
||||
except* BaseException as beg:
|
||||
# await tractor.pause(shield=True)
|
||||
if len(excs := beg.exceptions) == 1:
|
||||
raise excs[0]
|
||||
else:
|
||||
raise
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
@ -225,8 +267,10 @@ async def trio_ctx(
|
|||
ids='parent_actor_cancels_child={}'.format
|
||||
)
|
||||
def test_context_spawns_aio_task_that_errors(
|
||||
reg_addr,
|
||||
reg_addr: tuple[str, int],
|
||||
delay: int,
|
||||
parent_cancels: bool,
|
||||
debug_mode: bool,
|
||||
):
|
||||
'''
|
||||
Verify that spawning a task via an intertask channel ctx mngr that
|
||||
|
@ -235,14 +279,13 @@ def test_context_spawns_aio_task_that_errors(
|
|||
|
||||
'''
|
||||
async def main():
|
||||
|
||||
with trio.fail_after(2):
|
||||
async with tractor.open_nursery() as n:
|
||||
p = await n.start_actor(
|
||||
with trio.fail_after(1 + delay):
|
||||
async with tractor.open_nursery() as an:
|
||||
p = await an.start_actor(
|
||||
'aio_daemon',
|
||||
enable_modules=[__name__],
|
||||
infect_asyncio=True,
|
||||
# debug_mode=True,
|
||||
debug_mode=debug_mode,
|
||||
loglevel='cancel',
|
||||
)
|
||||
async with (
|
||||
|
@ -307,11 +350,14 @@ async def aio_cancel():
|
|||
await aio_sleep_forever()
|
||||
|
||||
|
||||
def test_aio_cancelled_from_aio_causes_trio_cancelled(reg_addr):
|
||||
def test_aio_cancelled_from_aio_causes_trio_cancelled(
|
||||
reg_addr: tuple,
|
||||
delay: int,
|
||||
):
|
||||
'''
|
||||
When the `asyncio.Task` cancels itself the `trio` side cshould
|
||||
When the `asyncio.Task` cancels itself the `trio` side should
|
||||
also cancel and teardown and relay the cancellation cross-process
|
||||
to the caller (parent).
|
||||
to the parent caller.
|
||||
|
||||
'''
|
||||
async def main():
|
||||
|
@ -327,7 +373,7 @@ def test_aio_cancelled_from_aio_causes_trio_cancelled(reg_addr):
|
|||
# NOTE: normally the `an.__aexit__()` waits on the
|
||||
# portal's result but we do it explicitly here
|
||||
# to avoid indent levels.
|
||||
with trio.fail_after(1):
|
||||
with trio.fail_after(1 + delay):
|
||||
await p.wait_for_result()
|
||||
|
||||
with pytest.raises(
|
||||
|
@ -338,11 +384,10 @@ def test_aio_cancelled_from_aio_causes_trio_cancelled(reg_addr):
|
|||
# might get multiple `trio.Cancelled`s as well inside an inception
|
||||
err: RemoteActorError|ExceptionGroup = excinfo.value
|
||||
if isinstance(err, ExceptionGroup):
|
||||
err = next(itertools.dropwhile(
|
||||
lambda exc: not isinstance(exc, tractor.RemoteActorError),
|
||||
err.exceptions
|
||||
))
|
||||
assert err
|
||||
excs = err.exceptions
|
||||
assert len(excs) == 1
|
||||
final_exc = excs[0]
|
||||
assert isinstance(final_exc, tractor.RemoteActorError)
|
||||
|
||||
# relayed boxed error should be our `trio`-task's
|
||||
# cancel-signal-proxy-equivalent of `asyncio.CancelledError`.
|
||||
|
@ -355,15 +400,18 @@ async def no_to_trio_in_args():
|
|||
|
||||
|
||||
async def push_from_aio_task(
|
||||
|
||||
sequence: Iterable,
|
||||
to_trio: trio.abc.SendChannel,
|
||||
expect_cancel: False,
|
||||
fail_early: bool,
|
||||
exit_early: bool,
|
||||
|
||||
) -> None:
|
||||
|
||||
try:
|
||||
# print('trying breakpoint')
|
||||
# breakpoint()
|
||||
|
||||
# sync caller ctx manager
|
||||
to_trio.send_nowait(True)
|
||||
|
||||
|
@ -372,10 +420,27 @@ async def push_from_aio_task(
|
|||
to_trio.send_nowait(i)
|
||||
await asyncio.sleep(0.001)
|
||||
|
||||
if i == 50 and fail_early:
|
||||
raise Exception
|
||||
if (
|
||||
i == 50
|
||||
):
|
||||
if fail_early:
|
||||
print('Raising exc from aio side!')
|
||||
raise Exception
|
||||
|
||||
print('asyncio streamer complete!')
|
||||
if exit_early:
|
||||
# TODO? really you could enforce the same
|
||||
# SC-proto we use for actors here with asyncio
|
||||
# such that a Return[None] msg would be
|
||||
# implicitly delivered to the trio side?
|
||||
#
|
||||
# XXX => this might be the end-all soln for
|
||||
# converting any-inter-task system (regardless
|
||||
# of maybe-remote runtime or language) to be
|
||||
# SC-compat no?
|
||||
print(f'asyncio breaking early @ {i!r}')
|
||||
break
|
||||
|
||||
print('asyncio streaming complete!')
|
||||
|
||||
except asyncio.CancelledError:
|
||||
if not expect_cancel:
|
||||
|
@ -387,9 +452,10 @@ async def push_from_aio_task(
|
|||
|
||||
|
||||
async def stream_from_aio(
|
||||
exit_early: bool = False,
|
||||
raise_err: bool = False,
|
||||
trio_exit_early: bool = False,
|
||||
trio_raise_err: bool = False,
|
||||
aio_raise_err: bool = False,
|
||||
aio_exit_early: bool = False,
|
||||
fan_out: bool = False,
|
||||
|
||||
) -> None:
|
||||
|
@ -402,8 +468,18 @@ async def stream_from_aio(
|
|||
async with to_asyncio.open_channel_from(
|
||||
push_from_aio_task,
|
||||
sequence=seq,
|
||||
expect_cancel=raise_err or exit_early,
|
||||
expect_cancel=trio_raise_err or trio_exit_early,
|
||||
fail_early=aio_raise_err,
|
||||
exit_early=aio_exit_early,
|
||||
|
||||
# such that we can test exit early cases
|
||||
# for each side explicitly.
|
||||
suppress_graceful_exits=(not(
|
||||
aio_exit_early
|
||||
or
|
||||
trio_exit_early
|
||||
))
|
||||
|
||||
) as (first, chan):
|
||||
|
||||
assert first is True
|
||||
|
@ -415,17 +491,28 @@ async def stream_from_aio(
|
|||
],
|
||||
):
|
||||
async for value in chan:
|
||||
print(f'trio received {value}')
|
||||
print(f'trio received: {value!r}')
|
||||
|
||||
# XXX, debugging EoC not being handled correctly
|
||||
# in `transate_aio_errors()`..
|
||||
# if value is None:
|
||||
# await tractor.pause(shield=True)
|
||||
|
||||
pulled.append(value)
|
||||
|
||||
if value == 50:
|
||||
if raise_err:
|
||||
if trio_raise_err:
|
||||
raise Exception
|
||||
elif exit_early:
|
||||
elif trio_exit_early:
|
||||
print('`consume()` breaking early!\n')
|
||||
break
|
||||
|
||||
print('returning from `consume()`..\n')
|
||||
|
||||
# run 2 tasks each pulling from
|
||||
# the inter-task-channel with the 2nd
|
||||
# using a fan-out `BroadcastReceiver`.
|
||||
if fan_out:
|
||||
# start second task that get's the same stream value set.
|
||||
async with (
|
||||
|
||||
# NOTE: this has to come first to avoid
|
||||
|
@ -433,19 +520,31 @@ async def stream_from_aio(
|
|||
# tasks are joined..
|
||||
chan.subscribe() as br,
|
||||
|
||||
trio.open_nursery() as n,
|
||||
trio.open_nursery() as tn,
|
||||
):
|
||||
n.start_soon(consume, br)
|
||||
# start 2nd task that get's broadcast the same
|
||||
# value set.
|
||||
tn.start_soon(consume, br)
|
||||
await consume(chan)
|
||||
|
||||
else:
|
||||
await consume(chan)
|
||||
except BaseException as err:
|
||||
import logging
|
||||
log = logging.getLogger()
|
||||
log.exception('aio-subactor errored!\n')
|
||||
raise err
|
||||
|
||||
finally:
|
||||
|
||||
if (
|
||||
not raise_err and
|
||||
not exit_early and
|
||||
not aio_raise_err
|
||||
if not (
|
||||
trio_raise_err
|
||||
or
|
||||
trio_exit_early
|
||||
or
|
||||
aio_raise_err
|
||||
or
|
||||
aio_exit_early
|
||||
):
|
||||
if fan_out:
|
||||
# we get double the pulled values in the
|
||||
|
@ -455,22 +554,27 @@ async def stream_from_aio(
|
|||
assert list(sorted(pulled)) == expect
|
||||
|
||||
else:
|
||||
# await tractor.pause()
|
||||
assert pulled == expect
|
||||
else:
|
||||
assert not fan_out
|
||||
assert pulled == expect[:51]
|
||||
|
||||
print('trio guest mode task completed!')
|
||||
print('trio guest-mode task completed!')
|
||||
assert chan._aio_task.done()
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'fan_out', [False, True],
|
||||
ids='fan_out_w_chan_subscribe={}'.format
|
||||
)
|
||||
def test_basic_interloop_channel_stream(reg_addr, fan_out):
|
||||
def test_basic_interloop_channel_stream(
|
||||
reg_addr: tuple[str, int],
|
||||
fan_out: bool,
|
||||
):
|
||||
async def main():
|
||||
async with tractor.open_nursery() as n:
|
||||
portal = await n.run_in_actor(
|
||||
async with tractor.open_nursery() as an:
|
||||
portal = await an.run_in_actor(
|
||||
stream_from_aio,
|
||||
infect_asyncio=True,
|
||||
fan_out=fan_out,
|
||||
|
@ -484,10 +588,10 @@ def test_basic_interloop_channel_stream(reg_addr, fan_out):
|
|||
# TODO: parametrize the above test and avoid the duplication here?
|
||||
def test_trio_error_cancels_intertask_chan(reg_addr):
|
||||
async def main():
|
||||
async with tractor.open_nursery() as n:
|
||||
portal = await n.run_in_actor(
|
||||
async with tractor.open_nursery() as an:
|
||||
portal = await an.run_in_actor(
|
||||
stream_from_aio,
|
||||
raise_err=True,
|
||||
trio_raise_err=True,
|
||||
infect_asyncio=True,
|
||||
)
|
||||
# should trigger remote actor error
|
||||
|
@ -500,25 +604,116 @@ def test_trio_error_cancels_intertask_chan(reg_addr):
|
|||
excinfo.value.boxed_type is Exception
|
||||
|
||||
|
||||
def test_trio_closes_early_and_channel_exits(reg_addr):
|
||||
def test_trio_closes_early_causes_aio_checkpoint_raise(
|
||||
reg_addr: tuple[str, int],
|
||||
delay: int,
|
||||
debug_mode: bool,
|
||||
):
|
||||
'''
|
||||
Check that if the `trio`-task "exits early and silently" (in this
|
||||
case during `async for`-ing the inter-task-channel via
|
||||
a `break`-from-loop), we raise `TrioTaskExited` on the
|
||||
`asyncio`-side which also then bubbles up through the
|
||||
`open_channel_from()` block indicating that the `asyncio.Task`
|
||||
hit a ran another checkpoint despite the `trio.Task` exit.
|
||||
|
||||
'''
|
||||
async def main():
|
||||
async with tractor.open_nursery() as n:
|
||||
portal = await n.run_in_actor(
|
||||
stream_from_aio,
|
||||
exit_early=True,
|
||||
infect_asyncio=True,
|
||||
)
|
||||
# should raise RAE diectly
|
||||
await portal.result()
|
||||
with trio.fail_after(1 + delay):
|
||||
async with tractor.open_nursery(
|
||||
debug_mode=debug_mode,
|
||||
# enable_stack_on_sig=True,
|
||||
) as an:
|
||||
portal = await an.run_in_actor(
|
||||
stream_from_aio,
|
||||
trio_exit_early=True,
|
||||
infect_asyncio=True,
|
||||
)
|
||||
# should raise RAE diectly
|
||||
print('waiting on final infected subactor result..')
|
||||
res: None = await portal.wait_for_result()
|
||||
assert res is None
|
||||
print(f'infected subactor returned result: {res!r}\n')
|
||||
|
||||
# should be a quiet exit on a simple channel exit
|
||||
trio.run(main)
|
||||
with pytest.raises(RemoteActorError) as excinfo:
|
||||
trio.run(main)
|
||||
|
||||
# ensure remote error is an explicit `AsyncioCancelled` sub-type
|
||||
# which indicates to the aio task that the trio side exited
|
||||
# silently WITHOUT raising a `trio.Cancelled` (which would
|
||||
# normally be raised instead as a `AsyncioCancelled`).
|
||||
excinfo.value.boxed_type is to_asyncio.TrioTaskExited
|
||||
|
||||
|
||||
def test_aio_errors_and_channel_propagates_and_closes(reg_addr):
|
||||
def test_aio_exits_early_relays_AsyncioTaskExited(
|
||||
# TODO, parametrize the 3 possible trio side conditions:
|
||||
# - trio blocking on receive, aio exits early
|
||||
# - trio cancelled AND aio exits early on its next tick
|
||||
# - trio errors AND aio exits early on its next tick
|
||||
reg_addr: tuple[str, int],
|
||||
debug_mode: bool,
|
||||
delay: int,
|
||||
):
|
||||
'''
|
||||
Check that if the `asyncio`-task "exits early and silently" (in this
|
||||
case during `push_from_aio_task()` pushing to the `InterLoopTaskChannel`
|
||||
it `break`s from the loop), we raise `AsyncioTaskExited` on the
|
||||
`trio`-side which then DOES NOT BUBBLE up through the
|
||||
`open_channel_from()` block UNLESS,
|
||||
|
||||
- the trio.Task also errored/cancelled, in which case we wrap
|
||||
both errors in an eg
|
||||
- the trio.Task was blocking on rxing a value from the
|
||||
`InterLoopTaskChannel`.
|
||||
|
||||
'''
|
||||
async def main():
|
||||
async with tractor.open_nursery() as n:
|
||||
portal = await n.run_in_actor(
|
||||
with trio.fail_after(1 + delay):
|
||||
async with tractor.open_nursery(
|
||||
debug_mode=debug_mode,
|
||||
# enable_stack_on_sig=True,
|
||||
) as an:
|
||||
portal = await an.run_in_actor(
|
||||
stream_from_aio,
|
||||
infect_asyncio=True,
|
||||
trio_exit_early=False,
|
||||
aio_exit_early=True,
|
||||
)
|
||||
# should raise RAE diectly
|
||||
print('waiting on final infected subactor result..')
|
||||
res: None = await portal.wait_for_result()
|
||||
assert res is None
|
||||
print(f'infected subactor returned result: {res!r}\n')
|
||||
|
||||
# should be a quiet exit on a simple channel exit
|
||||
with pytest.raises(RemoteActorError) as excinfo:
|
||||
trio.run(main)
|
||||
|
||||
exc = excinfo.value
|
||||
|
||||
# TODO, wow bug!
|
||||
# -[ ] bp handler not replaced!?!?
|
||||
# breakpoint()
|
||||
|
||||
# import pdbp; pdbp.set_trace()
|
||||
|
||||
# ensure remote error is an explicit `AsyncioCancelled` sub-type
|
||||
# which indicates to the aio task that the trio side exited
|
||||
# silently WITHOUT raising a `trio.Cancelled` (which would
|
||||
# normally be raised instead as a `AsyncioCancelled`).
|
||||
assert exc.boxed_type is to_asyncio.AsyncioTaskExited
|
||||
|
||||
|
||||
def test_aio_errors_and_channel_propagates_and_closes(
|
||||
reg_addr: tuple[str, int],
|
||||
debug_mode: bool,
|
||||
):
|
||||
async def main():
|
||||
async with tractor.open_nursery(
|
||||
debug_mode=debug_mode,
|
||||
) as an:
|
||||
portal = await an.run_in_actor(
|
||||
stream_from_aio,
|
||||
aio_raise_err=True,
|
||||
infect_asyncio=True,
|
||||
|
@ -536,41 +731,46 @@ def test_aio_errors_and_channel_propagates_and_closes(reg_addr):
|
|||
excinfo.value.boxed_type is Exception
|
||||
|
||||
|
||||
async def aio_echo_server(
|
||||
to_trio: trio.MemorySendChannel,
|
||||
from_trio: asyncio.Queue,
|
||||
) -> None:
|
||||
|
||||
to_trio.send_nowait('start')
|
||||
|
||||
while True:
|
||||
try:
|
||||
msg = await from_trio.get()
|
||||
except to_asyncio.TrioTaskExited:
|
||||
print(
|
||||
'breaking aio echo loop due to `trio` exit!'
|
||||
)
|
||||
break
|
||||
|
||||
# echo the msg back
|
||||
to_trio.send_nowait(msg)
|
||||
|
||||
# if we get the terminate sentinel
|
||||
# break the echo loop
|
||||
if msg is None:
|
||||
print('breaking aio echo loop')
|
||||
break
|
||||
|
||||
print('exiting asyncio task')
|
||||
|
||||
|
||||
@tractor.context
|
||||
async def trio_to_aio_echo_server(
|
||||
ctx: tractor.Context,
|
||||
ctx: tractor.Context|None,
|
||||
):
|
||||
|
||||
async def aio_echo_server(
|
||||
to_trio: trio.MemorySendChannel,
|
||||
from_trio: asyncio.Queue,
|
||||
) -> None:
|
||||
|
||||
to_trio.send_nowait('start')
|
||||
|
||||
while True:
|
||||
msg = await from_trio.get()
|
||||
|
||||
# echo the msg back
|
||||
to_trio.send_nowait(msg)
|
||||
|
||||
# if we get the terminate sentinel
|
||||
# break the echo loop
|
||||
if msg is None:
|
||||
print('breaking aio echo loop')
|
||||
break
|
||||
|
||||
print('exiting asyncio task')
|
||||
|
||||
async with to_asyncio.open_channel_from(
|
||||
aio_echo_server,
|
||||
) as (first, chan):
|
||||
|
||||
assert first == 'start'
|
||||
|
||||
await ctx.started(first)
|
||||
|
||||
async with ctx.open_stream() as stream:
|
||||
|
||||
async for msg in stream:
|
||||
print(f'asyncio echoing {msg}')
|
||||
await chan.send(msg)
|
||||
|
@ -594,13 +794,15 @@ async def trio_to_aio_echo_server(
|
|||
ids='raise_error={}'.format,
|
||||
)
|
||||
def test_echoserver_detailed_mechanics(
|
||||
reg_addr,
|
||||
reg_addr: tuple[str, int],
|
||||
debug_mode: bool,
|
||||
raise_error_mid_stream,
|
||||
):
|
||||
|
||||
async def main():
|
||||
async with tractor.open_nursery() as n:
|
||||
p = await n.start_actor(
|
||||
async with tractor.open_nursery(
|
||||
debug_mode=debug_mode,
|
||||
) as an:
|
||||
p = await an.start_actor(
|
||||
'aio_server',
|
||||
enable_modules=[__name__],
|
||||
infect_asyncio=True,
|
||||
|
@ -649,7 +851,6 @@ def test_echoserver_detailed_mechanics(
|
|||
trio.run(main)
|
||||
|
||||
|
||||
|
||||
@tractor.context
|
||||
async def manage_file(
|
||||
ctx: tractor.Context,
|
||||
|
@ -806,6 +1007,8 @@ def test_sigint_closes_lifetime_stack(
|
|||
|
||||
'''
|
||||
async def main():
|
||||
|
||||
delay = 999 if tractor.debug_mode() else 1
|
||||
try:
|
||||
an: tractor.ActorNursery
|
||||
async with tractor.open_nursery(
|
||||
|
@ -856,7 +1059,7 @@ def test_sigint_closes_lifetime_stack(
|
|||
if wait_for_ctx:
|
||||
print('waiting for ctx outcome in parent..')
|
||||
try:
|
||||
with trio.fail_after(1):
|
||||
with trio.fail_after(1 + delay):
|
||||
await ctx.wait_for_result()
|
||||
except tractor.ContextCancelled as ctxc:
|
||||
assert ctxc.canceller == ctx.chan.uid
|
||||
|
|
|
@ -170,7 +170,7 @@ def test_do_not_swallow_error_before_started_by_remote_contextcancelled(
|
|||
trio.run(main)
|
||||
|
||||
rae = excinfo.value
|
||||
assert rae.boxed_type == TypeError
|
||||
assert rae.boxed_type is TypeError
|
||||
|
||||
|
||||
@tractor.context
|
||||
|
|
|
@ -0,0 +1,248 @@
|
|||
'''
|
||||
Special attention cases for using "infect `asyncio`" mode from a root
|
||||
actor; i.e. not using a std `trio.run()` bootstrap.
|
||||
|
||||
'''
|
||||
import asyncio
|
||||
from functools import partial
|
||||
|
||||
import pytest
|
||||
import trio
|
||||
import tractor
|
||||
from tractor import (
|
||||
to_asyncio,
|
||||
)
|
||||
from tests.test_infected_asyncio import (
|
||||
aio_echo_server,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'raise_error_mid_stream',
|
||||
[
|
||||
False,
|
||||
Exception,
|
||||
KeyboardInterrupt,
|
||||
],
|
||||
ids='raise_error={}'.format,
|
||||
)
|
||||
def test_infected_root_actor(
|
||||
raise_error_mid_stream: bool|Exception,
|
||||
|
||||
# conftest wide
|
||||
loglevel: str,
|
||||
debug_mode: bool,
|
||||
):
|
||||
'''
|
||||
Verify you can run the `tractor` runtime with `Actor.is_infected_aio() == True`
|
||||
in the root actor.
|
||||
|
||||
'''
|
||||
async def _trio_main():
|
||||
with trio.fail_after(2 if not debug_mode else 999):
|
||||
first: str
|
||||
chan: to_asyncio.LinkedTaskChannel
|
||||
async with (
|
||||
tractor.open_root_actor(
|
||||
debug_mode=debug_mode,
|
||||
loglevel=loglevel,
|
||||
),
|
||||
to_asyncio.open_channel_from(
|
||||
aio_echo_server,
|
||||
) as (first, chan),
|
||||
):
|
||||
assert first == 'start'
|
||||
|
||||
for i in range(1000):
|
||||
await chan.send(i)
|
||||
out = await chan.receive()
|
||||
assert out == i
|
||||
print(f'asyncio echoing {i}')
|
||||
|
||||
if (
|
||||
raise_error_mid_stream
|
||||
and
|
||||
i == 500
|
||||
):
|
||||
raise raise_error_mid_stream
|
||||
|
||||
if out is None:
|
||||
try:
|
||||
out = await chan.receive()
|
||||
except trio.EndOfChannel:
|
||||
break
|
||||
else:
|
||||
raise RuntimeError(
|
||||
'aio channel never stopped?'
|
||||
)
|
||||
|
||||
if raise_error_mid_stream:
|
||||
with pytest.raises(raise_error_mid_stream):
|
||||
tractor.to_asyncio.run_as_asyncio_guest(
|
||||
trio_main=_trio_main,
|
||||
)
|
||||
else:
|
||||
tractor.to_asyncio.run_as_asyncio_guest(
|
||||
trio_main=_trio_main,
|
||||
)
|
||||
|
||||
|
||||
|
||||
async def sync_and_err(
|
||||
# just signature placeholders for compat with
|
||||
# ``to_asyncio.open_channel_from()``
|
||||
to_trio: trio.MemorySendChannel,
|
||||
from_trio: asyncio.Queue,
|
||||
ev: asyncio.Event,
|
||||
|
||||
):
|
||||
if to_trio:
|
||||
to_trio.send_nowait('start')
|
||||
|
||||
await ev.wait()
|
||||
raise RuntimeError('asyncio-side')
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'aio_err_trigger',
|
||||
[
|
||||
'before_start_point',
|
||||
'after_trio_task_starts',
|
||||
'after_start_point',
|
||||
],
|
||||
ids='aio_err_triggered={}'.format
|
||||
)
|
||||
def test_trio_prestarted_task_bubbles(
|
||||
aio_err_trigger: str,
|
||||
|
||||
# conftest wide
|
||||
loglevel: str,
|
||||
debug_mode: bool,
|
||||
):
|
||||
async def pre_started_err(
|
||||
raise_err: bool = False,
|
||||
pre_sleep: float|None = None,
|
||||
aio_trigger: asyncio.Event|None = None,
|
||||
task_status=trio.TASK_STATUS_IGNORED,
|
||||
):
|
||||
'''
|
||||
Maybe pre-started error then sleep.
|
||||
|
||||
'''
|
||||
if pre_sleep is not None:
|
||||
print(f'Sleeping from trio for {pre_sleep!r}s !')
|
||||
await trio.sleep(pre_sleep)
|
||||
|
||||
# signal aio-task to raise JUST AFTER this task
|
||||
# starts but has not yet `.started()`
|
||||
if aio_trigger:
|
||||
print('Signalling aio-task to raise from `trio`!!')
|
||||
aio_trigger.set()
|
||||
|
||||
if raise_err:
|
||||
print('Raising from trio!')
|
||||
raise TypeError('trio-side')
|
||||
|
||||
task_status.started()
|
||||
await trio.sleep_forever()
|
||||
|
||||
async def _trio_main():
|
||||
# with trio.fail_after(2):
|
||||
with trio.fail_after(999):
|
||||
first: str
|
||||
chan: to_asyncio.LinkedTaskChannel
|
||||
aio_ev = asyncio.Event()
|
||||
|
||||
async with (
|
||||
tractor.open_root_actor(
|
||||
debug_mode=False,
|
||||
loglevel=loglevel,
|
||||
),
|
||||
):
|
||||
# TODO, tests for this with 3.13 egs?
|
||||
# from tractor.devx import open_crash_handler
|
||||
# with open_crash_handler():
|
||||
async with (
|
||||
# where we'll start a sub-task that errors BEFORE
|
||||
# calling `.started()` such that the error should
|
||||
# bubble before the guest run terminates!
|
||||
trio.open_nursery() as tn,
|
||||
|
||||
# THEN start an infect task which should error just
|
||||
# after the trio-side's task does.
|
||||
to_asyncio.open_channel_from(
|
||||
partial(
|
||||
sync_and_err,
|
||||
ev=aio_ev,
|
||||
)
|
||||
) as (first, chan),
|
||||
):
|
||||
|
||||
for i in range(5):
|
||||
pre_sleep: float|None = None
|
||||
last_iter: bool = (i == 4)
|
||||
|
||||
# TODO, missing cases?
|
||||
# -[ ] error as well on
|
||||
# 'after_start_point' case as well for
|
||||
# another case?
|
||||
raise_err: bool = False
|
||||
|
||||
if last_iter:
|
||||
raise_err: bool = True
|
||||
|
||||
# trigger aio task to error on next loop
|
||||
# tick/checkpoint
|
||||
if aio_err_trigger == 'before_start_point':
|
||||
aio_ev.set()
|
||||
|
||||
pre_sleep: float = 0
|
||||
|
||||
await tn.start(
|
||||
pre_started_err,
|
||||
raise_err,
|
||||
pre_sleep,
|
||||
(aio_ev if (
|
||||
aio_err_trigger == 'after_trio_task_starts'
|
||||
and
|
||||
last_iter
|
||||
) else None
|
||||
),
|
||||
)
|
||||
|
||||
if (
|
||||
aio_err_trigger == 'after_start_point'
|
||||
and
|
||||
last_iter
|
||||
):
|
||||
aio_ev.set()
|
||||
|
||||
with pytest.raises(
|
||||
expected_exception=ExceptionGroup,
|
||||
) as excinfo:
|
||||
tractor.to_asyncio.run_as_asyncio_guest(
|
||||
trio_main=_trio_main,
|
||||
)
|
||||
|
||||
eg = excinfo.value
|
||||
rte_eg, rest_eg = eg.split(RuntimeError)
|
||||
|
||||
# ensure the trio-task's error bubbled despite the aio-side
|
||||
# having (maybe) errored first.
|
||||
if aio_err_trigger in (
|
||||
'after_trio_task_starts',
|
||||
'after_start_point',
|
||||
):
|
||||
assert len(errs := rest_eg.exceptions) == 1
|
||||
typerr = errs[0]
|
||||
assert (
|
||||
type(typerr) is TypeError
|
||||
and
|
||||
'trio-side' in typerr.args
|
||||
)
|
||||
|
||||
# when aio errors BEFORE (last) trio task is scheduled, we should
|
||||
# never see anythinb but the aio-side.
|
||||
else:
|
||||
assert len(rtes := rte_eg.exceptions) == 1
|
||||
assert 'asyncio-side' in rtes[0].args[0]
|
|
@ -2,7 +2,9 @@
|
|||
Broadcast channels for fan-out to local tasks.
|
||||
|
||||
"""
|
||||
from contextlib import asynccontextmanager
|
||||
from contextlib import (
|
||||
asynccontextmanager as acm,
|
||||
)
|
||||
from functools import partial
|
||||
from itertools import cycle
|
||||
import time
|
||||
|
@ -15,6 +17,7 @@ import tractor
|
|||
from tractor.trionics import (
|
||||
broadcast_receiver,
|
||||
Lagged,
|
||||
collapse_eg,
|
||||
)
|
||||
|
||||
|
||||
|
@ -62,7 +65,7 @@ async def ensure_sequence(
|
|||
break
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
@acm
|
||||
async def open_sequence_streamer(
|
||||
|
||||
sequence: list[int],
|
||||
|
@ -74,9 +77,9 @@ async def open_sequence_streamer(
|
|||
async with tractor.open_nursery(
|
||||
arbiter_addr=reg_addr,
|
||||
start_method=start_method,
|
||||
) as tn:
|
||||
) as an:
|
||||
|
||||
portal = await tn.start_actor(
|
||||
portal = await an.start_actor(
|
||||
'sequence_echoer',
|
||||
enable_modules=[__name__],
|
||||
)
|
||||
|
@ -155,9 +158,12 @@ def test_consumer_and_parent_maybe_lag(
|
|||
) as stream:
|
||||
|
||||
try:
|
||||
async with trio.open_nursery() as n:
|
||||
async with (
|
||||
collapse_eg(),
|
||||
trio.open_nursery() as tn,
|
||||
):
|
||||
|
||||
n.start_soon(
|
||||
tn.start_soon(
|
||||
ensure_sequence,
|
||||
stream,
|
||||
sequence.copy(),
|
||||
|
@ -230,8 +236,8 @@ def test_faster_task_to_recv_is_cancelled_by_slower(
|
|||
|
||||
) as stream:
|
||||
|
||||
async with trio.open_nursery() as n:
|
||||
n.start_soon(
|
||||
async with trio.open_nursery() as tn:
|
||||
tn.start_soon(
|
||||
ensure_sequence,
|
||||
stream,
|
||||
sequence.copy(),
|
||||
|
@ -253,7 +259,7 @@ def test_faster_task_to_recv_is_cancelled_by_slower(
|
|||
continue
|
||||
|
||||
print('cancelling faster subtask')
|
||||
n.cancel_scope.cancel()
|
||||
tn.cancel_scope.cancel()
|
||||
|
||||
try:
|
||||
value = await stream.receive()
|
||||
|
@ -371,13 +377,13 @@ def test_ensure_slow_consumers_lag_out(
|
|||
f'on {lags}:{value}')
|
||||
return
|
||||
|
||||
async with trio.open_nursery() as nursery:
|
||||
async with trio.open_nursery() as tn:
|
||||
|
||||
for i in range(1, num_laggers):
|
||||
|
||||
task_name = f'sub_{i}'
|
||||
laggers[task_name] = 0
|
||||
nursery.start_soon(
|
||||
tn.start_soon(
|
||||
partial(
|
||||
sub_and_print,
|
||||
delay=i*0.001,
|
||||
|
@ -497,6 +503,7 @@ def test_no_raise_on_lag():
|
|||
# internals when the no raise flag is set.
|
||||
loglevel='warning',
|
||||
),
|
||||
collapse_eg(),
|
||||
trio.open_nursery() as n,
|
||||
):
|
||||
n.start_soon(slow)
|
||||
|
|
|
@ -3,6 +3,10 @@ Reminders for oddities in `trio` that we need to stay aware of and/or
|
|||
want to see changed.
|
||||
|
||||
'''
|
||||
from contextlib import (
|
||||
asynccontextmanager as acm,
|
||||
)
|
||||
|
||||
import pytest
|
||||
import trio
|
||||
from trio import TaskStatus
|
||||
|
@ -60,7 +64,9 @@ def test_stashed_child_nursery(use_start_soon):
|
|||
async def main():
|
||||
|
||||
async with (
|
||||
trio.open_nursery() as pn,
|
||||
trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
) as pn,
|
||||
):
|
||||
cn = await pn.start(mk_child_nursery)
|
||||
assert cn
|
||||
|
@ -80,3 +86,118 @@ def test_stashed_child_nursery(use_start_soon):
|
|||
|
||||
with pytest.raises(NameError):
|
||||
trio.run(main)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
('unmask_from_canc', 'canc_from_finally'),
|
||||
[
|
||||
(True, False),
|
||||
(True, True),
|
||||
pytest.param(False, True,
|
||||
marks=pytest.mark.xfail(reason="never raises!")
|
||||
),
|
||||
],
|
||||
# TODO, ask ronny how to impl this .. XD
|
||||
# ids='unmask_from_canc={0}, canc_from_finally={1}',#.format,
|
||||
)
|
||||
def test_acm_embedded_nursery_propagates_enter_err(
|
||||
canc_from_finally: bool,
|
||||
unmask_from_canc: bool,
|
||||
debug_mode: bool,
|
||||
):
|
||||
'''
|
||||
Demo how a masking `trio.Cancelled` could be handled by unmasking from the
|
||||
`.__context__` field when a user (by accident) re-raises from a `finally:`.
|
||||
|
||||
'''
|
||||
import tractor
|
||||
|
||||
@acm
|
||||
async def maybe_raise_from_masking_exc(
|
||||
tn: trio.Nursery,
|
||||
unmask_from: BaseException|None = trio.Cancelled
|
||||
|
||||
# TODO, maybe offer a collection?
|
||||
# unmask_from: set[BaseException] = {
|
||||
# trio.Cancelled,
|
||||
# },
|
||||
):
|
||||
if not unmask_from:
|
||||
yield
|
||||
return
|
||||
|
||||
try:
|
||||
yield
|
||||
except* unmask_from as be_eg:
|
||||
|
||||
# TODO, if we offer `unmask_from: set`
|
||||
# for masker_exc_type in unmask_from:
|
||||
|
||||
matches, rest = be_eg.split(unmask_from)
|
||||
if not matches:
|
||||
raise
|
||||
|
||||
for exc_match in be_eg.exceptions:
|
||||
if (
|
||||
(exc_ctx := exc_match.__context__)
|
||||
and
|
||||
type(exc_ctx) not in {
|
||||
# trio.Cancelled, # always by default?
|
||||
unmask_from,
|
||||
}
|
||||
):
|
||||
exc_ctx.add_note(
|
||||
f'\n'
|
||||
f'WARNING: the above error was masked by a {unmask_from!r} !?!\n'
|
||||
f'Are you always cancelling? Say from a `finally:` ?\n\n'
|
||||
|
||||
f'{tn!r}'
|
||||
)
|
||||
raise exc_ctx from exc_match
|
||||
|
||||
|
||||
@acm
|
||||
async def wraps_tn_that_always_cancels():
|
||||
async with (
|
||||
trio.open_nursery() as tn,
|
||||
maybe_raise_from_masking_exc(
|
||||
tn=tn,
|
||||
unmask_from=(
|
||||
trio.Cancelled
|
||||
if unmask_from_canc
|
||||
else None
|
||||
),
|
||||
)
|
||||
):
|
||||
try:
|
||||
yield tn
|
||||
finally:
|
||||
if canc_from_finally:
|
||||
tn.cancel_scope.cancel()
|
||||
await trio.lowlevel.checkpoint()
|
||||
|
||||
async def _main():
|
||||
with tractor.devx.maybe_open_crash_handler(
|
||||
pdb=debug_mode,
|
||||
) as bxerr:
|
||||
assert not bxerr.value
|
||||
|
||||
async with (
|
||||
wraps_tn_that_always_cancels() as tn,
|
||||
):
|
||||
assert not tn.cancel_scope.cancel_called
|
||||
assert 0
|
||||
|
||||
assert (
|
||||
(err := bxerr.value)
|
||||
and
|
||||
type(err) is AssertionError
|
||||
)
|
||||
|
||||
with pytest.raises(ExceptionGroup) as excinfo:
|
||||
trio.run(_main)
|
||||
|
||||
eg: ExceptionGroup = excinfo.value
|
||||
assert_eg, rest_eg = eg.split(AssertionError)
|
||||
|
||||
assert len(assert_eg.exceptions) == 1
|
||||
|
|
|
@ -43,6 +43,7 @@ from ._state import (
|
|||
current_actor as current_actor,
|
||||
is_root_process as is_root_process,
|
||||
current_ipc_ctx as current_ipc_ctx,
|
||||
debug_mode as debug_mode
|
||||
)
|
||||
from ._exceptions import (
|
||||
ContextCancelled as ContextCancelled,
|
||||
|
@ -65,3 +66,4 @@ from ._root import (
|
|||
from ._ipc import Channel as Channel
|
||||
from ._portal import Portal as Portal
|
||||
from ._runtime import Actor as Actor
|
||||
from . import hilevel as hilevel
|
||||
|
|
|
@ -19,10 +19,13 @@ Actor cluster helpers.
|
|||
|
||||
'''
|
||||
from __future__ import annotations
|
||||
|
||||
from contextlib import asynccontextmanager as acm
|
||||
from contextlib import (
|
||||
asynccontextmanager as acm,
|
||||
)
|
||||
from multiprocessing import cpu_count
|
||||
from typing import AsyncGenerator, Optional
|
||||
from typing import (
|
||||
AsyncGenerator,
|
||||
)
|
||||
|
||||
import trio
|
||||
import tractor
|
||||
|
|
|
@ -950,7 +950,7 @@ class Context:
|
|||
# f'Context.cancel() => {self.chan.uid}\n'
|
||||
f'c)=> {self.chan.uid}\n'
|
||||
# f'{self.chan.uid}\n'
|
||||
f' |_ @{self.dst_maddr}\n'
|
||||
f' |_ @{self.dst_maddr}\n'
|
||||
f' >> {self.repr_rpc}\n'
|
||||
# f' >> {self._nsf}() -> {codec}[dict]:\n\n'
|
||||
# TODO: pull msg-type from spec re #320
|
||||
|
@ -1003,7 +1003,8 @@ class Context:
|
|||
)
|
||||
else:
|
||||
log.cancel(
|
||||
'Timed out on cancel request of remote task?\n'
|
||||
f'Timed out on cancel request of remote task?\n'
|
||||
f'\n'
|
||||
f'{reminfo}'
|
||||
)
|
||||
|
||||
|
@ -1560,12 +1561,12 @@ class Context:
|
|||
strict_pld_parity=strict_pld_parity,
|
||||
hide_tb=hide_tb,
|
||||
)
|
||||
except BaseException as err:
|
||||
except BaseException as _bexc:
|
||||
err = _bexc
|
||||
if not isinstance(err, MsgTypeError):
|
||||
__tracebackhide__: bool = False
|
||||
|
||||
raise
|
||||
|
||||
raise err
|
||||
|
||||
# TODO: maybe a flag to by-pass encode op if already done
|
||||
# here in caller?
|
||||
|
@ -1982,7 +1983,10 @@ async def open_context_from_portal(
|
|||
ctxc_from_callee: ContextCancelled|None = None
|
||||
try:
|
||||
async with (
|
||||
trio.open_nursery() as tn,
|
||||
trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
) as tn,
|
||||
|
||||
msgops.maybe_limit_plds(
|
||||
ctx=ctx,
|
||||
spec=ctx_meta.get('pld_spec'),
|
||||
|
|
|
@ -238,7 +238,7 @@ def _trio_main(
|
|||
nest_from_op(
|
||||
input_op='>(', # see syntax ideas above
|
||||
tree_str=actor_info,
|
||||
back_from_op=1,
|
||||
back_from_op=2, # since "complete"
|
||||
)
|
||||
)
|
||||
logmeth = log.info
|
||||
|
|
|
@ -22,6 +22,7 @@ from __future__ import annotations
|
|||
import builtins
|
||||
import importlib
|
||||
from pprint import pformat
|
||||
from pdb import bdb
|
||||
import sys
|
||||
from types import (
|
||||
TracebackType,
|
||||
|
@ -82,6 +83,48 @@ class InternalError(RuntimeError):
|
|||
|
||||
'''
|
||||
|
||||
class AsyncioCancelled(Exception):
|
||||
'''
|
||||
Asyncio cancelled translation (non-base) error
|
||||
for use with the ``to_asyncio`` module
|
||||
to be raised in the ``trio`` side task
|
||||
|
||||
NOTE: this should NOT inherit from `asyncio.CancelledError` or
|
||||
tests should break!
|
||||
|
||||
'''
|
||||
|
||||
|
||||
class AsyncioTaskExited(Exception):
|
||||
'''
|
||||
asyncio.Task "exited" translation error for use with the
|
||||
`to_asyncio` APIs to be raised in the `trio` side task indicating
|
||||
on `.run_task()`/`.open_channel_from()` exit that the aio side
|
||||
exited early/silently.
|
||||
|
||||
'''
|
||||
|
||||
class TrioCancelled(Exception):
|
||||
'''
|
||||
Trio cancelled translation (non-base) error
|
||||
for use with the `to_asyncio` module
|
||||
to be raised in the `asyncio.Task` to indicate
|
||||
that the `trio` side raised `Cancelled` or an error.
|
||||
|
||||
'''
|
||||
|
||||
class TrioTaskExited(Exception):
|
||||
'''
|
||||
The `trio`-side task exited without explicitly cancelling the
|
||||
`asyncio.Task` peer.
|
||||
|
||||
This is very similar to how `trio.ClosedResource` acts as
|
||||
a "clean shutdown" signal to the consumer side of a mem-chan,
|
||||
|
||||
https://trio.readthedocs.io/en/stable/reference-core.html#clean-shutdown-with-channels
|
||||
|
||||
'''
|
||||
|
||||
|
||||
# NOTE: more or less should be close to these:
|
||||
# 'boxed_type',
|
||||
|
@ -127,8 +170,8 @@ _body_fields: list[str] = list(
|
|||
|
||||
def get_err_type(type_name: str) -> BaseException|None:
|
||||
'''
|
||||
Look up an exception type by name from the set of locally
|
||||
known namespaces:
|
||||
Look up an exception type by name from the set of locally known
|
||||
namespaces:
|
||||
|
||||
- `builtins`
|
||||
- `tractor._exceptions`
|
||||
|
@ -139,6 +182,7 @@ def get_err_type(type_name: str) -> BaseException|None:
|
|||
builtins,
|
||||
_this_mod,
|
||||
trio,
|
||||
bdb,
|
||||
]:
|
||||
if type_ref := getattr(
|
||||
ns,
|
||||
|
@ -358,6 +402,13 @@ class RemoteActorError(Exception):
|
|||
self._ipc_msg.src_type_str
|
||||
)
|
||||
|
||||
if not self._src_type:
|
||||
raise TypeError(
|
||||
f'Failed to lookup src error type with '
|
||||
f'`tractor._exceptions.get_err_type()` :\n'
|
||||
f'{self.src_type_str}'
|
||||
)
|
||||
|
||||
return self._src_type
|
||||
|
||||
@property
|
||||
|
@ -366,6 +417,9 @@ class RemoteActorError(Exception):
|
|||
String-name of the (last hop's) boxed error type.
|
||||
|
||||
'''
|
||||
# TODO, maybe support also serializing the
|
||||
# `ExceptionGroup.exeptions: list[BaseException]` set under
|
||||
# certain conditions?
|
||||
bt: Type[BaseException] = self.boxed_type
|
||||
if bt:
|
||||
return str(bt.__name__)
|
||||
|
@ -652,16 +706,10 @@ class RemoteActorError(Exception):
|
|||
failing actor's remote env.
|
||||
|
||||
'''
|
||||
src_type_ref: Type[BaseException] = self.src_type
|
||||
if not src_type_ref:
|
||||
raise TypeError(
|
||||
'Failed to lookup src error type:\n'
|
||||
f'{self.src_type_str}'
|
||||
)
|
||||
|
||||
# TODO: better tb insertion and all the fancier dunder
|
||||
# metadata stuff as per `.__context__` etc. and friends:
|
||||
# https://github.com/python-trio/trio/issues/611
|
||||
src_type_ref: Type[BaseException] = self.src_type
|
||||
return src_type_ref(self.tb_str)
|
||||
|
||||
# TODO: local recontruction of nested inception for a given
|
||||
|
@ -787,8 +835,11 @@ class MsgTypeError(
|
|||
'''
|
||||
if (
|
||||
(_bad_msg := self.msgdata.get('_bad_msg'))
|
||||
and
|
||||
isinstance(_bad_msg, PayloadMsg)
|
||||
and (
|
||||
isinstance(_bad_msg, PayloadMsg)
|
||||
or
|
||||
isinstance(_bad_msg, msgtypes.Start)
|
||||
)
|
||||
):
|
||||
return _bad_msg
|
||||
|
||||
|
@ -981,18 +1032,6 @@ class MessagingError(Exception):
|
|||
|
||||
'''
|
||||
|
||||
class AsyncioCancelled(Exception):
|
||||
'''
|
||||
Asyncio cancelled translation (non-base) error
|
||||
for use with the ``to_asyncio`` module
|
||||
to be raised in the ``trio`` side task
|
||||
|
||||
NOTE: this should NOT inherit from `asyncio.CancelledError` or
|
||||
tests should break!
|
||||
|
||||
'''
|
||||
|
||||
|
||||
def pack_error(
|
||||
exc: BaseException|RemoteActorError,
|
||||
|
||||
|
@ -1146,19 +1185,51 @@ def unpack_error(
|
|||
|
||||
|
||||
def is_multi_cancelled(
|
||||
exc: BaseException|BaseExceptionGroup
|
||||
) -> bool:
|
||||
exc: BaseException|BaseExceptionGroup,
|
||||
|
||||
ignore_nested: set[BaseException] = set(),
|
||||
|
||||
) -> bool|BaseExceptionGroup:
|
||||
'''
|
||||
Predicate to determine if a possible ``BaseExceptionGroup`` contains
|
||||
only ``trio.Cancelled`` sub-exceptions (and is likely the result of
|
||||
cancelling a collection of subtasks.
|
||||
Predicate to determine if an `BaseExceptionGroup` only contains
|
||||
some (maybe nested) set of sub-grouped exceptions (like only
|
||||
`trio.Cancelled`s which get swallowed silently by default) and is
|
||||
thus the result of "gracefully cancelling" a collection of
|
||||
sub-tasks (or other conc primitives) and receiving a "cancelled
|
||||
ACK" from each after termination.
|
||||
|
||||
Docs:
|
||||
----
|
||||
- https://docs.python.org/3/library/exceptions.html#exception-groups
|
||||
- https://docs.python.org/3/library/exceptions.html#BaseExceptionGroup.subgroup
|
||||
|
||||
'''
|
||||
|
||||
if (
|
||||
not ignore_nested
|
||||
or
|
||||
trio.Cancelled in ignore_nested
|
||||
# XXX always count-in `trio`'s native signal
|
||||
):
|
||||
ignore_nested.update({trio.Cancelled})
|
||||
|
||||
if isinstance(exc, BaseExceptionGroup):
|
||||
return exc.subgroup(
|
||||
lambda exc: isinstance(exc, trio.Cancelled)
|
||||
) is not None
|
||||
matched_exc: BaseExceptionGroup|None = exc.subgroup(
|
||||
tuple(ignore_nested),
|
||||
|
||||
# TODO, complain about why not allowed XD
|
||||
# condition=tuple(ignore_nested),
|
||||
)
|
||||
if matched_exc is not None:
|
||||
return matched_exc
|
||||
|
||||
# NOTE, IFF no excs types match (throughout the error-tree)
|
||||
# -> return `False`, OW return the matched sub-eg.
|
||||
#
|
||||
# IOW, for the inverse of ^ for the purpose of
|
||||
# maybe-enter-REPL--logic: "only debug when the err-tree contains
|
||||
# at least one exc-type NOT in `ignore_nested`" ; i.e. the case where
|
||||
# we fallthrough and return `False` here.
|
||||
return False
|
||||
|
||||
|
||||
|
|
|
@ -255,8 +255,8 @@ class MsgpackTCPStream(MsgTransport):
|
|||
raise TransportClosed(
|
||||
message=(
|
||||
f'IPC transport already closed by peer\n'
|
||||
f'x)> {type(trans_err)}\n'
|
||||
f' |_{self}\n'
|
||||
f'x]> {type(trans_err)}\n'
|
||||
f' |_{self}\n'
|
||||
),
|
||||
loglevel=loglevel,
|
||||
) from trans_err
|
||||
|
@ -273,8 +273,8 @@ class MsgpackTCPStream(MsgTransport):
|
|||
raise TransportClosed(
|
||||
message=(
|
||||
f'IPC transport already manually closed locally?\n'
|
||||
f'x)> {type(closure_err)} \n'
|
||||
f' |_{self}\n'
|
||||
f'x]> {type(closure_err)} \n'
|
||||
f' |_{self}\n'
|
||||
),
|
||||
loglevel='error',
|
||||
raise_on_report=(
|
||||
|
@ -289,8 +289,8 @@ class MsgpackTCPStream(MsgTransport):
|
|||
raise TransportClosed(
|
||||
message=(
|
||||
f'IPC transport already gracefully closed\n'
|
||||
f')>\n'
|
||||
f'|_{self}\n'
|
||||
f']>\n'
|
||||
f' |_{self}\n'
|
||||
),
|
||||
loglevel='transport',
|
||||
# cause=??? # handy or no?
|
||||
|
|
|
@ -533,6 +533,10 @@ async def open_portal(
|
|||
async with maybe_open_nursery(
|
||||
tn,
|
||||
shield=shield,
|
||||
strict_exception_groups=False,
|
||||
# ^XXX^ TODO? soo roll our own then ??
|
||||
# -> since we kinda want the "if only one `.exception` then
|
||||
# just raise that" interface?
|
||||
) as tn:
|
||||
|
||||
if not channel.connected():
|
||||
|
|
|
@ -95,6 +95,13 @@ async def open_root_actor(
|
|||
|
||||
hide_tb: bool = True,
|
||||
|
||||
# XXX, proxied directly to `.devx._debug._maybe_enter_pm()`
|
||||
# for REPL-entry logic.
|
||||
debug_filter: Callable[
|
||||
[BaseException|BaseExceptionGroup],
|
||||
bool,
|
||||
] = lambda err: not is_multi_cancelled(err),
|
||||
|
||||
# TODO, a way for actors to augment passing derived
|
||||
# read-only state to sublayers?
|
||||
# extra_rt_vars: dict|None = None,
|
||||
|
@ -104,8 +111,8 @@ async def open_root_actor(
|
|||
Runtime init entry point for ``tractor``.
|
||||
|
||||
'''
|
||||
__tracebackhide__: bool = hide_tb
|
||||
_debug.hide_runtime_frames()
|
||||
__tracebackhide__: bool = hide_tb
|
||||
|
||||
# TODO: stick this in a `@cm` defined in `devx._debug`?
|
||||
#
|
||||
|
@ -334,6 +341,10 @@ async def open_root_actor(
|
|||
loglevel=loglevel,
|
||||
enable_modules=enable_modules,
|
||||
)
|
||||
# XXX, in case the root actor runtime was actually run from
|
||||
# `tractor.to_asyncio.run_as_asyncio_guest()` and NOt
|
||||
# `.trio.run()`.
|
||||
actor._infected_aio = _state._runtime_vars['_is_infected_aio']
|
||||
|
||||
# Start up main task set via core actor-runtime nurseries.
|
||||
try:
|
||||
|
@ -351,7 +362,10 @@ async def open_root_actor(
|
|||
)
|
||||
|
||||
# start the actor runtime in a new task
|
||||
async with trio.open_nursery() as nursery:
|
||||
async with trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
# ^XXX^ TODO? instead unpack any RAE as per "loose" style?
|
||||
) as nursery:
|
||||
|
||||
# ``_runtime.async_main()`` creates an internal nursery
|
||||
# and blocks here until any underlying actor(-process)
|
||||
|
@ -375,6 +389,13 @@ async def open_root_actor(
|
|||
Exception,
|
||||
BaseExceptionGroup,
|
||||
) as err:
|
||||
|
||||
# TODO, in beginning to handle the subsubactor with
|
||||
# crashed grandparent cases..
|
||||
#
|
||||
# was_locked: bool = await _debug.maybe_wait_for_debugger(
|
||||
# child_in_debug=True,
|
||||
# )
|
||||
# XXX NOTE XXX see equiv note inside
|
||||
# `._runtime.Actor._stream_handler()` where in the
|
||||
# non-root or root-that-opened-this-mahually case we
|
||||
|
@ -383,11 +404,15 @@ async def open_root_actor(
|
|||
entered: bool = await _debug._maybe_enter_pm(
|
||||
err,
|
||||
api_frame=inspect.currentframe(),
|
||||
debug_filter=debug_filter,
|
||||
)
|
||||
|
||||
if (
|
||||
not entered
|
||||
and
|
||||
not is_multi_cancelled(err)
|
||||
not is_multi_cancelled(
|
||||
err,
|
||||
)
|
||||
):
|
||||
logger.exception('Root actor crashed\n')
|
||||
|
||||
|
@ -441,12 +466,19 @@ def run_daemon(
|
|||
|
||||
start_method: str | None = None,
|
||||
debug_mode: bool = False,
|
||||
|
||||
# TODO, support `infected_aio=True` mode by,
|
||||
# - calling the appropriate entrypoint-func from `.to_asyncio`
|
||||
# - maybe init-ing `greenback` as done above in
|
||||
# `open_root_actor()`.
|
||||
|
||||
**kwargs
|
||||
|
||||
) -> None:
|
||||
'''
|
||||
Spawn daemon actor which will respond to RPC; the main task simply
|
||||
starts the runtime and then sleeps forever.
|
||||
Spawn a root (daemon) actor which will respond to RPC; the main
|
||||
task simply starts the runtime and then blocks via embedded
|
||||
`trio.sleep_forever()`.
|
||||
|
||||
This is a very minimal convenience wrapper around starting
|
||||
a "run-until-cancelled" root actor which can be started with a set
|
||||
|
@ -459,7 +491,6 @@ def run_daemon(
|
|||
importlib.import_module(path)
|
||||
|
||||
async def _main():
|
||||
|
||||
async with open_root_actor(
|
||||
registry_addrs=registry_addrs,
|
||||
name=name,
|
||||
|
|
|
@ -621,7 +621,11 @@ async def _invoke(
|
|||
tn: trio.Nursery
|
||||
rpc_ctx_cs: CancelScope
|
||||
async with (
|
||||
trio.open_nursery() as tn,
|
||||
trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
# ^XXX^ TODO? instead unpack any RAE as per "loose" style?
|
||||
|
||||
) as tn,
|
||||
msgops.maybe_limit_plds(
|
||||
ctx=ctx,
|
||||
spec=ctx_meta.get('pld_spec'),
|
||||
|
@ -734,8 +738,8 @@ async def _invoke(
|
|||
# XXX: do we ever trigger this block any more?
|
||||
except (
|
||||
BaseExceptionGroup,
|
||||
trio.Cancelled,
|
||||
BaseException,
|
||||
trio.Cancelled,
|
||||
|
||||
) as scope_error:
|
||||
if (
|
||||
|
@ -848,8 +852,8 @@ async def try_ship_error_to_remote(
|
|||
log.critical(
|
||||
'IPC transport failure -> '
|
||||
f'failed to ship error to {remote_descr}!\n\n'
|
||||
f'X=> {channel.uid}\n\n'
|
||||
|
||||
f'{type(msg)!r}[{msg.boxed_type_str}] X=> {channel.uid}\n'
|
||||
f'\n'
|
||||
# TODO: use `.msg.preetty_struct` for this!
|
||||
f'{msg}\n'
|
||||
)
|
||||
|
|
|
@ -1287,7 +1287,8 @@ class Actor:
|
|||
msg: str = (
|
||||
f'Actor-runtime cancel request from {requester_type}\n\n'
|
||||
f'<=c) {requesting_uid}\n'
|
||||
f' |_{self}\n'
|
||||
f' |_{self}\n'
|
||||
f'\n'
|
||||
)
|
||||
|
||||
# TODO: what happens here when we self-cancel tho?
|
||||
|
@ -1307,13 +1308,15 @@ class Actor:
|
|||
lock_req_ctx.has_outcome
|
||||
):
|
||||
msg += (
|
||||
'-> Cancelling active debugger request..\n'
|
||||
f'\n'
|
||||
f'-> Cancelling active debugger request..\n'
|
||||
f'|_{_debug.Lock.repr()}\n\n'
|
||||
f'|_{lock_req_ctx}\n\n'
|
||||
)
|
||||
# lock_req_ctx._scope.cancel()
|
||||
# TODO: wrap this in a method-API..
|
||||
debug_req.req_cs.cancel()
|
||||
# if lock_req_ctx:
|
||||
|
||||
# self-cancel **all** ongoing RPC tasks
|
||||
await self.cancel_rpc_tasks(
|
||||
|
@ -1722,11 +1725,15 @@ async def async_main(
|
|||
# parent is kept alive as a resilient service until
|
||||
# cancellation steps have (mostly) occurred in
|
||||
# a deterministic way.
|
||||
async with trio.open_nursery() as root_nursery:
|
||||
async with trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
) as root_nursery:
|
||||
actor._root_n = root_nursery
|
||||
assert actor._root_n
|
||||
|
||||
async with trio.open_nursery() as service_nursery:
|
||||
async with trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
) as service_nursery:
|
||||
# This nursery is used to handle all inbound
|
||||
# connections to us such that if the TCP server
|
||||
# is killed, connections can continue to process
|
||||
|
|
|
@ -323,9 +323,10 @@ async def soft_kill(
|
|||
uid: tuple[str, str] = portal.channel.uid
|
||||
try:
|
||||
log.cancel(
|
||||
'Soft killing sub-actor via portal request\n'
|
||||
f'c)> {portal.chan.uid}\n'
|
||||
f' |_{proc}\n'
|
||||
f'Soft killing sub-actor via portal request\n'
|
||||
f'\n'
|
||||
f'(c=> {portal.chan.uid}\n'
|
||||
f' |_{proc}\n'
|
||||
)
|
||||
# wait on sub-proc to signal termination
|
||||
await wait_func(proc)
|
||||
|
|
|
@ -108,6 +108,7 @@ def is_main_process() -> bool:
|
|||
return mp.current_process().name == 'MainProcess'
|
||||
|
||||
|
||||
# TODO, more verby name?
|
||||
def debug_mode() -> bool:
|
||||
'''
|
||||
Bool determining if "debug mode" is on which enables
|
||||
|
|
|
@ -376,7 +376,7 @@ class MsgStream(trio.abc.Channel):
|
|||
f'Stream self-closed by {self._ctx.side!r}-side before EoC\n'
|
||||
# } bc a stream is a "scope"/msging-phase inside an IPC
|
||||
f'x}}>\n'
|
||||
f'|_{self}\n'
|
||||
f' |_{self}\n'
|
||||
)
|
||||
log.cancel(message)
|
||||
self._eoc = trio.EndOfChannel(message)
|
||||
|
|
|
@ -395,17 +395,23 @@ async def _open_and_supervise_one_cancels_all_nursery(
|
|||
# `ActorNursery.start_actor()`).
|
||||
|
||||
# errors from this daemon actor nursery bubble up to caller
|
||||
async with trio.open_nursery() as da_nursery:
|
||||
async with trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
# ^XXX^ TODO? instead unpack any RAE as per "loose" style?
|
||||
) as da_nursery:
|
||||
try:
|
||||
# This is the inner level "run in actor" nursery. It is
|
||||
# awaited first since actors spawned in this way (using
|
||||
# ``ActorNusery.run_in_actor()``) are expected to only
|
||||
# `ActorNusery.run_in_actor()`) are expected to only
|
||||
# return a single result and then complete (i.e. be canclled
|
||||
# gracefully). Errors collected from these actors are
|
||||
# immediately raised for handling by a supervisor strategy.
|
||||
# As such if the strategy propagates any error(s) upwards
|
||||
# the above "daemon actor" nursery will be notified.
|
||||
async with trio.open_nursery() as ria_nursery:
|
||||
async with trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
# ^XXX^ TODO? instead unpack any RAE as per "loose" style?
|
||||
) as ria_nursery:
|
||||
|
||||
an = ActorNursery(
|
||||
actor,
|
||||
|
@ -472,8 +478,8 @@ async def _open_and_supervise_one_cancels_all_nursery(
|
|||
ContextCancelled,
|
||||
}:
|
||||
log.cancel(
|
||||
'Actor-nursery caught remote cancellation\n\n'
|
||||
|
||||
'Actor-nursery caught remote cancellation\n'
|
||||
'\n'
|
||||
f'{inner_err.tb_str}'
|
||||
)
|
||||
else:
|
||||
|
@ -565,7 +571,9 @@ async def _open_and_supervise_one_cancels_all_nursery(
|
|||
@acm
|
||||
# @api_frame
|
||||
async def open_nursery(
|
||||
hide_tb: bool = True,
|
||||
**kwargs,
|
||||
# ^TODO, paramspec for `open_root_actor()`
|
||||
|
||||
) -> typing.AsyncGenerator[ActorNursery, None]:
|
||||
'''
|
||||
|
@ -583,7 +591,7 @@ async def open_nursery(
|
|||
which cancellation scopes correspond to each spawned subactor set.
|
||||
|
||||
'''
|
||||
__tracebackhide__: bool = True
|
||||
__tracebackhide__: bool = hide_tb
|
||||
implicit_runtime: bool = False
|
||||
actor: Actor = current_actor(err_on_no_runtime=False)
|
||||
an: ActorNursery|None = None
|
||||
|
@ -599,7 +607,10 @@ async def open_nursery(
|
|||
# mark us for teardown on exit
|
||||
implicit_runtime: bool = True
|
||||
|
||||
async with open_root_actor(**kwargs) as actor:
|
||||
async with open_root_actor(
|
||||
hide_tb=hide_tb,
|
||||
**kwargs,
|
||||
) as actor:
|
||||
assert actor is current_actor()
|
||||
|
||||
try:
|
||||
|
@ -637,8 +648,10 @@ async def open_nursery(
|
|||
# show frame on any internal runtime-scope error
|
||||
if (
|
||||
an
|
||||
and not an.cancelled
|
||||
and an._scope_error
|
||||
and
|
||||
not an.cancelled
|
||||
and
|
||||
an._scope_error
|
||||
):
|
||||
__tracebackhide__: bool = False
|
||||
|
||||
|
|
|
@ -19,7 +19,10 @@ Various helpers/utils for auditing your `tractor` app and/or the
|
|||
core runtime.
|
||||
|
||||
'''
|
||||
from contextlib import asynccontextmanager as acm
|
||||
from contextlib import (
|
||||
asynccontextmanager as acm,
|
||||
)
|
||||
import os
|
||||
import pathlib
|
||||
|
||||
import tractor
|
||||
|
@ -59,7 +62,12 @@ def mk_cmd(
|
|||
exs_subpath: str = 'debugging',
|
||||
) -> str:
|
||||
'''
|
||||
Generate a shell command suitable to pass to ``pexpect.spawn()``.
|
||||
Generate a shell command suitable to pass to `pexpect.spawn()`
|
||||
which runs the script as a python program's entrypoint.
|
||||
|
||||
In particular ensure we disable the new tb coloring via unsetting
|
||||
`$PYTHON_COLORS` so that `pexpect` can pattern match without
|
||||
color-escape-codes.
|
||||
|
||||
'''
|
||||
script_path: pathlib.Path = (
|
||||
|
@ -67,10 +75,15 @@ def mk_cmd(
|
|||
/ exs_subpath
|
||||
/ f'{ex_name}.py'
|
||||
)
|
||||
return ' '.join([
|
||||
py_cmd: str = ' '.join([
|
||||
'python',
|
||||
str(script_path)
|
||||
])
|
||||
# XXX, required for py 3.13+
|
||||
# https://docs.python.org/3/using/cmdline.html#using-on-controlling-color
|
||||
# https://docs.python.org/3/using/cmdline.html#envvar-PYTHON_COLORS
|
||||
os.environ['PYTHON_COLORS'] = '0'
|
||||
return py_cmd
|
||||
|
||||
|
||||
@acm
|
||||
|
|
|
@ -41,3 +41,38 @@ from .pformat import (
|
|||
pformat_caller_frame as pformat_caller_frame,
|
||||
pformat_boxed_tb as pformat_boxed_tb,
|
||||
)
|
||||
|
||||
|
||||
def _enable_readline_feats() -> str:
|
||||
'''
|
||||
Handle `readline` when compiled with `libedit` to avoid breaking
|
||||
tab completion in `pdbp` (and its dep `tabcompleter`)
|
||||
particularly since `uv` cpython distis are compiled this way..
|
||||
|
||||
See docs for deats,
|
||||
https://docs.python.org/3/library/readline.html#module-readline
|
||||
|
||||
Originally discovered soln via SO answer,
|
||||
https://stackoverflow.com/q/49287102
|
||||
|
||||
'''
|
||||
import readline
|
||||
if (
|
||||
# 3.13+ attr
|
||||
# https://docs.python.org/3/library/readline.html#readline.backend
|
||||
(getattr(readline, 'backend', False) == 'libedit')
|
||||
or
|
||||
'libedit' in readline.__doc__
|
||||
):
|
||||
readline.parse_and_bind("python:bind -v")
|
||||
readline.parse_and_bind("python:bind ^I rl_complete")
|
||||
return 'libedit'
|
||||
else:
|
||||
readline.parse_and_bind("tab: complete")
|
||||
readline.parse_and_bind("set editing-mode vi")
|
||||
readline.parse_and_bind("set keymap vi")
|
||||
return 'readline'
|
||||
|
||||
|
||||
# TODO, move this to a new `.devx._pdbp` mod?
|
||||
_enable_readline_feats()
|
||||
|
|
|
@ -75,6 +75,7 @@ from tractor import _state
|
|||
from tractor._exceptions import (
|
||||
InternalError,
|
||||
NoRuntime,
|
||||
is_multi_cancelled,
|
||||
)
|
||||
from tractor._state import (
|
||||
current_actor,
|
||||
|
@ -316,7 +317,6 @@ class Lock:
|
|||
we_released: bool = False
|
||||
ctx_in_debug: Context|None = cls.ctx_in_debug
|
||||
repl_task: Task|Thread|None = DebugStatus.repl_task
|
||||
|
||||
try:
|
||||
if not DebugStatus.is_main_trio_thread():
|
||||
thread: threading.Thread = threading.current_thread()
|
||||
|
@ -331,6 +331,10 @@ class Lock:
|
|||
return False
|
||||
|
||||
task: Task = current_task()
|
||||
message: str = (
|
||||
'TTY NOT RELEASED on behalf of caller\n'
|
||||
f'|_{task}\n'
|
||||
)
|
||||
|
||||
# sanity check that if we're the root actor
|
||||
# the lock is marked as such.
|
||||
|
@ -345,11 +349,6 @@ class Lock:
|
|||
else:
|
||||
assert DebugStatus.repl_task is not task
|
||||
|
||||
message: str = (
|
||||
'TTY lock was NOT released on behalf of caller\n'
|
||||
f'|_{task}\n'
|
||||
)
|
||||
|
||||
lock: trio.StrictFIFOLock = cls._debug_lock
|
||||
owner: Task = lock.statistics().owner
|
||||
if (
|
||||
|
@ -364,23 +363,21 @@ class Lock:
|
|||
# correct task, greenback-spawned-task and/or thread
|
||||
# being set to the `.repl_task` such that the above
|
||||
# condition matches and we actually release the lock.
|
||||
#
|
||||
# This is particular of note from `.pause_from_sync()`!
|
||||
|
||||
):
|
||||
cls._debug_lock.release()
|
||||
we_released: bool = True
|
||||
if repl_task:
|
||||
message: str = (
|
||||
'Lock released on behalf of root-actor-local REPL owner\n'
|
||||
'TTY released on behalf of root-actor-local REPL owner\n'
|
||||
f'|_{repl_task}\n'
|
||||
)
|
||||
else:
|
||||
message: str = (
|
||||
'TTY lock released by us on behalf of remote peer?\n'
|
||||
f'|_ctx_in_debug: {ctx_in_debug}\n\n'
|
||||
'TTY released by us on behalf of remote peer?\n'
|
||||
f'{ctx_in_debug}\n'
|
||||
)
|
||||
# mk_pdb().set_trace()
|
||||
# elif owner:
|
||||
|
||||
except RuntimeError as rte:
|
||||
log.exception(
|
||||
|
@ -398,7 +395,8 @@ class Lock:
|
|||
req_handler_finished: trio.Event|None = Lock.req_handler_finished
|
||||
if (
|
||||
not lock_stats.owner
|
||||
and req_handler_finished is None
|
||||
and
|
||||
req_handler_finished is None
|
||||
):
|
||||
message += (
|
||||
'-> No new task holds the TTY lock!\n\n'
|
||||
|
@ -416,8 +414,8 @@ class Lock:
|
|||
repl_task
|
||||
)
|
||||
message += (
|
||||
f'A non-caller task still owns this lock on behalf of '
|
||||
f'`{behalf_of_task}`\n'
|
||||
f'A non-caller task still owns this lock on behalf of\n'
|
||||
f'{behalf_of_task}\n'
|
||||
f'lock owner task: {lock_stats.owner}\n'
|
||||
)
|
||||
|
||||
|
@ -443,7 +441,8 @@ class Lock:
|
|||
f'|_{repl_task}\n'
|
||||
)
|
||||
|
||||
log.devx(message)
|
||||
if message:
|
||||
log.devx(message)
|
||||
|
||||
return we_released
|
||||
|
||||
|
@ -663,10 +662,11 @@ async def lock_stdio_for_peer(
|
|||
fail_reason: str = (
|
||||
f'on behalf of peer\n\n'
|
||||
f'x)<=\n'
|
||||
f' |_{subactor_task_uid!r}@{ctx.chan.uid!r}\n\n'
|
||||
|
||||
f' |_{subactor_task_uid!r}@{ctx.chan.uid!r}\n'
|
||||
f'\n'
|
||||
'Forcing `Lock.release()` due to acquire failure!\n\n'
|
||||
f'x)=> {ctx}\n'
|
||||
f'x)=>\n'
|
||||
f' {ctx}'
|
||||
)
|
||||
if isinstance(req_err, trio.Cancelled):
|
||||
fail_reason = (
|
||||
|
@ -1174,7 +1174,7 @@ async def request_root_stdio_lock(
|
|||
log.devx(
|
||||
'Initing stdio-lock request task with root actor'
|
||||
)
|
||||
# TODO: likely we can implement this mutex more generally as
|
||||
# TODO: can we implement this mutex more generally as
|
||||
# a `._sync.Lock`?
|
||||
# -[ ] simply add the wrapping needed for the debugger specifics?
|
||||
# - the `__pld_spec__` impl and maybe better APIs for the client
|
||||
|
@ -1185,6 +1185,7 @@ async def request_root_stdio_lock(
|
|||
# - https://docs.python.org/3.8/library/multiprocessing.html#multiprocessing.RLock
|
||||
DebugStatus.req_finished = trio.Event()
|
||||
DebugStatus.req_task = current_task()
|
||||
req_err: BaseException|None = None
|
||||
try:
|
||||
from tractor._discovery import get_root
|
||||
# NOTE: we need this to ensure that this task exits
|
||||
|
@ -1207,6 +1208,7 @@ async def request_root_stdio_lock(
|
|||
# )
|
||||
DebugStatus.req_cs = req_cs
|
||||
req_ctx: Context|None = None
|
||||
ctx_eg: BaseExceptionGroup|None = None
|
||||
try:
|
||||
# TODO: merge into single async with ?
|
||||
async with get_root() as portal:
|
||||
|
@ -1237,7 +1239,12 @@ async def request_root_stdio_lock(
|
|||
)
|
||||
|
||||
# try:
|
||||
assert status.subactor_uid == actor_uid
|
||||
if (locker := status.subactor_uid) != actor_uid:
|
||||
raise DebugStateError(
|
||||
f'Root actor locked by another peer !?\n'
|
||||
f'locker: {locker!r}\n'
|
||||
f'actor_uid: {actor_uid}\n'
|
||||
)
|
||||
assert status.cid
|
||||
# except AttributeError:
|
||||
# log.exception('failed pldspec asserts!')
|
||||
|
@ -1274,10 +1281,11 @@ async def request_root_stdio_lock(
|
|||
f'Exitting {req_ctx.side!r}-side of locking req_ctx\n'
|
||||
)
|
||||
|
||||
except (
|
||||
except* (
|
||||
tractor.ContextCancelled,
|
||||
trio.Cancelled,
|
||||
):
|
||||
) as _taskc_eg:
|
||||
ctx_eg = _taskc_eg
|
||||
log.cancel(
|
||||
'Debug lock request was CANCELLED?\n\n'
|
||||
f'<=c) {req_ctx}\n'
|
||||
|
@ -1286,21 +1294,23 @@ async def request_root_stdio_lock(
|
|||
)
|
||||
raise
|
||||
|
||||
except (
|
||||
except* (
|
||||
BaseException,
|
||||
) as ctx_err:
|
||||
) as _ctx_eg:
|
||||
ctx_eg = _ctx_eg
|
||||
message: str = (
|
||||
'Failed during debug request dialog with root actor?\n\n'
|
||||
'Failed during debug request dialog with root actor?\n'
|
||||
)
|
||||
if (req_ctx := DebugStatus.req_ctx):
|
||||
message += (
|
||||
f'<=x) {req_ctx}\n\n'
|
||||
f'<=x)\n'
|
||||
f' |_{req_ctx}\n'
|
||||
f'Cancelling IPC ctx!\n'
|
||||
)
|
||||
try:
|
||||
await req_ctx.cancel()
|
||||
except trio.ClosedResourceError as terr:
|
||||
ctx_err.add_note(
|
||||
ctx_eg.add_note(
|
||||
# f'Failed with {type(terr)!r} x)> `req_ctx.cancel()` '
|
||||
f'Failed with `req_ctx.cancel()` <x) {type(terr)!r} '
|
||||
)
|
||||
|
@ -1309,21 +1319,45 @@ async def request_root_stdio_lock(
|
|||
message += 'Failed in `Portal.open_context()` call ??\n'
|
||||
|
||||
log.exception(message)
|
||||
ctx_err.add_note(message)
|
||||
raise ctx_err
|
||||
ctx_eg.add_note(message)
|
||||
raise ctx_eg
|
||||
|
||||
except (
|
||||
tractor.ContextCancelled,
|
||||
trio.Cancelled,
|
||||
):
|
||||
log.cancel(
|
||||
'Debug lock request CANCELLED?\n'
|
||||
f'{req_ctx}\n'
|
||||
)
|
||||
raise
|
||||
except BaseException as _req_err:
|
||||
req_err = _req_err
|
||||
|
||||
# XXX NOTE, since new `trio` enforces strict egs by default
|
||||
# we have to always handle the eg explicitly given the
|
||||
# `Portal.open_context()` call above (which implicitly opens
|
||||
# a nursery).
|
||||
match req_err:
|
||||
case BaseExceptionGroup():
|
||||
# for an eg of just one taskc, just unpack and raise
|
||||
# since we want to propagate a plane ol' `Cancelled`
|
||||
# up from the `.pause()` call.
|
||||
excs: list[BaseException] = req_err.exceptions
|
||||
if (
|
||||
len(excs) == 1
|
||||
and
|
||||
type(exc := excs[0]) in (
|
||||
tractor.ContextCancelled,
|
||||
trio.Cancelled,
|
||||
)
|
||||
):
|
||||
log.cancel(
|
||||
'Debug lock request CANCELLED?\n'
|
||||
f'{req_ctx}\n'
|
||||
)
|
||||
raise exc
|
||||
case (
|
||||
tractor.ContextCancelled(),
|
||||
trio.Cancelled(),
|
||||
):
|
||||
log.cancel(
|
||||
'Debug lock request CANCELLED?\n'
|
||||
f'{req_ctx}\n'
|
||||
)
|
||||
raise exc
|
||||
|
||||
except BaseException as req_err:
|
||||
# log.error('Failed to request root stdio-lock?')
|
||||
DebugStatus.req_err = req_err
|
||||
DebugStatus.release()
|
||||
|
||||
|
@ -1338,7 +1372,7 @@ async def request_root_stdio_lock(
|
|||
'Failed during stdio-locking dialog from root actor\n\n'
|
||||
|
||||
f'<=x)\n'
|
||||
f'|_{DebugStatus.req_ctx}\n'
|
||||
f' |_{DebugStatus.req_ctx}\n'
|
||||
) from req_err
|
||||
|
||||
finally:
|
||||
|
@ -1401,7 +1435,7 @@ def any_connected_locker_child() -> bool:
|
|||
actor: Actor = current_actor()
|
||||
|
||||
if not is_root_process():
|
||||
raise RuntimeError('This is a root-actor only API!')
|
||||
raise InternalError('This is a root-actor only API!')
|
||||
|
||||
if (
|
||||
(ctx := Lock.ctx_in_debug)
|
||||
|
@ -1743,7 +1777,7 @@ async def _pause(
|
|||
] = trio.TASK_STATUS_IGNORED,
|
||||
**debug_func_kwargs,
|
||||
|
||||
) -> tuple[PdbREPL, Task]|None:
|
||||
) -> tuple[Task, PdbREPL]|None:
|
||||
'''
|
||||
Inner impl for `pause()` to avoid the `trio.CancelScope.__exit__()`
|
||||
stack frame when not shielded (since apparently i can't figure out
|
||||
|
@ -1929,7 +1963,7 @@ async def _pause(
|
|||
)
|
||||
with trio.CancelScope(shield=shield):
|
||||
await trio.lowlevel.checkpoint()
|
||||
return repl, task
|
||||
return (repl, task)
|
||||
|
||||
# elif repl_task:
|
||||
# log.warning(
|
||||
|
@ -2138,11 +2172,12 @@ async def _pause(
|
|||
# `_enter_repl_sync()` into a common @cm?
|
||||
except BaseException as _pause_err:
|
||||
pause_err: BaseException = _pause_err
|
||||
_repl_fail_report: str|None = _repl_fail_msg
|
||||
if isinstance(pause_err, bdb.BdbQuit):
|
||||
log.devx(
|
||||
'REPL for pdb was explicitly quit!\n'
|
||||
)
|
||||
_repl_fail_msg = None
|
||||
_repl_fail_report = None
|
||||
|
||||
# when the actor is mid-runtime cancellation the
|
||||
# `Actor._service_n` might get closed before we can spawn
|
||||
|
@ -2162,16 +2197,16 @@ async def _pause(
|
|||
return
|
||||
|
||||
elif isinstance(pause_err, trio.Cancelled):
|
||||
_repl_fail_msg = (
|
||||
_repl_fail_report += (
|
||||
'You called `tractor.pause()` from an already cancelled scope!\n\n'
|
||||
'Consider `await tractor.pause(shield=True)` to make it work B)\n'
|
||||
)
|
||||
|
||||
else:
|
||||
_repl_fail_msg += f'on behalf of {repl_task} ??\n'
|
||||
_repl_fail_report += f'on behalf of {repl_task} ??\n'
|
||||
|
||||
if _repl_fail_msg:
|
||||
log.exception(_repl_fail_msg)
|
||||
if _repl_fail_report:
|
||||
log.exception(_repl_fail_report)
|
||||
|
||||
if not actor.is_infected_aio():
|
||||
DebugStatus.release(cancel_req_task=True)
|
||||
|
@ -2252,6 +2287,13 @@ def _set_trace(
|
|||
repl.set_trace(frame=caller_frame)
|
||||
|
||||
|
||||
# XXX TODO! XXX, ensure `pytest -s` doesn't just
|
||||
# hang on this being called in a test.. XD
|
||||
# -[ ] maybe something in our test suite or is there
|
||||
# some way we can detect output capture is enabled
|
||||
# from the process itself?
|
||||
# |_ronny: ?
|
||||
#
|
||||
async def pause(
|
||||
*,
|
||||
hide_tb: bool = True,
|
||||
|
@ -2530,26 +2572,17 @@ def pause_from_sync(
|
|||
f'{actor.uid} task called `tractor.pause_from_sync()`\n'
|
||||
)
|
||||
|
||||
# TODO: once supported, remove this AND the one
|
||||
# inside `._pause()`!
|
||||
# outstanding impl fixes:
|
||||
# -[ ] need to make `.shield_sigint()` below work here!
|
||||
# -[ ] how to handle `asyncio`'s new SIGINT-handler
|
||||
# injection?
|
||||
# -[ ] should `breakpoint()` work and what does it normally
|
||||
# do in `asyncio` ctxs?
|
||||
# if actor.is_infected_aio():
|
||||
# raise RuntimeError(
|
||||
# '`tractor.pause[_from_sync]()` not yet supported '
|
||||
# 'for infected `asyncio` mode!'
|
||||
# )
|
||||
|
||||
repl: PdbREPL = mk_pdb()
|
||||
|
||||
# message += f'-> created local REPL {repl}\n'
|
||||
is_trio_thread: bool = DebugStatus.is_main_trio_thread()
|
||||
is_root: bool = is_root_process()
|
||||
is_aio: bool = actor.is_infected_aio()
|
||||
is_infected_aio: bool = actor.is_infected_aio()
|
||||
thread: Thread = threading.current_thread()
|
||||
|
||||
asyncio_task: asyncio.Task|None = None
|
||||
if is_infected_aio:
|
||||
asyncio_task = asyncio.current_task()
|
||||
|
||||
# TODO: we could also check for a non-`.to_thread` context
|
||||
# using `trio.from_thread.check_cancelled()` (says
|
||||
|
@ -2565,24 +2598,18 @@ def pause_from_sync(
|
|||
if (
|
||||
not is_trio_thread
|
||||
and
|
||||
not is_aio # see below for this usage
|
||||
not asyncio_task
|
||||
):
|
||||
# TODO: `threading.Lock()` this so we don't get races in
|
||||
# multi-thr cases where they're acquiring/releasing the
|
||||
# REPL and setting request/`Lock` state, etc..
|
||||
thread: threading.Thread = threading.current_thread()
|
||||
repl_owner = thread
|
||||
repl_owner: Thread = thread
|
||||
|
||||
# TODO: make root-actor bg thread usage work!
|
||||
if (
|
||||
is_root
|
||||
# or
|
||||
# is_aio
|
||||
):
|
||||
if is_root:
|
||||
message += (
|
||||
f'-> called from a root-actor bg {thread}\n'
|
||||
)
|
||||
if is_root:
|
||||
message += (
|
||||
f'-> called from a root-actor bg {thread}\n'
|
||||
)
|
||||
|
||||
message += (
|
||||
'-> scheduling `._pause_from_bg_root_thread()`..\n'
|
||||
|
@ -2637,34 +2664,95 @@ def pause_from_sync(
|
|||
DebugStatus.shield_sigint()
|
||||
assert bg_task is not DebugStatus.repl_task
|
||||
|
||||
# TODO: once supported, remove this AND the one
|
||||
# inside `._pause()`!
|
||||
# outstanding impl fixes:
|
||||
# -[ ] need to make `.shield_sigint()` below work here!
|
||||
# -[ ] how to handle `asyncio`'s new SIGINT-handler
|
||||
# injection?
|
||||
# -[ ] should `breakpoint()` work and what does it normally
|
||||
# do in `asyncio` ctxs?
|
||||
# if actor.is_infected_aio():
|
||||
# raise RuntimeError(
|
||||
# '`tractor.pause[_from_sync]()` not yet supported '
|
||||
# 'for infected `asyncio` mode!'
|
||||
# )
|
||||
elif (
|
||||
not is_trio_thread
|
||||
and
|
||||
is_aio
|
||||
is_infected_aio # as in, the special actor-runtime mode
|
||||
# ^NOTE XXX, that doesn't mean the caller is necessarily
|
||||
# an `asyncio.Task` just that `trio` has been embedded on
|
||||
# the `asyncio` event loop!
|
||||
and
|
||||
asyncio_task # transitive caller is an actual `asyncio.Task`
|
||||
):
|
||||
greenback: ModuleType = maybe_import_greenback()
|
||||
repl_owner: Task = asyncio.current_task()
|
||||
DebugStatus.shield_sigint()
|
||||
fute: asyncio.Future = run_trio_task_in_future(
|
||||
partial(
|
||||
_pause,
|
||||
debug_func=None,
|
||||
repl=repl,
|
||||
hide_tb=hide_tb,
|
||||
|
||||
# XXX to prevent `._pause()` for setting
|
||||
# `DebugStatus.repl_task` to the gb task!
|
||||
called_from_sync=True,
|
||||
called_from_bg_thread=True,
|
||||
if greenback.has_portal():
|
||||
DebugStatus.shield_sigint()
|
||||
fute: asyncio.Future = run_trio_task_in_future(
|
||||
partial(
|
||||
_pause,
|
||||
debug_func=None,
|
||||
repl=repl,
|
||||
hide_tb=hide_tb,
|
||||
|
||||
**_pause_kwargs
|
||||
# XXX to prevent `._pause()` for setting
|
||||
# `DebugStatus.repl_task` to the gb task!
|
||||
called_from_sync=True,
|
||||
called_from_bg_thread=True,
|
||||
|
||||
**_pause_kwargs
|
||||
)
|
||||
)
|
||||
)
|
||||
repl_owner = asyncio_task
|
||||
bg_task, _ = greenback.await_(fute)
|
||||
# TODO: ASYNC version -> `.pause_from_aio()`?
|
||||
# bg_task, _ = await fute
|
||||
|
||||
# TODO: for async version -> `.pause_from_aio()`?
|
||||
# bg_task, _ = await fute
|
||||
bg_task, _ = greenback.await_(fute)
|
||||
bg_task: asyncio.Task = asyncio.current_task()
|
||||
# handle the case where an `asyncio` task has been
|
||||
# spawned WITHOUT enabling a `greenback` portal..
|
||||
# => can often happen in 3rd party libs.
|
||||
else:
|
||||
bg_task = repl_owner
|
||||
|
||||
# TODO, ostensibly we can just acquire the
|
||||
# debug lock directly presuming we're the
|
||||
# root actor running in infected asyncio
|
||||
# mode?
|
||||
#
|
||||
# TODO, this would be a special case where
|
||||
# a `_pause_from_root()` would come in very
|
||||
# handy!
|
||||
# if is_root:
|
||||
# import pdbp; pdbp.set_trace()
|
||||
# log.warning(
|
||||
# 'Allowing `asyncio` task to acquire debug-lock in root-actor..\n'
|
||||
# 'This is not fully implemented yet; there may be teardown hangs!\n\n'
|
||||
# )
|
||||
# else:
|
||||
|
||||
# simply unsupported, since there exists no hack (i
|
||||
# can think of) to workaround this in a subactor
|
||||
# which needs to lock the root's REPL ow we're sure
|
||||
# to get prompt stdstreams clobbering..
|
||||
cf_repr: str = ''
|
||||
if api_frame:
|
||||
caller_frame: FrameType = api_frame.f_back
|
||||
cf_repr: str = f'caller_frame: {caller_frame!r}\n'
|
||||
|
||||
raise RuntimeError(
|
||||
f"CAN'T USE `greenback._await()` without a portal !?\n\n"
|
||||
f'Likely this task was NOT spawned via the `tractor.to_asyncio` API..\n'
|
||||
f'{asyncio_task}\n'
|
||||
f'{cf_repr}\n'
|
||||
|
||||
f'Prolly the task was started out-of-band (from some lib?)\n'
|
||||
f'AND one of the below was never called ??\n'
|
||||
f'- greenback.ensure_portal()\n'
|
||||
f'- greenback.bestow_portal(<task>)\n'
|
||||
)
|
||||
|
||||
else: # we are presumably the `trio.run()` + main thread
|
||||
# raises on not-found by default
|
||||
|
@ -2915,8 +3003,14 @@ async def _maybe_enter_pm(
|
|||
tb: TracebackType|None = None,
|
||||
api_frame: FrameType|None = None,
|
||||
hide_tb: bool = False,
|
||||
|
||||
# only enter debugger REPL when returns `True`
|
||||
debug_filter: Callable[
|
||||
[BaseException|BaseExceptionGroup],
|
||||
bool,
|
||||
] = lambda err: not is_multi_cancelled(err),
|
||||
|
||||
):
|
||||
from tractor._exceptions import is_multi_cancelled
|
||||
if (
|
||||
debug_mode()
|
||||
|
||||
|
@ -2933,7 +3027,8 @@ async def _maybe_enter_pm(
|
|||
|
||||
# Really we just want to mostly avoid catching KBIs here so there
|
||||
# might be a simpler check we can do?
|
||||
and not is_multi_cancelled(err)
|
||||
and
|
||||
debug_filter(err)
|
||||
):
|
||||
api_frame: FrameType = api_frame or inspect.currentframe()
|
||||
tb: TracebackType = tb or sys.exc_info()[2]
|
||||
|
@ -2993,7 +3088,8 @@ async def maybe_wait_for_debugger(
|
|||
|
||||
if (
|
||||
not debug_mode()
|
||||
and not child_in_debug
|
||||
and
|
||||
not child_in_debug
|
||||
):
|
||||
return False
|
||||
|
||||
|
@ -3051,7 +3147,7 @@ async def maybe_wait_for_debugger(
|
|||
logmeth(
|
||||
msg
|
||||
+
|
||||
'\nRoot is waiting on tty lock to release from\n\n'
|
||||
'\n^^ Root is waiting on tty lock release.. ^^\n'
|
||||
# f'{caller_frame_info}\n'
|
||||
)
|
||||
|
||||
|
@ -3105,6 +3201,15 @@ async def maybe_wait_for_debugger(
|
|||
return False
|
||||
|
||||
|
||||
class BoxedMaybeException(Struct):
|
||||
'''
|
||||
Box a maybe-exception for post-crash introspection usage
|
||||
from the body of a `open_crash_handler()` scope.
|
||||
|
||||
'''
|
||||
value: BaseException|None = None
|
||||
|
||||
|
||||
# TODO: better naming and what additionals?
|
||||
# - [ ] optional runtime plugging?
|
||||
# - [ ] detection for sync vs. async code?
|
||||
|
@ -3114,11 +3219,11 @@ async def maybe_wait_for_debugger(
|
|||
@cm
|
||||
def open_crash_handler(
|
||||
catch: set[BaseException] = {
|
||||
Exception,
|
||||
BaseException,
|
||||
},
|
||||
ignore: set[BaseException] = {
|
||||
KeyboardInterrupt,
|
||||
trio.Cancelled,
|
||||
},
|
||||
tb_hide: bool = True,
|
||||
):
|
||||
|
@ -3135,14 +3240,27 @@ def open_crash_handler(
|
|||
'''
|
||||
__tracebackhide__: bool = tb_hide
|
||||
|
||||
# TODO, yield a `outcome.Error`-like boxed type?
|
||||
# -[~] use `outcome.Value/Error` X-> frozen!
|
||||
# -[x] write our own..?
|
||||
# -[ ] consider just wtv is used by `pytest.raises()`?
|
||||
#
|
||||
boxed_maybe_exc = BoxedMaybeException()
|
||||
err: BaseException
|
||||
try:
|
||||
yield
|
||||
yield boxed_maybe_exc
|
||||
except tuple(catch) as err:
|
||||
if type(err) not in ignore:
|
||||
|
||||
# use our re-impl-ed version
|
||||
boxed_maybe_exc.value = err
|
||||
if (
|
||||
type(err) not in ignore
|
||||
and
|
||||
not is_multi_cancelled(
|
||||
err,
|
||||
ignore_nested=ignore
|
||||
)
|
||||
):
|
||||
try:
|
||||
# use our re-impl-ed version
|
||||
_post_mortem(
|
||||
repl=mk_pdb(),
|
||||
tb=sys.exc_info()[2],
|
||||
|
@ -3150,19 +3268,21 @@ def open_crash_handler(
|
|||
)
|
||||
except bdb.BdbQuit:
|
||||
__tracebackhide__: bool = False
|
||||
raise
|
||||
raise err
|
||||
|
||||
# XXX NOTE, `pdbp`'s version seems to lose the up-stack
|
||||
# tb-info?
|
||||
# pdbp.xpm()
|
||||
|
||||
raise
|
||||
raise err
|
||||
|
||||
|
||||
@cm
|
||||
def maybe_open_crash_handler(
|
||||
pdb: bool = False,
|
||||
tb_hide: bool = True,
|
||||
|
||||
**kwargs,
|
||||
):
|
||||
'''
|
||||
Same as `open_crash_handler()` but with bool input flag
|
||||
|
@ -3173,9 +3293,11 @@ def maybe_open_crash_handler(
|
|||
'''
|
||||
__tracebackhide__: bool = tb_hide
|
||||
|
||||
rtctx = nullcontext
|
||||
rtctx = nullcontext(
|
||||
enter_result=BoxedMaybeException()
|
||||
)
|
||||
if pdb:
|
||||
rtctx = open_crash_handler
|
||||
rtctx = open_crash_handler(**kwargs)
|
||||
|
||||
with rtctx():
|
||||
yield
|
||||
with rtctx as boxed_maybe_exc:
|
||||
yield boxed_maybe_exc
|
||||
|
|
|
@ -35,6 +35,7 @@ from signal import (
|
|||
signal,
|
||||
getsignal,
|
||||
SIGUSR1,
|
||||
SIGINT,
|
||||
)
|
||||
# import traceback
|
||||
from types import ModuleType
|
||||
|
@ -48,6 +49,7 @@ from tractor import (
|
|||
_state,
|
||||
log as logmod,
|
||||
)
|
||||
from tractor.devx import _debug
|
||||
|
||||
log = logmod.get_logger(__name__)
|
||||
|
||||
|
@ -76,22 +78,45 @@ def dump_task_tree() -> None:
|
|||
)
|
||||
actor: Actor = _state.current_actor()
|
||||
thr: Thread = current_thread()
|
||||
current_sigint_handler: Callable = getsignal(SIGINT)
|
||||
if (
|
||||
current_sigint_handler
|
||||
is not
|
||||
_debug.DebugStatus._trio_handler
|
||||
):
|
||||
sigint_handler_report: str = (
|
||||
'The default `trio` SIGINT handler was replaced?!'
|
||||
)
|
||||
else:
|
||||
sigint_handler_report: str = (
|
||||
'The default `trio` SIGINT handler is in use?!'
|
||||
)
|
||||
|
||||
# sclang symbology
|
||||
# |_<object>
|
||||
# |_(Task/Thread/Process/Actor
|
||||
# |_{Supervisor/Scope
|
||||
# |_[Storage/Memory/IPC-Stream/Data-Struct
|
||||
|
||||
log.devx(
|
||||
f'Dumping `stackscope` tree for actor\n'
|
||||
f'{actor.uid}:\n'
|
||||
f'|_{mp.current_process()}\n'
|
||||
f' |_{thr}\n'
|
||||
f' |_{actor}\n\n'
|
||||
|
||||
# start-of-trace-tree delimiter (mostly for testing)
|
||||
'------ - ------\n'
|
||||
'\n'
|
||||
+
|
||||
f'{tree_str}\n'
|
||||
+
|
||||
# end-of-trace-tree delimiter (mostly for testing)
|
||||
f'(>: {actor.uid!r}\n'
|
||||
f' |_{mp.current_process()}\n'
|
||||
f' |_{thr}\n'
|
||||
f' |_{actor}\n'
|
||||
f'\n'
|
||||
f'------ {actor.uid!r} ------\n'
|
||||
f'{sigint_handler_report}\n'
|
||||
f'signal.getsignal(SIGINT) -> {current_sigint_handler!r}\n'
|
||||
# f'\n'
|
||||
# start-of-trace-tree delimiter (mostly for testing)
|
||||
# f'------ {actor.uid!r} ------\n'
|
||||
f'\n'
|
||||
f'------ start-of-{actor.uid!r} ------\n'
|
||||
f'|\n'
|
||||
f'{tree_str}'
|
||||
# end-of-trace-tree delimiter (mostly for testing)
|
||||
f'|\n'
|
||||
f'|_____ end-of-{actor.uid!r} ______\n'
|
||||
)
|
||||
# TODO: can remove this right?
|
||||
# -[ ] was original code from author
|
||||
|
@ -123,11 +148,11 @@ def dump_tree_on_sig(
|
|||
) -> None:
|
||||
global _tree_dumped, _handler_lock
|
||||
with _handler_lock:
|
||||
if _tree_dumped:
|
||||
log.warning(
|
||||
'Already dumped for this actor...??'
|
||||
)
|
||||
return
|
||||
# if _tree_dumped:
|
||||
# log.warning(
|
||||
# 'Already dumped for this actor...??'
|
||||
# )
|
||||
# return
|
||||
|
||||
_tree_dumped = True
|
||||
|
||||
|
@ -161,9 +186,9 @@ def dump_tree_on_sig(
|
|||
)
|
||||
raise
|
||||
|
||||
log.devx(
|
||||
'Supposedly we dumped just fine..?'
|
||||
)
|
||||
# log.devx(
|
||||
# 'Supposedly we dumped just fine..?'
|
||||
# )
|
||||
|
||||
if not relay_to_subs:
|
||||
return
|
||||
|
@ -202,11 +227,11 @@ def enable_stack_on_sig(
|
|||
(https://www.gnu.org/software/bash/manual/bash.html#Command-Substitution)
|
||||
you could use:
|
||||
|
||||
>> kill -SIGUSR1 $(pgrep -f '<cmd>')
|
||||
>> kill -SIGUSR1 $(pgrep -f <part-of-cmd: str>)
|
||||
|
||||
Or with with `xonsh` (which has diff capture-from-subproc syntax)
|
||||
OR without a sub-shell,
|
||||
|
||||
>> kill -SIGUSR1 @$(pgrep -f '<cmd>')
|
||||
>> pkill --signal SIGUSR1 -f <part-of-cmd: str>
|
||||
|
||||
'''
|
||||
try:
|
||||
|
|
|
@ -92,7 +92,7 @@ def pformat_boxed_tb(
|
|||
f' ------ {boxer_header} ------\n'
|
||||
f'{tb_body}'
|
||||
f' ------ {boxer_header}- ------\n'
|
||||
f'_|\n'
|
||||
f'_|'
|
||||
)
|
||||
tb_box_indent: str = (
|
||||
tb_box_indent
|
||||
|
|
|
@ -258,20 +258,28 @@ class ActorContextInfo(Mapping):
|
|||
|
||||
|
||||
def get_logger(
|
||||
|
||||
name: str | None = None,
|
||||
name: str|None = None,
|
||||
_root_name: str = _proj_name,
|
||||
|
||||
logger: Logger|None = None,
|
||||
|
||||
# TODO, using `.config.dictConfig()` api?
|
||||
# -[ ] SO answer with docs links
|
||||
# |_https://stackoverflow.com/questions/7507825/where-is-a-complete-example-of-logging-config-dictconfig
|
||||
# |_https://docs.python.org/3/library/logging.config.html#configuration-dictionary-schema
|
||||
subsys_spec: str|None = None,
|
||||
|
||||
) -> StackLevelAdapter:
|
||||
'''Return the package log or a sub-logger for ``name`` if provided.
|
||||
|
||||
'''
|
||||
log: Logger
|
||||
log = rlog = logging.getLogger(_root_name)
|
||||
log = rlog = logger or logging.getLogger(_root_name)
|
||||
|
||||
if (
|
||||
name
|
||||
and name != _proj_name
|
||||
and
|
||||
name != _proj_name
|
||||
):
|
||||
|
||||
# NOTE: for handling for modules that use ``get_logger(__name__)``
|
||||
|
@ -283,7 +291,7 @@ def get_logger(
|
|||
# since in python the {filename} is always this same
|
||||
# module-file.
|
||||
|
||||
sub_name: None | str = None
|
||||
sub_name: None|str = None
|
||||
rname, _, sub_name = name.partition('.')
|
||||
pkgpath, _, modfilename = sub_name.rpartition('.')
|
||||
|
||||
|
@ -306,7 +314,10 @@ def get_logger(
|
|||
|
||||
# add our actor-task aware adapter which will dynamically look up
|
||||
# the actor and task names at each log emit
|
||||
logger = StackLevelAdapter(log, ActorContextInfo())
|
||||
logger = StackLevelAdapter(
|
||||
log,
|
||||
ActorContextInfo(),
|
||||
)
|
||||
|
||||
# additional levels
|
||||
for name, val in CUSTOM_LEVELS.items():
|
||||
|
@ -319,15 +330,25 @@ def get_logger(
|
|||
|
||||
|
||||
def get_console_log(
|
||||
level: str | None = None,
|
||||
level: str|None = None,
|
||||
logger: Logger|None = None,
|
||||
**kwargs,
|
||||
) -> LoggerAdapter:
|
||||
'''Get the package logger and enable a handler which writes to stderr.
|
||||
|
||||
Yeah yeah, i know we can use ``DictConfig``. You do it.
|
||||
) -> LoggerAdapter:
|
||||
'''
|
||||
log = get_logger(**kwargs) # our root logger
|
||||
logger = log.logger
|
||||
Get a `tractor`-style logging instance: a `Logger` wrapped in
|
||||
a `StackLevelAdapter` which injects various concurrency-primitive
|
||||
(process, thread, task) fields and enables a `StreamHandler` that
|
||||
writes on stderr using `colorlog` formatting.
|
||||
|
||||
Yeah yeah, i know we can use `logging.config.dictConfig()`. You do it.
|
||||
|
||||
'''
|
||||
log = get_logger(
|
||||
logger=logger,
|
||||
**kwargs
|
||||
) # set a root logger
|
||||
logger: Logger = log.logger
|
||||
|
||||
if not level:
|
||||
return log
|
||||
|
@ -346,9 +367,13 @@ def get_console_log(
|
|||
None,
|
||||
)
|
||||
):
|
||||
fmt = LOG_FORMAT
|
||||
# if logger:
|
||||
# fmt = None
|
||||
|
||||
handler = StreamHandler()
|
||||
formatter = colorlog.ColoredFormatter(
|
||||
LOG_FORMAT,
|
||||
fmt=fmt,
|
||||
datefmt=DATE_FORMAT,
|
||||
log_colors=STD_PALETTE,
|
||||
secondary_log_colors=BOLD_PALETTE,
|
||||
|
@ -365,7 +390,7 @@ def get_loglevel() -> str:
|
|||
|
||||
|
||||
# global module logger for tractor itself
|
||||
log = get_logger('tractor')
|
||||
log: StackLevelAdapter = get_logger('tractor')
|
||||
|
||||
|
||||
def at_least_level(
|
||||
|
|
|
@ -258,6 +258,9 @@ class PldRx(Struct):
|
|||
f'|_pld={pld!r}\n'
|
||||
)
|
||||
return pld
|
||||
except TypeError as typerr:
|
||||
__tracebackhide__: bool = False
|
||||
raise typerr
|
||||
|
||||
# XXX pld-value type failure
|
||||
except ValidationError as valerr:
|
||||
|
@ -796,8 +799,14 @@ def validate_payload_msg(
|
|||
__tracebackhide__: bool = hide_tb
|
||||
codec: MsgCodec = current_codec()
|
||||
msg_bytes: bytes = codec.encode(pld_msg)
|
||||
roundtripped: Started|None = None
|
||||
try:
|
||||
roundtripped: Started = codec.decode(msg_bytes)
|
||||
except TypeError as typerr:
|
||||
__tracebackhide__: bool = False
|
||||
raise typerr
|
||||
|
||||
try:
|
||||
ctx: Context = getattr(ipc, 'ctx', ipc)
|
||||
pld: PayloadT = ctx.pld_rx.decode_pld(
|
||||
msg=roundtripped,
|
||||
|
@ -822,6 +831,11 @@ def validate_payload_msg(
|
|||
)
|
||||
raise ValidationError(complaint)
|
||||
|
||||
# usually due to `.decode()` input type
|
||||
except TypeError as typerr:
|
||||
__tracebackhide__: bool = False
|
||||
raise typerr
|
||||
|
||||
# raise any msg type error NO MATTER WHAT!
|
||||
except ValidationError as verr:
|
||||
try:
|
||||
|
@ -832,9 +846,13 @@ def validate_payload_msg(
|
|||
verb_header='Trying to send ',
|
||||
is_invalid_payload=True,
|
||||
)
|
||||
except BaseException:
|
||||
except BaseException as _be:
|
||||
if not roundtripped:
|
||||
raise verr
|
||||
|
||||
be = _be
|
||||
__tracebackhide__: bool = False
|
||||
raise
|
||||
raise be
|
||||
|
||||
if not raise_mte:
|
||||
return mte
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -29,3 +29,6 @@ from ._broadcast import (
|
|||
BroadcastReceiver as BroadcastReceiver,
|
||||
Lagged as Lagged,
|
||||
)
|
||||
from ._beg import (
|
||||
collapse_eg as collapse_eg,
|
||||
)
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
# tractor: structured concurrent "actors".
|
||||
# Copyright 2018-eternity Tyler Goodlet.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
'''
|
||||
`BaseExceptionGroup` related utils and helpers pertaining to
|
||||
first-class-`trio` from a historical perspective B)
|
||||
|
||||
'''
|
||||
from contextlib import (
|
||||
asynccontextmanager as acm,
|
||||
)
|
||||
|
||||
|
||||
def maybe_collapse_eg(
|
||||
beg: BaseExceptionGroup,
|
||||
) -> BaseException:
|
||||
'''
|
||||
If the input beg can collapse to a single non-eg sub-exception,
|
||||
return it instead.
|
||||
|
||||
'''
|
||||
if len(excs := beg.exceptions) == 1:
|
||||
return excs[0]
|
||||
|
||||
return beg
|
||||
|
||||
|
||||
@acm
|
||||
async def collapse_eg():
|
||||
'''
|
||||
If `BaseExceptionGroup` raised in the body scope is
|
||||
"collapse-able" (in the same way that
|
||||
`trio.open_nursery(strict_exception_groups=False)` works) then
|
||||
only raise the lone emedded non-eg in in place.
|
||||
|
||||
'''
|
||||
try:
|
||||
yield
|
||||
except* BaseException as beg:
|
||||
if (
|
||||
exc := maybe_collapse_eg(beg)
|
||||
) is not beg:
|
||||
raise exc
|
||||
|
||||
raise beg
|
|
@ -15,7 +15,7 @@
|
|||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
'''
|
||||
``tokio`` style broadcast channel.
|
||||
`tokio` style broadcast channel.
|
||||
https://docs.rs/tokio/1.11.0/tokio/sync/broadcast/index.html
|
||||
|
||||
'''
|
||||
|
|
|
@ -57,6 +57,8 @@ async def maybe_open_nursery(
|
|||
shield: bool = False,
|
||||
lib: ModuleType = trio,
|
||||
|
||||
**kwargs, # proxy thru
|
||||
|
||||
) -> AsyncGenerator[trio.Nursery, Any]:
|
||||
'''
|
||||
Create a new nursery if None provided.
|
||||
|
@ -67,7 +69,7 @@ async def maybe_open_nursery(
|
|||
if nursery is not None:
|
||||
yield nursery
|
||||
else:
|
||||
async with lib.open_nursery() as nursery:
|
||||
async with lib.open_nursery(**kwargs) as nursery:
|
||||
nursery.cancel_scope.shield = shield
|
||||
yield nursery
|
||||
|
||||
|
@ -143,9 +145,14 @@ async def gather_contexts(
|
|||
'Use a non-lazy iterator or sequence type intead!'
|
||||
)
|
||||
|
||||
async with trio.open_nursery() as n:
|
||||
async with trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
# ^XXX^ TODO? soo roll our own then ??
|
||||
# -> since we kinda want the "if only one `.exception` then
|
||||
# just raise that" interface?
|
||||
) as tn:
|
||||
for mngr in mngrs:
|
||||
n.start_soon(
|
||||
tn.start_soon(
|
||||
_enter_and_wait,
|
||||
mngr,
|
||||
unwrapped,
|
||||
|
|
|
@ -0,0 +1,535 @@
|
|||
version = 1
|
||||
revision = 1
|
||||
requires-python = ">=3.11"
|
||||
|
||||
[[package]]
|
||||
name = "async-generator"
|
||||
version = "1.10"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/ce/b6/6fa6b3b598a03cba5e80f829e0dadbb49d7645f523d209b2fb7ea0bbb02a/async_generator-1.10.tar.gz", hash = "sha256:6ebb3d106c12920aaae42ccb6f787ef5eefdcdd166ea3d628fa8476abe712144", size = 29870 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/71/52/39d20e03abd0ac9159c162ec24b93fbcaa111e8400308f2465432495ca2b/async_generator-1.10-py3-none-any.whl", hash = "sha256:01c7bf666359b4967d2cda0000cc2e4af16a0ae098cbffcb8472fb9e8ad6585b", size = 18857 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "attrs"
|
||||
version = "24.3.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/48/c8/6260f8ccc11f0917360fc0da435c5c9c7504e3db174d5a12a1494887b045/attrs-24.3.0.tar.gz", hash = "sha256:8f5c07333d543103541ba7be0e2ce16eeee8130cb0b3f9238ab904ce1e85baff", size = 805984 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/89/aa/ab0f7891a01eeb2d2e338ae8fecbe57fcebea1a24dbb64d45801bfab481d/attrs-24.3.0-py3-none-any.whl", hash = "sha256:ac96cd038792094f438ad1f6ff80837353805ac950cd2aa0e0625ef19850c308", size = 63397 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cffi"
|
||||
version = "1.17.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "pycparser" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/fc/97/c783634659c2920c3fc70419e3af40972dbaf758daa229a7d6ea6135c90d/cffi-1.17.1.tar.gz", hash = "sha256:1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824", size = 516621 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/34/33/e1b8a1ba29025adbdcda5fb3a36f94c03d771c1b7b12f726ff7fef2ebe36/cffi-1.17.1-cp311-cp311-win32.whl", hash = "sha256:85a950a4ac9c359340d5963966e3e0a94a676bd6245a4b55bc43949eee26a655", size = 171727 },
|
||||
{ url = "https://files.pythonhosted.org/packages/3d/97/50228be003bb2802627d28ec0627837ac0bf35c90cf769812056f235b2d1/cffi-1.17.1-cp311-cp311-win_amd64.whl", hash = "sha256:caaf0640ef5f5517f49bc275eca1406b0ffa6aa184892812030f04c2abf589a0", size = 181400 },
|
||||
{ url = "https://files.pythonhosted.org/packages/86/c5/28b2d6f799ec0bdecf44dced2ec5ed43e0eb63097b0f58c293583b406582/cffi-1.17.1-cp312-cp312-win32.whl", hash = "sha256:a08d7e755f8ed21095a310a693525137cfe756ce62d066e53f502a83dc550f65", size = 172448 },
|
||||
{ url = "https://files.pythonhosted.org/packages/50/b9/db34c4755a7bd1cb2d1603ac3863f22bcecbd1ba29e5ee841a4bc510b294/cffi-1.17.1-cp312-cp312-win_amd64.whl", hash = "sha256:51392eae71afec0d0c8fb1a53b204dbb3bcabcb3c9b807eedf3e1e6ccf2de903", size = 181976 },
|
||||
{ url = "https://files.pythonhosted.org/packages/bf/ee/f94057fa6426481d663b88637a9a10e859e492c73d0384514a17d78ee205/cffi-1.17.1-cp313-cp313-win32.whl", hash = "sha256:e03eab0a8677fa80d646b5ddece1cbeaf556c313dcfac435ba11f107ba117b5d", size = 172475 },
|
||||
{ url = "https://files.pythonhosted.org/packages/7c/fc/6a8cb64e5f0324877d503c854da15d76c1e50eb722e320b15345c4d0c6de/cffi-1.17.1-cp313-cp313-win_amd64.whl", hash = "sha256:f6a16c31041f09ead72d69f583767292f750d24913dadacf5756b966aacb3f1a", size = 182009 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "colorama"
|
||||
version = "0.4.6"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "colorlog"
|
||||
version = "6.9.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d3/7a/359f4d5df2353f26172b3cc39ea32daa39af8de522205f512f458923e677/colorlog-6.9.0.tar.gz", hash = "sha256:bfba54a1b93b94f54e1f4fe48395725a3d92fd2a4af702f6bd70946bdc0c6ac2", size = 16624 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/e3/51/9b208e85196941db2f0654ad0357ca6388ab3ed67efdbfc799f35d1f83aa/colorlog-6.9.0-py3-none-any.whl", hash = "sha256:5906e71acd67cb07a71e779c47c4bcb45fb8c2993eebe9e5adcd6a6f1b283eff", size = 11424 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "greenback"
|
||||
version = "1.2.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "greenlet" },
|
||||
{ name = "outcome" },
|
||||
{ name = "sniffio" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/dc/c1/ab3a42c0f3ed56df9cd33de1539b3198d98c6ccbaf88a73d6be0b72d85e0/greenback-1.2.1.tar.gz", hash = "sha256:de3ca656885c03b96dab36079f3de74bb5ba061da9bfe3bb69dccc866ef95ea3", size = 42597 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/71/d0/b8dc79d5ecfffacad9c844b6ae76b9c6259935796d3c561deccbf8fa421d/greenback-1.2.1-py3-none-any.whl", hash = "sha256:98768edbbe4340091a9730cf64a683fcbaa3f2cb81e4ac41d7ed28d3b6f74b79", size = 28062 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "greenlet"
|
||||
version = "3.1.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/2f/ff/df5fede753cc10f6a5be0931204ea30c35fa2f2ea7a35b25bdaf4fe40e46/greenlet-3.1.1.tar.gz", hash = "sha256:4ce3ac6cdb6adf7946475d7ef31777c26d94bccc377e070a7986bd2d5c515467", size = 186022 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/28/62/1c2665558618553c42922ed47a4e6d6527e2fa3516a8256c2f431c5d0441/greenlet-3.1.1-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:e4d333e558953648ca09d64f13e6d8f0523fa705f51cae3f03b5983489958c70", size = 272479 },
|
||||
{ url = "https://files.pythonhosted.org/packages/76/9d/421e2d5f07285b6e4e3a676b016ca781f63cfe4a0cd8eaecf3fd6f7a71ae/greenlet-3.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:09fc016b73c94e98e29af67ab7b9a879c307c6731a2c9da0db5a7d9b7edd1159", size = 640404 },
|
||||
{ url = "https://files.pythonhosted.org/packages/e5/de/6e05f5c59262a584e502dd3d261bbdd2c97ab5416cc9c0b91ea38932a901/greenlet-3.1.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d5e975ca70269d66d17dd995dafc06f1b06e8cb1ec1e9ed54c1d1e4a7c4cf26e", size = 652813 },
|
||||
{ url = "https://files.pythonhosted.org/packages/49/93/d5f93c84241acdea15a8fd329362c2c71c79e1a507c3f142a5d67ea435ae/greenlet-3.1.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3b2813dc3de8c1ee3f924e4d4227999285fd335d1bcc0d2be6dc3f1f6a318ec1", size = 648517 },
|
||||
{ url = "https://files.pythonhosted.org/packages/15/85/72f77fc02d00470c86a5c982b8daafdf65d38aefbbe441cebff3bf7037fc/greenlet-3.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e347b3bfcf985a05e8c0b7d462ba6f15b1ee1c909e2dcad795e49e91b152c383", size = 647831 },
|
||||
{ url = "https://files.pythonhosted.org/packages/f7/4b/1c9695aa24f808e156c8f4813f685d975ca73c000c2a5056c514c64980f6/greenlet-3.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9e8f8c9cb53cdac7ba9793c276acd90168f416b9ce36799b9b885790f8ad6c0a", size = 602413 },
|
||||
{ url = "https://files.pythonhosted.org/packages/76/70/ad6e5b31ef330f03b12559d19fda2606a522d3849cde46b24f223d6d1619/greenlet-3.1.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:62ee94988d6b4722ce0028644418d93a52429e977d742ca2ccbe1c4f4a792511", size = 1129619 },
|
||||
{ url = "https://files.pythonhosted.org/packages/f4/fb/201e1b932e584066e0f0658b538e73c459b34d44b4bd4034f682423bc801/greenlet-3.1.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1776fd7f989fc6b8d8c8cb8da1f6b82c5814957264d1f6cf818d475ec2bf6395", size = 1155198 },
|
||||
{ url = "https://files.pythonhosted.org/packages/12/da/b9ed5e310bb8b89661b80cbcd4db5a067903bbcd7fc854923f5ebb4144f0/greenlet-3.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:48ca08c771c268a768087b408658e216133aecd835c0ded47ce955381105ba39", size = 298930 },
|
||||
{ url = "https://files.pythonhosted.org/packages/7d/ec/bad1ac26764d26aa1353216fcbfa4670050f66d445448aafa227f8b16e80/greenlet-3.1.1-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:4afe7ea89de619adc868e087b4d2359282058479d7cfb94970adf4b55284574d", size = 274260 },
|
||||
{ url = "https://files.pythonhosted.org/packages/66/d4/c8c04958870f482459ab5956c2942c4ec35cac7fe245527f1039837c17a9/greenlet-3.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f406b22b7c9a9b4f8aa9d2ab13d6ae0ac3e85c9a809bd590ad53fed2bf70dc79", size = 649064 },
|
||||
{ url = "https://files.pythonhosted.org/packages/51/41/467b12a8c7c1303d20abcca145db2be4e6cd50a951fa30af48b6ec607581/greenlet-3.1.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c3a701fe5a9695b238503ce5bbe8218e03c3bcccf7e204e455e7462d770268aa", size = 663420 },
|
||||
{ url = "https://files.pythonhosted.org/packages/27/8f/2a93cd9b1e7107d5c7b3b7816eeadcac2ebcaf6d6513df9abaf0334777f6/greenlet-3.1.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2846930c65b47d70b9d178e89c7e1a69c95c1f68ea5aa0a58646b7a96df12441", size = 658035 },
|
||||
{ url = "https://files.pythonhosted.org/packages/57/5c/7c6f50cb12be092e1dccb2599be5a942c3416dbcfb76efcf54b3f8be4d8d/greenlet-3.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:99cfaa2110534e2cf3ba31a7abcac9d328d1d9f1b95beede58294a60348fba36", size = 660105 },
|
||||
{ url = "https://files.pythonhosted.org/packages/f1/66/033e58a50fd9ec9df00a8671c74f1f3a320564c6415a4ed82a1c651654ba/greenlet-3.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1443279c19fca463fc33e65ef2a935a5b09bb90f978beab37729e1c3c6c25fe9", size = 613077 },
|
||||
{ url = "https://files.pythonhosted.org/packages/19/c5/36384a06f748044d06bdd8776e231fadf92fc896bd12cb1c9f5a1bda9578/greenlet-3.1.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b7cede291382a78f7bb5f04a529cb18e068dd29e0fb27376074b6d0317bf4dd0", size = 1135975 },
|
||||
{ url = "https://files.pythonhosted.org/packages/38/f9/c0a0eb61bdf808d23266ecf1d63309f0e1471f284300ce6dac0ae1231881/greenlet-3.1.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:23f20bb60ae298d7d8656c6ec6db134bca379ecefadb0b19ce6f19d1f232a942", size = 1163955 },
|
||||
{ url = "https://files.pythonhosted.org/packages/43/21/a5d9df1d21514883333fc86584c07c2b49ba7c602e670b174bd73cfc9c7f/greenlet-3.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:7124e16b4c55d417577c2077be379514321916d5790fa287c9ed6f23bd2ffd01", size = 299655 },
|
||||
{ url = "https://files.pythonhosted.org/packages/f3/57/0db4940cd7bb461365ca8d6fd53e68254c9dbbcc2b452e69d0d41f10a85e/greenlet-3.1.1-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:05175c27cb459dcfc05d026c4232f9de8913ed006d42713cb8a5137bd49375f1", size = 272990 },
|
||||
{ url = "https://files.pythonhosted.org/packages/1c/ec/423d113c9f74e5e402e175b157203e9102feeb7088cee844d735b28ef963/greenlet-3.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:935e943ec47c4afab8965954bf49bfa639c05d4ccf9ef6e924188f762145c0ff", size = 649175 },
|
||||
{ url = "https://files.pythonhosted.org/packages/a9/46/ddbd2db9ff209186b7b7c621d1432e2f21714adc988703dbdd0e65155c77/greenlet-3.1.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:667a9706c970cb552ede35aee17339a18e8f2a87a51fba2ed39ceeeb1004798a", size = 663425 },
|
||||
{ url = "https://files.pythonhosted.org/packages/bc/f9/9c82d6b2b04aa37e38e74f0c429aece5eeb02bab6e3b98e7db89b23d94c6/greenlet-3.1.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b8a678974d1f3aa55f6cc34dc480169d58f2e6d8958895d68845fa4ab566509e", size = 657736 },
|
||||
{ url = "https://files.pythonhosted.org/packages/d9/42/b87bc2a81e3a62c3de2b0d550bf91a86939442b7ff85abb94eec3fc0e6aa/greenlet-3.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:efc0f674aa41b92da8c49e0346318c6075d734994c3c4e4430b1c3f853e498e4", size = 660347 },
|
||||
{ url = "https://files.pythonhosted.org/packages/37/fa/71599c3fd06336cdc3eac52e6871cfebab4d9d70674a9a9e7a482c318e99/greenlet-3.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0153404a4bb921f0ff1abeb5ce8a5131da56b953eda6e14b88dc6bbc04d2049e", size = 615583 },
|
||||
{ url = "https://files.pythonhosted.org/packages/4e/96/e9ef85de031703ee7a4483489b40cf307f93c1824a02e903106f2ea315fe/greenlet-3.1.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:275f72decf9932639c1c6dd1013a1bc266438eb32710016a1c742df5da6e60a1", size = 1133039 },
|
||||
{ url = "https://files.pythonhosted.org/packages/87/76/b2b6362accd69f2d1889db61a18c94bc743e961e3cab344c2effaa4b4a25/greenlet-3.1.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:c4aab7f6381f38a4b42f269057aee279ab0fc7bf2e929e3d4abfae97b682a12c", size = 1160716 },
|
||||
{ url = "https://files.pythonhosted.org/packages/1f/1b/54336d876186920e185066d8c3024ad55f21d7cc3683c856127ddb7b13ce/greenlet-3.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:b42703b1cf69f2aa1df7d1030b9d77d3e584a70755674d60e710f0af570f3761", size = 299490 },
|
||||
{ url = "https://files.pythonhosted.org/packages/5f/17/bea55bf36990e1638a2af5ba10c1640273ef20f627962cf97107f1e5d637/greenlet-3.1.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f1695e76146579f8c06c1509c7ce4dfe0706f49c6831a817ac04eebb2fd02011", size = 643731 },
|
||||
{ url = "https://files.pythonhosted.org/packages/78/d2/aa3d2157f9ab742a08e0fd8f77d4699f37c22adfbfeb0c610a186b5f75e0/greenlet-3.1.1-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7876452af029456b3f3549b696bb36a06db7c90747740c5302f74a9e9fa14b13", size = 649304 },
|
||||
{ url = "https://files.pythonhosted.org/packages/f1/8e/d0aeffe69e53ccff5a28fa86f07ad1d2d2d6537a9506229431a2a02e2f15/greenlet-3.1.1-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4ead44c85f8ab905852d3de8d86f6f8baf77109f9da589cb4fa142bd3b57b475", size = 646537 },
|
||||
{ url = "https://files.pythonhosted.org/packages/05/79/e15408220bbb989469c8871062c97c6c9136770657ba779711b90870d867/greenlet-3.1.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8320f64b777d00dd7ccdade271eaf0cad6636343293a25074cc5566160e4de7b", size = 642506 },
|
||||
{ url = "https://files.pythonhosted.org/packages/18/87/470e01a940307796f1d25f8167b551a968540fbe0551c0ebb853cb527dd6/greenlet-3.1.1-cp313-cp313t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6510bf84a6b643dabba74d3049ead221257603a253d0a9873f55f6a59a65f822", size = 602753 },
|
||||
{ url = "https://files.pythonhosted.org/packages/e2/72/576815ba674eddc3c25028238f74d7b8068902b3968cbe456771b166455e/greenlet-3.1.1-cp313-cp313t-musllinux_1_1_aarch64.whl", hash = "sha256:04b013dc07c96f83134b1e99888e7a79979f1a247e2a9f59697fa14b5862ed01", size = 1122731 },
|
||||
{ url = "https://files.pythonhosted.org/packages/ac/38/08cc303ddddc4b3d7c628c3039a61a3aae36c241ed01393d00c2fd663473/greenlet-3.1.1-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:411f015496fec93c1c8cd4e5238da364e1da7a124bcb293f085bf2860c32c6f6", size = 1142112 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "3.10"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/f1/70/7703c29685631f5a7590aa73f1f1d3fa9a380e654b86af429e0934a32f7d/idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", size = 190490 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3", size = 70442 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "importlib-metadata"
|
||||
version = "8.6.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "zipp" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/33/08/c1395a292bb23fd03bdf572a1357c5a733d3eecbab877641ceacab23db6e/importlib_metadata-8.6.1.tar.gz", hash = "sha256:310b41d755445d74569f993ccfc22838295d9fe005425094fad953d7f15c8580", size = 55767 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/79/9d/0fb148dc4d6fa4a7dd1d8378168d9b4cd8d4560a6fbf6f0121c5fc34eb68/importlib_metadata-8.6.1-py3-none-any.whl", hash = "sha256:02a89390c1e15fdfdc0d7c6b25cb3e62650d0494005c97d6f148bf5b9787525e", size = 26971 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iniconfig"
|
||||
version = "2.0.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "msgspec"
|
||||
version = "0.19.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/cf/9b/95d8ce458462b8b71b8a70fa94563b2498b89933689f3a7b8911edfae3d7/msgspec-0.19.0.tar.gz", hash = "sha256:604037e7cd475345848116e89c553aa9a233259733ab51986ac924ab1b976f8e", size = 216934 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/24/d4/2ec2567ac30dab072cce3e91fb17803c52f0a37aab6b0c24375d2b20a581/msgspec-0.19.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:aa77046904db764b0462036bc63ef71f02b75b8f72e9c9dd4c447d6da1ed8f8e", size = 187939 },
|
||||
{ url = "https://files.pythonhosted.org/packages/2b/c0/18226e4328897f4f19875cb62bb9259fe47e901eade9d9376ab5f251a929/msgspec-0.19.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:047cfa8675eb3bad68722cfe95c60e7afabf84d1bd8938979dd2b92e9e4a9551", size = 182202 },
|
||||
{ url = "https://files.pythonhosted.org/packages/81/25/3a4b24d468203d8af90d1d351b77ea3cffb96b29492855cf83078f16bfe4/msgspec-0.19.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e78f46ff39a427e10b4a61614a2777ad69559cc8d603a7c05681f5a595ea98f7", size = 209029 },
|
||||
{ url = "https://files.pythonhosted.org/packages/85/2e/db7e189b57901955239f7689b5dcd6ae9458637a9c66747326726c650523/msgspec-0.19.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c7adf191e4bd3be0e9231c3b6dc20cf1199ada2af523885efc2ed218eafd011", size = 210682 },
|
||||
{ url = "https://files.pythonhosted.org/packages/03/97/7c8895c9074a97052d7e4a1cc1230b7b6e2ca2486714eb12c3f08bb9d284/msgspec-0.19.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:f04cad4385e20be7c7176bb8ae3dca54a08e9756cfc97bcdb4f18560c3042063", size = 214003 },
|
||||
{ url = "https://files.pythonhosted.org/packages/61/61/e892997bcaa289559b4d5869f066a8021b79f4bf8e955f831b095f47a4cd/msgspec-0.19.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:45c8fb410670b3b7eb884d44a75589377c341ec1392b778311acdbfa55187716", size = 216833 },
|
||||
{ url = "https://files.pythonhosted.org/packages/ce/3d/71b2dffd3a1c743ffe13296ff701ee503feaebc3f04d0e75613b6563c374/msgspec-0.19.0-cp311-cp311-win_amd64.whl", hash = "sha256:70eaef4934b87193a27d802534dc466778ad8d536e296ae2f9334e182ac27b6c", size = 186184 },
|
||||
{ url = "https://files.pythonhosted.org/packages/b2/5f/a70c24f075e3e7af2fae5414c7048b0e11389685b7f717bb55ba282a34a7/msgspec-0.19.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:f98bd8962ad549c27d63845b50af3f53ec468b6318400c9f1adfe8b092d7b62f", size = 190485 },
|
||||
{ url = "https://files.pythonhosted.org/packages/89/b0/1b9763938cfae12acf14b682fcf05c92855974d921a5a985ecc197d1c672/msgspec-0.19.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:43bbb237feab761b815ed9df43b266114203f53596f9b6e6f00ebd79d178cdf2", size = 183910 },
|
||||
{ url = "https://files.pythonhosted.org/packages/87/81/0c8c93f0b92c97e326b279795f9c5b956c5a97af28ca0fbb9fd86c83737a/msgspec-0.19.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4cfc033c02c3e0aec52b71710d7f84cb3ca5eb407ab2ad23d75631153fdb1f12", size = 210633 },
|
||||
{ url = "https://files.pythonhosted.org/packages/d0/ef/c5422ce8af73928d194a6606f8ae36e93a52fd5e8df5abd366903a5ca8da/msgspec-0.19.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d911c442571605e17658ca2b416fd8579c5050ac9adc5e00c2cb3126c97f73bc", size = 213594 },
|
||||
{ url = "https://files.pythonhosted.org/packages/19/2b/4137bc2ed45660444842d042be2cf5b18aa06efd2cda107cff18253b9653/msgspec-0.19.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:757b501fa57e24896cf40a831442b19a864f56d253679f34f260dcb002524a6c", size = 214053 },
|
||||
{ url = "https://files.pythonhosted.org/packages/9d/e6/8ad51bdc806aac1dc501e8fe43f759f9ed7284043d722b53323ea421c360/msgspec-0.19.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:5f0f65f29b45e2816d8bded36e6b837a4bf5fb60ec4bc3c625fa2c6da4124537", size = 219081 },
|
||||
{ url = "https://files.pythonhosted.org/packages/b1/ef/27dd35a7049c9a4f4211c6cd6a8c9db0a50647546f003a5867827ec45391/msgspec-0.19.0-cp312-cp312-win_amd64.whl", hash = "sha256:067f0de1c33cfa0b6a8206562efdf6be5985b988b53dd244a8e06f993f27c8c0", size = 187467 },
|
||||
{ url = "https://files.pythonhosted.org/packages/3c/cb/2842c312bbe618d8fefc8b9cedce37f773cdc8fa453306546dba2c21fd98/msgspec-0.19.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f12d30dd6266557aaaf0aa0f9580a9a8fbeadfa83699c487713e355ec5f0bd86", size = 190498 },
|
||||
{ url = "https://files.pythonhosted.org/packages/58/95/c40b01b93465e1a5f3b6c7d91b10fb574818163740cc3acbe722d1e0e7e4/msgspec-0.19.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82b2c42c1b9ebc89e822e7e13bbe9d17ede0c23c187469fdd9505afd5a481314", size = 183950 },
|
||||
{ url = "https://files.pythonhosted.org/packages/e8/f0/5b764e066ce9aba4b70d1db8b087ea66098c7c27d59b9dd8a3532774d48f/msgspec-0.19.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:19746b50be214a54239aab822964f2ac81e38b0055cca94808359d779338c10e", size = 210647 },
|
||||
{ url = "https://files.pythonhosted.org/packages/9d/87/bc14f49bc95c4cb0dd0a8c56028a67c014ee7e6818ccdce74a4862af259b/msgspec-0.19.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:60ef4bdb0ec8e4ad62e5a1f95230c08efb1f64f32e6e8dd2ced685bcc73858b5", size = 213563 },
|
||||
{ url = "https://files.pythonhosted.org/packages/53/2f/2b1c2b056894fbaa975f68f81e3014bb447516a8b010f1bed3fb0e016ed7/msgspec-0.19.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac7f7c377c122b649f7545810c6cd1b47586e3aa3059126ce3516ac7ccc6a6a9", size = 213996 },
|
||||
{ url = "https://files.pythonhosted.org/packages/aa/5a/4cd408d90d1417e8d2ce6a22b98a6853c1b4d7cb7669153e4424d60087f6/msgspec-0.19.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a5bc1472223a643f5ffb5bf46ccdede7f9795078194f14edd69e3aab7020d327", size = 219087 },
|
||||
{ url = "https://files.pythonhosted.org/packages/23/d8/f15b40611c2d5753d1abb0ca0da0c75348daf1252220e5dda2867bd81062/msgspec-0.19.0-cp313-cp313-win_amd64.whl", hash = "sha256:317050bc0f7739cb30d257ff09152ca309bf5a369854bbf1e57dffc310c1f20f", size = 187432 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mypy-extensions"
|
||||
version = "1.0.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/98/a4/1ab47638b92648243faf97a5aeb6ea83059cc3624972ab6b8d2316078d3f/mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782", size = 4433 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/2a/e2/5d3f6ada4297caebe1a2add3b126fe800c96f56dbe5d1988a2cbe0b267aa/mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d", size = 4695 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "outcome"
|
||||
version = "1.3.0.post0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "attrs" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/98/df/77698abfac98571e65ffeb0c1fba8ffd692ab8458d617a0eed7d9a8d38f2/outcome-1.3.0.post0.tar.gz", hash = "sha256:9dcf02e65f2971b80047b377468e72a268e15c0af3cf1238e6ff14f7f91143b8", size = 21060 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/55/8b/5ab7257531a5d830fc8000c476e63c935488d74609b50f9384a643ec0a62/outcome-1.3.0.post0-py2.py3-none-any.whl", hash = "sha256:e771c5ce06d1415e356078d3bdd68523f284b4ce5419828922b6871e65eda82b", size = 10692 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "packaging"
|
||||
version = "24.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pdbp"
|
||||
version = "1.6.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||
{ name = "pygments" },
|
||||
{ name = "tabcompleter" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/69/13/80da03638f62facbee76312ca9ee5941c017b080f2e4c6919fd4e87e16e3/pdbp-1.6.1.tar.gz", hash = "sha256:f4041642952a05df89664e166d5bd379607a0866ddd753c06874f65552bdf40b", size = 25322 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/29/93/d56fb9ba5569dc29d8263c72e46d21a2fd38741339ebf03f54cf7561828c/pdbp-1.6.1-py3-none-any.whl", hash = "sha256:f10bad2ee044c0e5c168cb0825abfdbdc01c50013e9755df5261b060bdd35c22", size = 21495 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pexpect"
|
||||
version = "4.9.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "ptyprocess" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/42/92/cc564bf6381ff43ce1f4d06852fc19a2f11d180f23dc32d9588bee2f149d/pexpect-4.9.0.tar.gz", hash = "sha256:ee7d41123f3c9911050ea2c2dac107568dc43b2d3b0c7557a33212c398ead30f", size = 166450 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/9e/c3/059298687310d527a58bb01f3b1965787ee3b40dce76752eda8b44e9a2c5/pexpect-4.9.0-py2.py3-none-any.whl", hash = "sha256:7236d1e080e4936be2dc3e326cec0af72acf9212a7e1d060210e70a47e253523", size = 63772 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pluggy"
|
||||
version = "1.5.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prompt-toolkit"
|
||||
version = "3.0.50"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "wcwidth" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/a1/e1/bd15cb8ffdcfeeb2bdc215de3c3cffca11408d829e4b8416dcfe71ba8854/prompt_toolkit-3.0.50.tar.gz", hash = "sha256:544748f3860a2623ca5cd6d2795e7a14f3d0e1c3c9728359013f79877fc89bab", size = 429087 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/e4/ea/d836f008d33151c7a1f62caf3d8dd782e4d15f6a43897f64480c2b8de2ad/prompt_toolkit-3.0.50-py3-none-any.whl", hash = "sha256:9b6427eb19e479d98acff65196a307c555eb567989e6d88ebbb1b509d9779198", size = 387816 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ptyprocess"
|
||||
version = "0.7.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/20/e5/16ff212c1e452235a90aeb09066144d0c5a6a8c0834397e03f5224495c4e/ptyprocess-0.7.0.tar.gz", hash = "sha256:5c5d0a3b48ceee0b48485e0c26037c0acd7d29765ca3fbb5cb3831d347423220", size = 70762 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/22/a6/858897256d0deac81a172289110f31629fc4cee19b6f01283303e18c8db3/ptyprocess-0.7.0-py2.py3-none-any.whl", hash = "sha256:4b41f3967fce3af57cc7e94b888626c18bf37a083e3651ca8feeb66d492fef35", size = 13993 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pycparser"
|
||||
version = "2.22"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/1d/b2/31537cf4b1ca988837256c910a668b553fceb8f069bedc4b1c826024b52c/pycparser-2.22.tar.gz", hash = "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6", size = 172736 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/13/a3/a812df4e2dd5696d1f351d58b8fe16a405b234ad2886a0dab9183fb78109/pycparser-2.22-py3-none-any.whl", hash = "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc", size = 117552 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pygments"
|
||||
version = "2.19.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/7c/2d/c3338d48ea6cc0feb8446d8e6937e1408088a72a39937982cc6111d17f84/pygments-2.19.1.tar.gz", hash = "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f", size = 4968581 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/8a/0b/9fcc47d19c48b59121088dd6da2488a49d5f72dacf8262e2790a1d2c7d15/pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c", size = 1225293 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pyperclip"
|
||||
version = "1.9.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/30/23/2f0a3efc4d6a32f3b63cdff36cd398d9701d26cda58e3ab97ac79fb5e60d/pyperclip-1.9.0.tar.gz", hash = "sha256:b7de0142ddc81bfc5c7507eea19da920b92252b548b96186caf94a5e2527d310", size = 20961 }
|
||||
|
||||
[[package]]
|
||||
name = "pyreadline3"
|
||||
version = "3.5.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/0f/49/4cea918a08f02817aabae639e3d0ac046fef9f9180518a3ad394e22da148/pyreadline3-3.5.4.tar.gz", hash = "sha256:8d57d53039a1c75adba8e50dd3d992b28143480816187ea5efbd5c78e6c885b7", size = 99839 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/5a/dc/491b7661614ab97483abf2056be1deee4dc2490ecbf7bff9ab5cdbac86e1/pyreadline3-3.5.4-py3-none-any.whl", hash = "sha256:eaf8e6cc3c49bcccf145fc6067ba8643d1df34d604a1ec0eccbf7a18e6d3fae6", size = 83178 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pytest"
|
||||
version = "8.3.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||
{ name = "iniconfig" },
|
||||
{ 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 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sniffio"
|
||||
version = "1.3.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/a2/87/a6771e1546d97e7e041b6ae58d80074f81b7d5121207425c964ddf5cfdbd/sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc", size = 20372 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sortedcontainers"
|
||||
version = "2.4.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/e8/c4/ba2f8066cceb6f23394729afe52f3bf7adec04bf9ed2c820b39e19299111/sortedcontainers-2.4.0.tar.gz", hash = "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88", size = 30594 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/32/46/9cb0e58b2deb7f82b84065f37f3bffeb12413f947f9388e4cac22c4621ce/sortedcontainers-2.4.0-py2.py3-none-any.whl", hash = "sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0", size = 29575 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "stackscope"
|
||||
version = "0.2.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/4a/fc/20dbb993353f31230138f3c63f3f0c881d1853e70d7a30cd68d2ba4cf1e2/stackscope-0.2.2.tar.gz", hash = "sha256:f508c93eb4861ada466dd3ff613ca203962ceb7587ad013759f15394e6a4e619", size = 90479 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/f1/5f/0a674fcafa03528089badb46419413f342537b5b57d2fefc9900fb8ee4e4/stackscope-0.2.2-py3-none-any.whl", hash = "sha256:c199b0cda738d39c993ee04eb01961b06b7e9aeb43ebf9fd6226cdd72ea9faf6", size = 80807 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tabcompleter"
|
||||
version = "1.4.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "pyreadline3", marker = "sys_platform == 'win32'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/73/1a/ed3544579628c5709bae6fae2255e94c6982a9ff77d42d8ba59fd2f3b21a/tabcompleter-1.4.0.tar.gz", hash = "sha256:7562a9938e62f8e7c3be612c3ac4e14c5ec4307b58ba9031c148260e866e8814", size = 10431 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/65/44/bb509c3d2c0b5a87e7a5af1d5917a402a32ff026f777a6d7cb6990746cbb/tabcompleter-1.4.0-py3-none-any.whl", hash = "sha256:d744aa735b49c0a6cc2fb8fcd40077fec47425e4388301010b14e6ce3311368b", size = 6725 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tractor"
|
||||
version = "0.1.0a6.dev0"
|
||||
source = { editable = "." }
|
||||
dependencies = [
|
||||
{ name = "colorlog" },
|
||||
{ name = "msgspec" },
|
||||
{ name = "pdbp" },
|
||||
{ name = "tabcompleter" },
|
||||
{ name = "tricycle" },
|
||||
{ name = "trio" },
|
||||
{ name = "trio-typing" },
|
||||
{ name = "wrapt" },
|
||||
]
|
||||
|
||||
[package.dev-dependencies]
|
||||
dev = [
|
||||
{ name = "greenback" },
|
||||
{ name = "pexpect" },
|
||||
{ name = "prompt-toolkit" },
|
||||
{ name = "pyperclip" },
|
||||
{ name = "pytest" },
|
||||
{ name = "stackscope" },
|
||||
{ name = "xonsh" },
|
||||
]
|
||||
|
||||
[package.metadata]
|
||||
requires-dist = [
|
||||
{ name = "colorlog", specifier = ">=6.8.2,<7" },
|
||||
{ name = "msgspec", specifier = ">=0.19.0" },
|
||||
{ name = "pdbp", specifier = ">=1.6,<2" },
|
||||
{ name = "tabcompleter", specifier = ">=1.4.0" },
|
||||
{ name = "tricycle", specifier = ">=0.4.1,<0.5" },
|
||||
{ name = "trio", specifier = ">0.27" },
|
||||
{ name = "trio-typing", specifier = ">=0.10.0,<0.11" },
|
||||
{ name = "wrapt", specifier = ">=1.16.0,<2" },
|
||||
]
|
||||
|
||||
[package.metadata.requires-dev]
|
||||
dev = [
|
||||
{ name = "greenback", specifier = ">=1.2.1,<2" },
|
||||
{ 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 = "stackscope", specifier = ">=0.2.2,<0.3" },
|
||||
{ name = "xonsh", specifier = ">=0.19.2" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tricycle"
|
||||
version = "0.4.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "trio" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/f8/8e/fdd7bc467b40eedd0a5f2ed36b0d692c6e6f2473be00c8160e2e9f53adc1/tricycle-0.4.1.tar.gz", hash = "sha256:f56edb4b3e1bed3e2552b1b499b24a2dab47741e92e9b4d806acc5c35c9e6066", size = 41551 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d7/c6/7cc05d60e21c683df99167db071ce5d848f5063c2a63971a8443466f603e/tricycle-0.4.1-py3-none-any.whl", hash = "sha256:67900995a73e7445e2c70250cdca04a778d9c3923dd960a97ad4569085e0fb3f", size = 35316 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "trio"
|
||||
version = "0.29.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "attrs" },
|
||||
{ name = "cffi", marker = "implementation_name != 'pypy' and os_name == 'nt'" },
|
||||
{ name = "idna" },
|
||||
{ name = "outcome" },
|
||||
{ name = "sniffio" },
|
||||
{ name = "sortedcontainers" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/a1/47/f62e62a1a6f37909aed0bf8f5d5411e06fa03846cfcb64540cd1180ccc9f/trio-0.29.0.tar.gz", hash = "sha256:ea0d3967159fc130acb6939a0be0e558e364fee26b5deeecc893a6b08c361bdf", size = 588952 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/c9/55/c4d9bea8b3d7937901958f65124123512419ab0eb73695e5f382521abbfb/trio-0.29.0-py3-none-any.whl", hash = "sha256:d8c463f1a9cc776ff63e331aba44c125f423a5a13c684307e828d930e625ba66", size = 492920 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "trio-typing"
|
||||
version = "0.10.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "async-generator" },
|
||||
{ name = "importlib-metadata" },
|
||||
{ name = "mypy-extensions" },
|
||||
{ name = "packaging" },
|
||||
{ name = "trio" },
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b5/74/a87aafa40ec3a37089148b859892cbe2eef08d132c816d58a60459be5337/trio-typing-0.10.0.tar.gz", hash = "sha256:065ee684296d52a8ab0e2374666301aec36ee5747ac0e7a61f230250f8907ac3", size = 38747 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/89/ff/9bd795273eb14fac7f6a59d16cc8c4d0948a619a1193d375437c7f50f3eb/trio_typing-0.10.0-py3-none-any.whl", hash = "sha256:6d0e7ec9d837a2fe03591031a172533fbf4a1a95baf369edebfc51d5a49f0264", size = 42224 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typing-extensions"
|
||||
version = "4.12.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/df/db/f35a00659bc03fec321ba8bce9420de607a1d37f8342eee1863174c69557/typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8", size = 85321 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/26/9f/ad63fc0248c5379346306f8668cda6e2e2e9c95e01216d2b8ffd9ff037d0/typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d", size = 37438 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wcwidth"
|
||||
version = "0.2.13"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/6c/63/53559446a878410fc5a5974feb13d31d78d752eb18aeba59c7fef1af7598/wcwidth-0.2.13.tar.gz", hash = "sha256:72ea0c06399eb286d978fdedb6923a9eb47e1c486ce63e9b4e64fc18303972b5", size = 101301 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/fd/84/fd2ba7aafacbad3c4201d395674fc6348826569da3c0937e75505ead3528/wcwidth-0.2.13-py2.py3-none-any.whl", hash = "sha256:3da69048e4540d84af32131829ff948f1e022c1c6bdb8d6102117aac784f6859", size = 34166 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wrapt"
|
||||
version = "1.17.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/c3/fc/e91cc220803d7bc4db93fb02facd8461c37364151b8494762cc88b0fbcef/wrapt-1.17.2.tar.gz", hash = "sha256:41388e9d4d1522446fe79d3213196bd9e3b301a336965b9e27ca2788ebd122f3", size = 55531 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/cd/f7/a2aab2cbc7a665efab072344a8949a71081eed1d2f451f7f7d2b966594a2/wrapt-1.17.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ff04ef6eec3eee8a5efef2401495967a916feaa353643defcc03fc74fe213b58", size = 53308 },
|
||||
{ url = "https://files.pythonhosted.org/packages/50/ff/149aba8365fdacef52b31a258c4dc1c57c79759c335eff0b3316a2664a64/wrapt-1.17.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4db983e7bca53819efdbd64590ee96c9213894272c776966ca6306b73e4affda", size = 38488 },
|
||||
{ url = "https://files.pythonhosted.org/packages/65/46/5a917ce85b5c3b490d35c02bf71aedaa9f2f63f2d15d9949cc4ba56e8ba9/wrapt-1.17.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:9abc77a4ce4c6f2a3168ff34b1da9b0f311a8f1cfd694ec96b0603dff1c79438", size = 38776 },
|
||||
{ url = "https://files.pythonhosted.org/packages/ca/74/336c918d2915a4943501c77566db41d1bd6e9f4dbc317f356b9a244dfe83/wrapt-1.17.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b929ac182f5ace000d459c59c2c9c33047e20e935f8e39371fa6e3b85d56f4a", size = 83776 },
|
||||
{ url = "https://files.pythonhosted.org/packages/09/99/c0c844a5ccde0fe5761d4305485297f91d67cf2a1a824c5f282e661ec7ff/wrapt-1.17.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f09b286faeff3c750a879d336fb6d8713206fc97af3adc14def0cdd349df6000", size = 75420 },
|
||||
{ url = "https://files.pythonhosted.org/packages/b4/b0/9fc566b0fe08b282c850063591a756057c3247b2362b9286429ec5bf1721/wrapt-1.17.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1a7ed2d9d039bd41e889f6fb9364554052ca21ce823580f6a07c4ec245c1f5d6", size = 83199 },
|
||||
{ url = "https://files.pythonhosted.org/packages/9d/4b/71996e62d543b0a0bd95dda485219856def3347e3e9380cc0d6cf10cfb2f/wrapt-1.17.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:129a150f5c445165ff941fc02ee27df65940fcb8a22a61828b1853c98763a64b", size = 82307 },
|
||||
{ url = "https://files.pythonhosted.org/packages/39/35/0282c0d8789c0dc9bcc738911776c762a701f95cfe113fb8f0b40e45c2b9/wrapt-1.17.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:1fb5699e4464afe5c7e65fa51d4f99e0b2eadcc176e4aa33600a3df7801d6662", size = 75025 },
|
||||
{ url = "https://files.pythonhosted.org/packages/4f/6d/90c9fd2c3c6fee181feecb620d95105370198b6b98a0770cba090441a828/wrapt-1.17.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9a2bce789a5ea90e51a02dfcc39e31b7f1e662bc3317979aa7e5538e3a034f72", size = 81879 },
|
||||
{ url = "https://files.pythonhosted.org/packages/8f/fa/9fb6e594f2ce03ef03eddbdb5f4f90acb1452221a5351116c7c4708ac865/wrapt-1.17.2-cp311-cp311-win32.whl", hash = "sha256:4afd5814270fdf6380616b321fd31435a462019d834f83c8611a0ce7484c7317", size = 36419 },
|
||||
{ url = "https://files.pythonhosted.org/packages/47/f8/fb1773491a253cbc123c5d5dc15c86041f746ed30416535f2a8df1f4a392/wrapt-1.17.2-cp311-cp311-win_amd64.whl", hash = "sha256:acc130bc0375999da18e3d19e5a86403667ac0c4042a094fefb7eec8ebac7cf3", size = 38773 },
|
||||
{ url = "https://files.pythonhosted.org/packages/a1/bd/ab55f849fd1f9a58ed7ea47f5559ff09741b25f00c191231f9f059c83949/wrapt-1.17.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:d5e2439eecc762cd85e7bd37161d4714aa03a33c5ba884e26c81559817ca0925", size = 53799 },
|
||||
{ url = "https://files.pythonhosted.org/packages/53/18/75ddc64c3f63988f5a1d7e10fb204ffe5762bc663f8023f18ecaf31a332e/wrapt-1.17.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3fc7cb4c1c744f8c05cd5f9438a3caa6ab94ce8344e952d7c45a8ed59dd88392", size = 38821 },
|
||||
{ url = "https://files.pythonhosted.org/packages/48/2a/97928387d6ed1c1ebbfd4efc4133a0633546bec8481a2dd5ec961313a1c7/wrapt-1.17.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8fdbdb757d5390f7c675e558fd3186d590973244fab0c5fe63d373ade3e99d40", size = 38919 },
|
||||
{ url = "https://files.pythonhosted.org/packages/73/54/3bfe5a1febbbccb7a2f77de47b989c0b85ed3a6a41614b104204a788c20e/wrapt-1.17.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5bb1d0dbf99411f3d871deb6faa9aabb9d4e744d67dcaaa05399af89d847a91d", size = 88721 },
|
||||
{ url = "https://files.pythonhosted.org/packages/25/cb/7262bc1b0300b4b64af50c2720ef958c2c1917525238d661c3e9a2b71b7b/wrapt-1.17.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d18a4865f46b8579d44e4fe1e2bcbc6472ad83d98e22a26c963d46e4c125ef0b", size = 80899 },
|
||||
{ url = "https://files.pythonhosted.org/packages/2a/5a/04cde32b07a7431d4ed0553a76fdb7a61270e78c5fd5a603e190ac389f14/wrapt-1.17.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc570b5f14a79734437cb7b0500376b6b791153314986074486e0b0fa8d71d98", size = 89222 },
|
||||
{ url = "https://files.pythonhosted.org/packages/09/28/2e45a4f4771fcfb109e244d5dbe54259e970362a311b67a965555ba65026/wrapt-1.17.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6d9187b01bebc3875bac9b087948a2bccefe464a7d8f627cf6e48b1bbae30f82", size = 86707 },
|
||||
{ url = "https://files.pythonhosted.org/packages/c6/d2/dcb56bf5f32fcd4bd9aacc77b50a539abdd5b6536872413fd3f428b21bed/wrapt-1.17.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:9e8659775f1adf02eb1e6f109751268e493c73716ca5761f8acb695e52a756ae", size = 79685 },
|
||||
{ url = "https://files.pythonhosted.org/packages/80/4e/eb8b353e36711347893f502ce91c770b0b0929f8f0bed2670a6856e667a9/wrapt-1.17.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e8b2816ebef96d83657b56306152a93909a83f23994f4b30ad4573b00bd11bb9", size = 87567 },
|
||||
{ url = "https://files.pythonhosted.org/packages/17/27/4fe749a54e7fae6e7146f1c7d914d28ef599dacd4416566c055564080fe2/wrapt-1.17.2-cp312-cp312-win32.whl", hash = "sha256:468090021f391fe0056ad3e807e3d9034e0fd01adcd3bdfba977b6fdf4213ea9", size = 36672 },
|
||||
{ url = "https://files.pythonhosted.org/packages/15/06/1dbf478ea45c03e78a6a8c4be4fdc3c3bddea5c8de8a93bc971415e47f0f/wrapt-1.17.2-cp312-cp312-win_amd64.whl", hash = "sha256:ec89ed91f2fa8e3f52ae53cd3cf640d6feff92ba90d62236a81e4e563ac0e991", size = 38865 },
|
||||
{ url = "https://files.pythonhosted.org/packages/ce/b9/0ffd557a92f3b11d4c5d5e0c5e4ad057bd9eb8586615cdaf901409920b14/wrapt-1.17.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:6ed6ffac43aecfe6d86ec5b74b06a5be33d5bb9243d055141e8cabb12aa08125", size = 53800 },
|
||||
{ url = "https://files.pythonhosted.org/packages/c0/ef/8be90a0b7e73c32e550c73cfb2fa09db62234227ece47b0e80a05073b375/wrapt-1.17.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:35621ae4c00e056adb0009f8e86e28eb4a41a4bfa8f9bfa9fca7d343fe94f998", size = 38824 },
|
||||
{ url = "https://files.pythonhosted.org/packages/36/89/0aae34c10fe524cce30fe5fc433210376bce94cf74d05b0d68344c8ba46e/wrapt-1.17.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a604bf7a053f8362d27eb9fefd2097f82600b856d5abe996d623babd067b1ab5", size = 38920 },
|
||||
{ url = "https://files.pythonhosted.org/packages/3b/24/11c4510de906d77e0cfb5197f1b1445d4fec42c9a39ea853d482698ac681/wrapt-1.17.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5cbabee4f083b6b4cd282f5b817a867cf0b1028c54d445b7ec7cfe6505057cf8", size = 88690 },
|
||||
{ url = "https://files.pythonhosted.org/packages/71/d7/cfcf842291267bf455b3e266c0c29dcb675b5540ee8b50ba1699abf3af45/wrapt-1.17.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:49703ce2ddc220df165bd2962f8e03b84c89fee2d65e1c24a7defff6f988f4d6", size = 80861 },
|
||||
{ url = "https://files.pythonhosted.org/packages/d5/66/5d973e9f3e7370fd686fb47a9af3319418ed925c27d72ce16b791231576d/wrapt-1.17.2-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8112e52c5822fc4253f3901b676c55ddf288614dc7011634e2719718eaa187dc", size = 89174 },
|
||||
{ url = "https://files.pythonhosted.org/packages/a7/d3/8e17bb70f6ae25dabc1aaf990f86824e4fd98ee9cadf197054e068500d27/wrapt-1.17.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:9fee687dce376205d9a494e9c121e27183b2a3df18037f89d69bd7b35bcf59e2", size = 86721 },
|
||||
{ url = "https://files.pythonhosted.org/packages/6f/54/f170dfb278fe1c30d0ff864513cff526d624ab8de3254b20abb9cffedc24/wrapt-1.17.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:18983c537e04d11cf027fbb60a1e8dfd5190e2b60cc27bc0808e653e7b218d1b", size = 79763 },
|
||||
{ url = "https://files.pythonhosted.org/packages/4a/98/de07243751f1c4a9b15c76019250210dd3486ce098c3d80d5f729cba029c/wrapt-1.17.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:703919b1633412ab54bcf920ab388735832fdcb9f9a00ae49387f0fe67dad504", size = 87585 },
|
||||
{ url = "https://files.pythonhosted.org/packages/f9/f0/13925f4bd6548013038cdeb11ee2cbd4e37c30f8bfd5db9e5a2a370d6e20/wrapt-1.17.2-cp313-cp313-win32.whl", hash = "sha256:abbb9e76177c35d4e8568e58650aa6926040d6a9f6f03435b7a522bf1c487f9a", size = 36676 },
|
||||
{ url = "https://files.pythonhosted.org/packages/bf/ae/743f16ef8c2e3628df3ddfd652b7d4c555d12c84b53f3d8218498f4ade9b/wrapt-1.17.2-cp313-cp313-win_amd64.whl", hash = "sha256:69606d7bb691b50a4240ce6b22ebb319c1cfb164e5f6569835058196e0f3a845", size = 38871 },
|
||||
{ url = "https://files.pythonhosted.org/packages/3d/bc/30f903f891a82d402ffb5fda27ec1d621cc97cb74c16fea0b6141f1d4e87/wrapt-1.17.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:4a721d3c943dae44f8e243b380cb645a709ba5bd35d3ad27bc2ed947e9c68192", size = 56312 },
|
||||
{ url = "https://files.pythonhosted.org/packages/8a/04/c97273eb491b5f1c918857cd26f314b74fc9b29224521f5b83f872253725/wrapt-1.17.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:766d8bbefcb9e00c3ac3b000d9acc51f1b399513f44d77dfe0eb026ad7c9a19b", size = 40062 },
|
||||
{ url = "https://files.pythonhosted.org/packages/4e/ca/3b7afa1eae3a9e7fefe499db9b96813f41828b9fdb016ee836c4c379dadb/wrapt-1.17.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:e496a8ce2c256da1eb98bd15803a79bee00fc351f5dfb9ea82594a3f058309e0", size = 40155 },
|
||||
{ url = "https://files.pythonhosted.org/packages/89/be/7c1baed43290775cb9030c774bc53c860db140397047cc49aedaf0a15477/wrapt-1.17.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40d615e4fe22f4ad3528448c193b218e077656ca9ccb22ce2cb20db730f8d306", size = 113471 },
|
||||
{ url = "https://files.pythonhosted.org/packages/32/98/4ed894cf012b6d6aae5f5cc974006bdeb92f0241775addad3f8cd6ab71c8/wrapt-1.17.2-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a5aaeff38654462bc4b09023918b7f21790efb807f54c000a39d41d69cf552cb", size = 101208 },
|
||||
{ url = "https://files.pythonhosted.org/packages/ea/fd/0c30f2301ca94e655e5e057012e83284ce8c545df7661a78d8bfca2fac7a/wrapt-1.17.2-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9a7d15bbd2bc99e92e39f49a04653062ee6085c0e18b3b7512a4f2fe91f2d681", size = 109339 },
|
||||
{ url = "https://files.pythonhosted.org/packages/75/56/05d000de894c4cfcb84bcd6b1df6214297b8089a7bd324c21a4765e49b14/wrapt-1.17.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:e3890b508a23299083e065f435a492b5435eba6e304a7114d2f919d400888cc6", size = 110232 },
|
||||
{ url = "https://files.pythonhosted.org/packages/53/f8/c3f6b2cf9b9277fb0813418e1503e68414cd036b3b099c823379c9575e6d/wrapt-1.17.2-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:8c8b293cd65ad716d13d8dd3624e42e5a19cc2a2f1acc74b30c2c13f15cb61a6", size = 100476 },
|
||||
{ url = "https://files.pythonhosted.org/packages/a7/b1/0bb11e29aa5139d90b770ebbfa167267b1fc548d2302c30c8f7572851738/wrapt-1.17.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:4c82b8785d98cdd9fed4cac84d765d234ed3251bd6afe34cb7ac523cb93e8b4f", size = 106377 },
|
||||
{ url = "https://files.pythonhosted.org/packages/6a/e1/0122853035b40b3f333bbb25f1939fc1045e21dd518f7f0922b60c156f7c/wrapt-1.17.2-cp313-cp313t-win32.whl", hash = "sha256:13e6afb7fe71fe7485a4550a8844cc9ffbe263c0f1a1eea569bc7091d4898555", size = 37986 },
|
||||
{ url = "https://files.pythonhosted.org/packages/09/5e/1655cf481e079c1f22d0cabdd4e51733679932718dc23bf2db175f329b76/wrapt-1.17.2-cp313-cp313t-win_amd64.whl", hash = "sha256:eaf675418ed6b3b31c7a989fd007fa7c3be66ce14e5c3b27336383604c9da85c", size = 40750 },
|
||||
{ url = "https://files.pythonhosted.org/packages/2d/82/f56956041adef78f849db6b289b282e72b55ab8045a75abad81898c28d19/wrapt-1.17.2-py3-none-any.whl", hash = "sha256:b18f2d1533a71f069c7f82d524a52599053d4c7166e9dd374ae2136b7f40f7c8", size = 23594 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "xonsh"
|
||||
version = "0.19.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/68/4e/56e95a5e607eb3b0da37396f87cde70588efc8ef819ab16f02d5b8378dc4/xonsh-0.19.2.tar.gz", hash = "sha256:cfdd0680d954a2c3aefd6caddcc7143a3d06aa417ed18365a08219bb71b960b0", size = 799960 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/6c/13/281094759df87b23b3c02dc4a16603ab08ea54d7f6acfeb69f3341137c7a/xonsh-0.19.2-py310-none-any.whl", hash = "sha256:ec7f163fd3a4943782aa34069d4e72793328c916a5975949dbec8536cbfc089b", size = 642301 },
|
||||
{ url = "https://files.pythonhosted.org/packages/29/41/a51e4c3918fe9a293b150cb949b1b8c6d45eb17dfed480dcb76ea43df4e7/xonsh-0.19.2-py311-none-any.whl", hash = "sha256:53c45f7a767901f2f518f9b8dd60fc653e0498e56e89825e1710bb0859985049", size = 642286 },
|
||||
{ url = "https://files.pythonhosted.org/packages/0a/93/9a77b731f492fac27c577dea2afb5a2bcc2a6a1c79be0c86c95498060270/xonsh-0.19.2-py312-none-any.whl", hash = "sha256:b24c619aa52b59eae4d35c4195dba9b19a2c548fb5c42c6f85f2b8ccb96807b5", size = 642386 },
|
||||
{ url = "https://files.pythonhosted.org/packages/be/75/070324769c1ff88d971ce040f4f486339be98e0a365c8dd9991eb654265b/xonsh-0.19.2-py313-none-any.whl", hash = "sha256:c53ef6c19f781fbc399ed1b382b5c2aac2125010679a3b61d643978273c27df0", size = 642873 },
|
||||
{ url = "https://files.pythonhosted.org/packages/fa/cb/2c7ccec54f5b0e73fdf7650e8336582ff0347d9001c5ef8271dc00c034fe/xonsh-0.19.2-py39-none-any.whl", hash = "sha256:bcc0225dc3847f1ed2f175dac6122fbcc54cea67d9c2dc2753d9615e2a5ff284", size = 634602 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zipp"
|
||||
version = "3.21.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/3f/50/bad581df71744867e9468ebd0bcd6505de3b275e06f202c2cb016e3ff56f/zipp-3.21.0.tar.gz", hash = "sha256:2c9958f6430a2040341a52eb608ed6dd93ef4392e02ffe219417c1b28b5dd1f4", size = 24545 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/b7/1a/7e4798e9339adc931158c9d69ecc34f5e6791489d469f5e50ec15e35f458/zipp-3.21.0-py3-none-any.whl", hash = "sha256:ac1bbe05fd2991f160ebce24ffbac5f6d11d83dc90891255885223d42b3cd931", size = 9630 },
|
||||
]
|
Loading…
Reference in New Issue