Pass current envvars into Popen when triggering diagram generation #149
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.
Longer explanation:
So far I had an environment prepared within a docker image to generate documentation.
However recently I was testing the feasibility to move it out of the docker definition into an easier cache'able (on CI) regular environment definition. Meaning that instead of dockerfile, I'd have Pipfile and node-modules required at the project's documentation level.
Since I also produce the documentation for confluence, I needed to generate svg's.
And because I try to separate component's virtualenv's to be able to update dependencies independently (also if a component requires node) I started using asdf-vm for that.
In order for mermaid to generate svg files through sphinxcontrib-mermaid, I had to pass environment variables, otherwise I got errors that
npx mmdc
command was not found.Passing environmental variables fixes that issue, and allows to get the diagrams generated, at least in the case of
mermaid_cmd_shell=False
setting.mermaid_cmd_shell=True
triggers thenpx mmdc
command without any issue, however the diagrams are not generated at all.I've tested this on mermaid's own documentation with conf.py settings like that: