Skip to content

Fix custom registry for lazy subcommand parsers#453

Merged
brentyi merged 2 commits intomainfrom
brent/20260401_fix_registry_subcommand
Apr 2, 2026
Merged

Fix custom registry for lazy subcommand parsers#453
brentyi merged 2 commits intomainfrom
brent/20260401_fix_registry_subcommand

Conversation

@brentyi
Copy link
Copy Markdown
Owner

@brentyi brentyi commented Apr 2, 2026

Fixes #452, thanks @alexander-book-snkeos!

brentyi added 2 commits April 1, 2026 18:12
The `with registry:` context in `_cli_impl` only wrapped
`ParserSpecification.from_callable_or_type()`, but subcommand parsers
use `LazyParserSpecification` whose `evaluate()` runs later during
`backend.parse_args()` and `callable_with_args()` — after the registry
context had already exited. Extend the registry context to wrap the
entire CLI pipeline.
@brentyi brentyi merged commit ffae793 into main Apr 2, 2026
16 checks passed
@brentyi brentyi deleted the brent/20260401_fix_registry_subcommand branch April 2, 2026 01:31
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.49%. Comparing base (1da233b) to head (9974038).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #453   +/-   ##
=======================================
  Coverage   99.49%   99.49%           
=======================================
  Files          52       52           
  Lines        3983     3984    +1     
=======================================
+ Hits         3963     3964    +1     
  Misses         20       20           
Flag Coverage Δ
unittests 99.49% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Custom primitive registry not working with subcommand_cli_from_dict

1 participant