Compare commits

..

32 Commits

Author SHA1 Message Date
Tyler Goodlet e42bc33bd6 Move bp to-match-comments on same line for py3.13
In the `examples/debugging/restore_builtin_breakpoint.py` i had put the
pattern-comment lines on the line following the `breakpoint()` bc it
seems that's where `pdb` would always "stop" and print the line to
console? So the test would only pass by actually ensuring that in the
`pexpect` capture..

Now on 3.13 it seems that the `pdb` line halting must have been fixed;
it now renders to console the same `breakpoint()` line?
Anyway it works as you'd expect now but **only** on 3.13 so after this
change we might have to adjust the tests to `pytest.xfail()` on earlier
versions.
2025-03-25 12:54:12 -04:00
Tyler Goodlet bb916fd815 Drop explicit `tabcompleter` dep, `pdpp` already sub-depends on it? 2025-03-25 12:54:03 -04:00
Tyler Goodlet 27e4fc6660 Bump up to `pytest>=8.3.5` to match "GH actions"
Ensure it's only for the `--dev` optional deps.
2025-03-25 12:54:03 -04:00
Tyler Goodlet 5feac62d3f Bump to `msgspec>=0.19.0` for py 3.13 support! 2025-03-25 12:54:03 -04:00
Tyler Goodlet 631fcc0471 Bind another `_bexc` for debuggin 2025-03-25 12:54:03 -04:00
Tyler Goodlet 6e43fe1dd0 Unpack errors from `pdb.bdb`
Like any `bdb.BdbQuit` that might be relayed from a remote context after
a REPl exit with the `quit` cmd. This fixes various issues while
debugging where it may not be clear to the parent task that the child
was terminated with a purposefully unrecoverable error.
2025-03-25 12:54:03 -04:00
Tyler Goodlet 187af24bcc Show frames when decode is handed bad input 2025-03-25 12:54:03 -04:00
Tyler Goodlet 64fbad708e Another loosie in the trioisms suite 2025-03-25 12:54:03 -04:00
Tyler Goodlet 6bd4903d01 Match `maybe_open_crash_handler()` to non-maybe version
Such that it will deliver a `BoxedMaybeException` to the caller
regardless whether `pdb` is set, and proxy through all `**kwargs`.
2025-03-25 12:54:03 -04:00
Tyler Goodlet f6c098d608 Use `collapse_eg()` in broadcaster suite
Around the test embedded `trio.open_nursery()` calls as expected. Also
tidy up the various nursery var names.
2025-03-25 12:54:03 -04:00
Tyler Goodlet 7920e2980b Draft some eg collapsing helpers
Inside a new `.trionics._beg` and exposed from the subpkg ns in
anticipation of the `strict_exception_groups=False` being removed by
`trio` in py 3.15.

Notes,
- mk an embedded single-exc "extractor" using a `BaseExceptionGroup.exceptions` length
  check, when 1 return the lone child.
- use the above in a new `@acm`, async bc it's most likely to be composed in an
  `async with` tuple-style sequence block, called `collapse_eg()` which
  acts a one line "absorber" for when the above mentioned flag is no
  logner supported by `trio.open_nursery()`.

All untested atm fwiw.. but soon to be used in our test suite(s) likely!
2025-03-25 12:54:03 -04:00
Tyler Goodlet e92c3e63ae Fix docs tests with yet another loosie-goosie
So the KBI propagates up to the actor nursery scope and also avoid
running any `examples/multihost/` subdir scripts.
2025-03-25 12:54:03 -04:00
Tyler Goodlet 364ae6f6c8 Another couple loose-ifies for discovery and advanced fault suites 2025-03-25 12:54:03 -04:00
Tyler Goodlet 052b36f1e7 Add (masked) meta-debug-fixture for determining if `debug_mode` is set in harness.. 2025-03-25 12:54:03 -04:00
Tyler Goodlet 261c48e126 Various test tweaks related to 3.13 egs
Including changes like,
- loose eg flagging in various test emedded `trio.open_nursery()`s.
- changes to eg handling (like using `except*`).
- added `debug_mode` integration to tests that needed some REPLin
  in order to figure out appropriate updates.
2025-03-25 12:54:03 -04:00
Tyler Goodlet c793f177f6 Go to loose egs in `Actor` root & service nurseries (for now..) 2025-03-25 12:54:03 -04:00
Tyler Goodlet deb84e0b2c Fix `roundtripped` ref error in `validate_payload_msg()` 2025-03-25 12:54:03 -04:00
Tyler Goodlet 3fa86c82fd Hide `open_nursery()` frame by def 2025-03-25 12:54:03 -04:00
Tyler Goodlet 1407ea26d3 Moar sclang log fmting tweaks 2025-03-25 12:54:03 -04:00
Tyler Goodlet 2903431540 Expose `._state.debug_mode()` predicate at top level 2025-03-25 12:54:03 -04:00
Tyler Goodlet 1da0cba380 Another loose-egs flag in `test_child_manages_service_nursery` 2025-03-25 12:54:03 -04:00
Tyler Goodlet 36eb30daa3 Handle egs on failed `request_root_stdio_lock()`
Namely when the subactor fails to lock the root, in which case we
try to be very verbose about how/what failed in logging as well
as ensure we cancel the employed IPC ctx.

