Skip to content

[help] Add granular help for dict[str, BaseModel] params#787

Open
wrongbad wants to merge 2 commits intoBrianPugh:mainfrom
wrongbad:main
Open

[help] Add granular help for dict[str, BaseModel] params#787
wrongbad wants to merge 2 commits intoBrianPugh:mainfrom
wrongbad:main

Conversation

@wrongbad
Copy link
Copy Markdown

@wrongbad wrongbad commented Apr 9, 2026

#786

What do you think?

@wrongbad wrongbad changed the title [help] Add granualar help for dict[str, BaseModel] params [help] Add granular help for dict[str, BaseModel] params Apr 9, 2026
@BrianPugh
Copy link
Copy Markdown
Owner

thanks for the PR! I only had a chance to skim it right now, but I like that the diff is minimal! However, I think this would only work 1 level deep, right? I think we may need it to be recursive.

@wrongbad
Copy link
Copy Markdown
Author

wrongbad commented Apr 9, 2026

Do you think the single-level depth is useful enough to merge a first PR, and revisit arbitrary recursion later?

@BrianPugh
Copy link
Copy Markdown
Owner

I'll take a look at this tonight; if there's not a straightforward way of having the recursive support, we could merge this as-is as a partial fix.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.80%. Comparing base (d003ce3) to head (7819b98).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
cyclopts/help/help.py 81.81% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #787      +/-   ##
==========================================
+ Coverage   89.75%   89.80%   +0.04%     
==========================================
  Files          71       71              
  Lines        8218     8256      +38     
  Branches     1861     1864       +3     
==========================================
+ Hits         7376     7414      +38     
  Misses        477      477              
  Partials      365      365              
Flag Coverage Δ
unittests 89.72% <81.81%> (+0.04%) ⬆️

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.

Extract a recursive _yield_pydantic_help_entries helper that walks
pydantic model fields to generate synthesized help entries.  Handles
nested BaseModels, dict[str, BaseModel] (with additional {NAME}
placeholders), Optional[BaseModel] unwrapping, and circular model
references (emitted as leaf entries instead of silently dropped).

Made-with: Cursor
@wrongbad
Copy link
Copy Markdown
Author

I took a stab at recursive support. See the updated test_help for how I interpreted that. The diff in help.py is still within reason. I didn't bother with lists, or immediate nesting (dict[str, dict[str, MyClass]]). Let me know if you want that too.

@BrianPugh
Copy link
Copy Markdown
Owner

sounds good, thanks! sorry about the slow turn around time on this; i've been traveling work, i'm hoping to work on this this weekend.

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.

2 participants