-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Document the make venv
documentation build target
#2953
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
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7440ae9
Make the directory for the venv be configurable
brettcannon b4a8111
Update a URL
brettcannon bdad7bb
Expand on possible Doc venv directory names
brettcannon d594bd3
Print out where the Doc venv was created
brettcannon bc606b8
Document the `make venv` target for the docs
brettcannon 58f3915
Put the venv directory back to what it was
brettcannon c54e41c
Set SPHINXBUILD to use `-m` for greater flexibility
brettcannon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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.
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.
Alas, this is currently insufficient. The
sphinx-build
command in the venv won't be found without other Makefile changes (it doesn't fail if you already havesphinx-build
installed on your PATH). Since we're going to have tweak this a bit once theblurb
support is merged in, suggest for now just adding a shell source command prior to themake html
, i.e.. ./env/bin/activate
or (. ./venv/bin/activate
).Uh oh!
There was an error while loading. Please reload this page.
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.
Price I pay for wrapping this up before rushing out the door. 😞
But I think I found a better solution than having to activate the venv blindly: setting
SPHINXBUILD
to$(PYTHON) -m sphinx
. It's the same assphinx-build
but with the simpler setting ofPYTHON
being properly supported. Does that work for you, @ned-deily ?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.
I know I suggested something similar for blurb. But now I'm not sure that was the best choice. It's more problematic with sphinx-build since existing doc builds may have been depending on using an already installed (e.g. system) sphinx-build and have never bothered before to run the
make venv
step (and before, even if they did run that step, it wouldn't have made a difference without tweakingPYTHON
). With this change, those builds would now fail unless sphinx had happened to be installed in whateverpython3
on PATH points to. I don't know how many users this would affect but it's not hypothetical: I ran into this myself. There are several ways around it; I was thinking the most straightforward way might be to play with PATH in the "build" rule; so something like:PATH=./venv/bin:$PATH sphinx-build
Either that or we need to make sure this is documented as an incompatible change and then maybe only for 3.7?
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.
Another possibility would be to make the
build
rule depend on thevenv
rule but, as it stands, that causesvenv
to be run every time you do any doc build.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.
My worry with the
PATH=./$(VENVDIR)/bin:$PATH $(SPHINXBUILD)
solution is won't this require being set for anything that might have an entry inbin
? And that seems a bit more error-prone long-term than this current approach as I can see forgetting to setPATH
in some rule.I'm fine with this being a Python 3.7-only thing if that doesn't cause you grief in 3.6 releases. But if you would rather have the
PATH
solution I'm fine with it as well. Just let me know your preference and I'll update the PR.