Repository navigation
Default SPHINXBUILD to 'python -msphinx' instead of 'sphinx-build'. - #3523
Merged
Merged
Conversation
Using `python -msphinx` as the default for SPHINXBUILD in the Makefile/make.bat ensures that whatever virtual environment is currently active (if any) gets picked up. In the current situation, imaging that we are working on project $foo which is also installed system-wide, but we want to build docs for a venv-installed version; that sphinx is installed system-wide but not in the current environment, and that e.g. conf.py imports $foo (e.g. to retrieve a version string). Then sphinx-build will resolve to the globally installed version, and the global (wrong) version of $foo will be imported as well. With this fix, `make html` will do everything in the correct virtualenv (if any). This switch is similar in spirit to e.g. the deprecation of the `pyvenv` script in Py3.6, in favor of `python -mvenv`.
tk0miya
approved these changes
Mar 8, 2017
tk0miya
left a comment
Member
There was a problem hiding this comment.
+0; no special opinion for this.
I'd like to hear an advice from @shimizukawa.
Member
|
Merged. Thank you for contribution! |
Contributor
|
Breaks if sphinx is installed under Python 3 but not under Python 2 (i.e. if |
Contributor
Author
|
This is actually the intent of the code, as documented in the original message... |
Member
|
I decided to revert this on 1.6.5. I understand this is useful for your situation, but this confuses other people at same time. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Subject: Default SPHINXBUILD to 'python -msphinx' instead of 'sphinx-build'.
Feature or Bugfix
Purpose
Using
python -msphinxas the default for SPHINXBUILD in theMakefile/make.bat ensures that whatever virtual environment is currently
active (if any) gets picked up. In the current situation, imaging that
we are working on project $foo which is also installed system-wide,
but we want to build docs for a venv-installed version; that sphinx
is installed system-wide but not in the current environment, and that
e.g. conf.py imports $foo (e.g. to retrieve a version string). Then
sphinx-build will resolve to the globally installed version, and the
global (wrong) version of $foo will be imported as well.
With this fix,
make htmlwill do everything in the correct virtualenv(if any). This switch is similar in spirit to e.g. the deprecation of
the
pyvenvscript in Py3.6, in favor ofpython -mvenv.