Skip to content

release(0.10.0): add nullrun.handle / guarded / init_or_die#47

Merged
maltsev-dev merged 2 commits into
masterfrom
0.10.0
Jul 2, 2026
Merged

release(0.10.0): add nullrun.handle / guarded / init_or_die#47
maltsev-dev merged 2 commits into
masterfrom
0.10.0

Conversation

@maltsev-dev

Copy link
Copy Markdown
Member

Three zero-boilerplate helpers in src/nullrun/_handle.py that translate any NullRunError into format_user_message(exc) on stderr + sys.exit(1):

  • nullrun.handle() - context manager
  • @nullrun.guarded - decorator
  • nullrun.init_or_die() - wraps init() so NR-C001 'no api_key'
    exits cleanly instead of traceback

All three propagate WorkflowKilledInterrupt (BaseException) unchanged and let non-NullRun exceptions surface as honest tracebacks.

The new symbols are added to _LAZY_EXPORTS and all in src/nullrun/init.py. Module name is _handle.py (underscore prefix) so it does not collide with the public nullrun.handle context manager under pytest's test discovery import path.

Bumps:

  • pyproject.toml: 0.9.0 -> 0.10.0
  • src/nullrun/version.py: 0.8.0 -> 0.10.0

Tests: tests/test_handle.py covers handle / guarded / init_or_die including the WorkflowKilledInterrupt bypass, non-NullRun passthrough, and custom exit_code override.

What

Why

How

Test plan

  • Unit tests pass (per-repo, e.g. cd backend && cargo test, cd frontend && npm test)
  • Lint passes (per-repo, e.g. cd frontend && npm run lint)
  • Type-check passes (per-repo, e.g. cd frontend && npm run type-check)
  • Manually verified in dev / staging

Risk

Checklist

  • I have read the repo's CONTRIBUTING.md (if present)
  • My change does not introduce new lint warnings
  • I have updated the CHANGELOG (if user-visible)
  • I have considered backwards compatibility

maltsev-dev and others added 2 commits July 2, 2026 22:26
Three zero-boilerplate helpers in src/nullrun/_handle.py that translate
any NullRunError into format_user_message(exc) on stderr + sys.exit(1):

* nullrun.handle()         - context manager
* @nullrun.guarded         - decorator
* nullrun.init_or_die()    - wraps init() so NR-C001 'no api_key'
                             exits cleanly instead of traceback

All three propagate WorkflowKilledInterrupt (BaseException) unchanged
and let non-NullRun exceptions surface as honest tracebacks.

The new symbols are added to _LAZY_EXPORTS and __all__ in src/nullrun/__init__.py.
Module name is _handle.py (underscore prefix) so it does not collide
with the public nullrun.handle context manager under pytest's test
discovery import path.

Bumps:
* pyproject.toml: 0.9.0 -> 0.10.0
* src/nullrun/__version__.py: 0.8.0 -> 0.10.0

Tests: tests/test_handle.py covers handle / guarded / init_or_die
including the WorkflowKilledInterrupt bypass, non-NullRun passthrough,
and custom exit_code override.
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@maltsev-dev maltsev-dev merged commit 4602b1d into master Jul 2, 2026
5 checks passed
@maltsev-dev maltsev-dev deleted the 0.10.0 branch July 3, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant