Msp allow docs name#648
Draft
MaximilianSoerenPollak wants to merge 4 commits into
Draft
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //src:license-checkStatus: Click to expand output |
| repo = repo.lstrip("@") | ||
|
|
||
| if path_to_target == "" and target in ("needs_json", "docs_sources"): | ||
| # The producer's docs() macro may have used a custom `name`, in which case its targets |
Contributor
Author
There was a problem hiding this comment.
Probably can make this nicer with saying "docs_sources" in target
|
The created documentation from the pull request is available at: docu-html |
Comment on lines
+38
to
+51
| def add_config_value_if_absent( | ||
| app: Sphinx, name: str, default: Any, rebuild: _ConfigRebuild | ||
| ) -> None: | ||
| """Register a Sphinx config value, unless another extension already has. | ||
|
|
||
| Several of our extensions may be used either standalone or bundled together via | ||
| score_sphinx_bundle, in either load order, and may each want the same config value | ||
| registered. Sphinx raises if `add_config_value` is called twice for the same name, | ||
| so this guards the registration to make it safe to call from multiple extensions. | ||
| """ | ||
| # Sphinx has no public API for this check either; `_options` is the internal dict | ||
| # `Config.add` itself consults to reject duplicate registrations. | ||
| if name not in app.config._options: # pyright: ignore [reportPrivateUsage] | ||
| app.add_config_value(name, default, rebuild=rebuild) |
Contributor
Author
There was a problem hiding this comment.
is this truly needed?
Not using score_bundle should be not allowed in S-CORE, so I thin kwe can remove this,
MaximilianSoerenPollak
left a comment
Contributor
Author
There was a problem hiding this comment.
Probably 1 - 2 things still to iron out here, but overall looks like a good approach I think
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Description
Allow the docs macro to be used with a
nameattribute as is custom for almost all bazel macros.This will allow us in the future to use the docs marco in the same build file multiple times, with different inputs and have no collision.
This should be a good first step towards coming closer to how bazel macros should be written and make it more useable in other settings too.
=> Still a challenge though is how we can enforce non idiotic usage of this in S-CORE.
ℹ️ Still a Draft PR until the Docs are changed and we have agreed internally how this should be done.
🚨 Impact Analysis
✅ Checklist