Fix to follow the FAQ. Use the conf.py file from your currently checked out branch.#113
Open
Walter-Gates-Bose wants to merge 2 commits intosphinx-contrib:mainfrom
Open
Conversation
This is stated as how things work in the FAQ.
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.
This is stated as how things work in the FAQ.
Use the
conf.pyfile from your currently checked out branch when loading config options from other branches/tags. This change fixed an instance of theFailed load config for %s from %sfor me after I changed myconf.pyfile.Edit: I also found that
sphinx.config.Config.init_valueswould give the errorunknown config value %r in override, ignoringwhen theconfig.pyis loaded for the tags/branches to be generated (it useslogger.warning, however it prints tostderrand many CI/CD servers fail any step with output tostderr) when overridingsphinx-multiversionconfig values from the command line (using-D).When
sphinx-multiversionloads theconfig.pyfile for the tags/branches, there is at least one value that might be useful to override;smv_outputdir_format. In my use case, I set it tosmv_outputdir_format="{repo_name}/v{version}"when generating for release, because I only want to generate from tags. When running CI, I want to override with-D "smv_outputdir_format={ref.name}"because I care less about the output folder structure and more about also generating the current branch, which the release format does not support. I also generate for multiple versions of python, so I always want to run the branch generation throughsphinx-multiversionto ensure it works, especially when adding a new version.The fix I chose was to always add the
sphinx-multiversionoptions to thesphinx.configby removing that code out of anifstatement that prevented doing so when loading the config for branches/tags.