Implement the outer `BaseException` handler to handle both styles,
- match on an eg (or the prior std cancel excs) only raising a lone
  sub-exc from for former.
- always `as _req_err:` and assign to a new func-global `req_err`
  to enable the above matching.

Other,
- raise `DebugStateError` on `status.subactor_uid != actor_uid`.
- fix a `_repl_fail_report` ref error due to making silly assumptions
  about the `_repl_fail_msg` global; now copy from global as default.
- various log-fmt and logic expression styling tweaks.
- ignore `trio.Cancelled` by default in `open_crash_handler()`.
2025-03-25 12:54:03 -04:00
Tyler Goodlet 5bbd9b4e54 A couple more loose-egs flag flips
Namely inside,
- `ActorNursery.open_portal()` which uses
  `.trionics.maybe_open_nursery()` and is now adjusted to
  pass-through `**kwargs` for at least this flag.
- inside the `.trionics.gather_contexts()`.
2025-03-25 12:54:03 -04:00
Tyler Goodlet 89db16c693 Disable tb colors in `._testing.mk_cmd()`
Unset the appropriate cpython osenv var such that our `pexpect` script
runs in the test suite can maintain original matching logic.
2025-03-25 12:54:03 -04:00
Tyler Goodlet 8056a9cf9f Log format tweaks for sclang reprs
A space here, a newline there..
2025-03-25 12:54:03 -04:00
Tyler Goodlet c8a3a6fb2b Expose `hide_tb: bool` from `.open_nursery()`
Such that it gets passed through to `.open_root_actor()` in the
`implicit_runtime==True` case - useful for debugging cases where
`.devx._debug` APIs might be used to avoid REPL clobbering in subactors.
2025-03-25 12:54:03 -04:00
Tyler Goodlet 897fa3d9f2 Flip to `strict_exception_groups=False` in core tns
Since it'll likely need a bit of detailing to get the test suite running
identically with strict egs (exception groups), i've opted to just flip
the switch on a few core nursery scopes for now until as such a time
i can focus enough to port the matching internals.. Xp
2025-03-25 12:54:03 -04:00
Tyler Goodlet 639d6a981c Clean up some imports in `._clustering` 2025-03-25 12:54:03 -04:00
Tyler Goodlet 08941c22a6 Bump various (dev) deps and prefer sys python
Since it turns out there's a few gotchas moving to python 3.13,
- we need to pin to new(er) `trio` which now flips to strict exception
  groups (something to be handled in a follow up patch).
- since we're now using `uv` we should (at least for now) prefer the
  system `python` (over astral's distis) since they compile for
  `libedit` in terms of what the (new) `readline.backend: str` will read
  as; this will break our tab-completion and vi-mode settings in
  the `pdbp` REPL without a user configuring a `~/.editrc`
  appropriately.
- go back to using latest `pdbp` (not a local dev version) since it
  should work fine presuming the previous bullet is addressed.

Lock bumps,
- for now use latest `trio==0.29.0` (which i gotta feeling might have
  broken some existing attempts at strict-eg handling i've tried..)
- update to latest `xonsh`, `pdbp` and its dep `tabcompleter`

Other cleaning,
- put back in various deps "comments" from `poetry` content.
- drop the `xonsh-vox` and `xontrib-vox` dev deps; no `vox` support with
  `uv` rn anyway..
2025-03-25 12:54:03 -04:00
Tyler Goodlet 010d75248e Comment-tag pause points in `asycnio_bp.py`
Thought i already did this but, obvi needed these to make the expect
matches pass in our test.
2025-03-25 12:45:04 -04:00
Tyler Goodlet 47ec7e7a49 Add equiv of `AsyncioCancelled` for aio side
Such that a `TrioCancelled` is raised in the aio task via
`.set_exception()` to explicitly indicate and allow that task to handle
a taskc request from the parent `trio.Task`.
2025-03-25 12:45:04 -04:00
Tyler Goodlet a66caa2397 Drop `asyncio`-canc error from `._exceptions` 2025-03-25 12:45:04 -04:00
1 changed files with 2 additions and 4 deletions

View File

@ -32,8 +32,7 @@ async def main() -> None:
f'$PYTHONOBREAKPOINT: {pybp_var!r}\n'
f'`sys.breakpointhook`: {pybp_hook!r}\n'
)
breakpoint()
pass # first bp, tractor hook set.
breakpoint() # first bp, tractor hook set.
# XXX AFTER EXIT (of actor-runtime) verify the hook is unset..
#
@ -43,8 +42,7 @@ async def main() -> None:
assert sys.breakpointhook
# now ensure a regular builtin pause still works
breakpoint()
pass # last bp, stdlib hook restored
breakpoint() # last bp, stdlib hook restored
if __name__ == '__main__':