-
Notifications
You must be signed in to change notification settings - Fork 76
doc: Add a field metadata to the setting fields #1051
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
Conversation
e2b935e to
36580fc
Compare
- Moved default text handling to a separate function - Prepare to read metadata fields from dataclasses.Field.metadata - Added a dataclass holder for the dataclass field metadata for documentation Signed-off-by: Cristian Le <[email protected]>
Signed-off-by: Cristian Le <[email protected]>
Signed-off-by: Cristian Le <[email protected]>
36580fc to
b965df7
Compare
|
Oh, interesting, I considered this before, but I was looking at annotations, this might be better. I'll try to review soon, working on the partially dynamic metadata PEP proposal currently. |
Signed-off-by: Henry Schreiner <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
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.
Pull Request Overview
This PR adds a new metadata mechanism for setting fields to support enhanced default display values and deprecation handling as part of preparations for #999. Key changes include:
- Introducing a new TypedDict (SettingsFieldMetadata) to annotate dataclass fields.
- Updating several settings classes (CMakeSettings, NinjaSettings, WheelSettings, InstallSettings, ScikitBuildSettings) to use dataclasses.field with metadata.
- Modifying documentation generation in both skbuild_docs.py and documentation.py to leverage the metadata and filter out deprecated fields.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/scikit_build_core/settings/skbuild_model.py | Updates to dataclass field defaults with metadata for deprecation/display. |
| src/scikit_build_core/settings/skbuild_docs.py | Simplified docs generation by filtering out deprecated fields. |
| src/scikit_build_core/settings/documentation.py | Enhancements to DCDoc and default sanitization to support metadata usage. |
Comments suppressed due to low confidence (1)
src/scikit_build_core/settings/skbuild_docs.py:18
- [nitpick] Verify that filtering out all deprecated items from the documentation is the intended behavior, as this change may hide fields that some consumers might still expect to see.
str(item) for item in mk_docs(ScikitBuildSettings) if not item.deprecated
Also adding back a couple of test files that I wrote but missed adding in previous PRs: * #1051 * #1047 Signed-off-by: Henry Schreiner <[email protected]>
This would make it easier to cross-reference. I was debating going for an auto-generated one and integrating with sphinx directly or going with the `nox -t gen` files, and I think I prefer the latter because it makes it more obvious to review the generated text in all the places, wdyt? I also want to unlock usage of sphinx roles in it, but the readme generation gets in the way. My opinion is that if we have this, we could either move the readme part to the generated page, or truncate it to only display the first summary sentence similar to how `click` does it. Depends-on: #1051 Closes #999 --------- Signed-off-by: Cristian Le <[email protected]>
A few preparations for #999