-
Notifications
You must be signed in to change notification settings - Fork 78
feat: add Python example to list extensions associated with profiles #1231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ThinkOpenly
commented
Nov 4, 2025
…file(s) ``` $ ./tools/python/profile-extensions.py --profiles RVA23U64 gen/resolved_spec/_/ RVA23U64: - A = 2.1 mandatory - C = 2.0 mandatory - D = 2.2 mandatory - F = 2.2 mandatory - I ~> 2.1 mandatory - M = 2.0 mandatory - Supm ~>1.0 mandatory - U ~> 2.0 mandatory - V ~> 1.0 mandatory - Za64rs ~>1.0 mandatory [...] ``` Signed-off-by: Paul A. Clarke <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1231 +/- ##
=======================================
Coverage 46.05% 46.05%
=======================================
Files 11 11
Lines 4942 4942
Branches 1345 1345
=======================================
Hits 2276 2276
Misses 2666 2666
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Dumb Python question: What's the Python equivalent of a Ruby Gem? Should this wrapped in whatever that is (with other functions, too?)?
- I would suggest a new regression in regress.yml so this continues to work.
Probably a Python module. If we wanted to start building a Python infrastructure, we could certainly go that route. There is some similar infrastructure emerging in One of the motivations, though, was just to have a short example showing a practical use of UDB from Python: load YAML, walk through it and do something interesting with the data. Refactoring would likely make the example even simpler by some measurement, since the "load YAML" part would be refactored out. I'll work on that.
That can be done. I suppose we might want to use the "golden reference" approach. I should add a chore for updating all of the golden references, because this will likely become a common approach, and updating them each individually will be a pain. |
Excellent
We might also get away with comparing the python "list extension" to the ruby "list extension" |
Does the ruby "list extension" tag or filter by containing profile? |
- Split common reusable components into a "UDB" module - Add a golden output, and a task to generate/update it - Add a test to verify current output matches golden output - Add to regression tests Signed-off-by: Paul A. Clarke <[email protected]>
| from pathlib import Path | ||
|
|
||
|
|
||
| def store_yaml(path, kinds=[]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid using an empty list as a default argument. It can create some very strange results if a function is called multiple times. See https://docs.astral.sh/ruff/rules/mutable-argument-default/ for more details.