-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-24530][PYTHON] Add a control to force Python version in Sphinx via environment variable, SPHINXPYTHON #21659
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
Changes from all commits
a1346e2
dd303b6
69f31a9
135d613
71ff040
950ead0
d500e0d
2e1e7da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,44 @@ | ||
| # Makefile for Sphinx documentation | ||
| # | ||
|
|
||
| ifndef SPHINXBUILD | ||
| ifndef SPHINXPYTHON | ||
| SPHINXBUILD = sphinx-build | ||
| endif | ||
| endif | ||
|
|
||
| ifdef SPHINXBUILD | ||
| # User-friendly check for sphinx-build. | ||
| ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) | ||
| $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) | ||
| endif | ||
| else | ||
| # Note that there is an issue with Python version and Sphinx in PySpark documentation generation. | ||
| # Please remove this check below when this issue is fixed. See SPARK-24530 for more details. | ||
| PYTHON_VERSION_CHECK = $(shell $(SPHINXPYTHON) -c 'import sys; print(sys.version_info < (3, 0, 0))') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we fix the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or add some options/outputs in release script to let others know how to workaround this issue.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Forcing Am trying to update the release process - apache/spark-website#122. Would this be enough to address your concern? |
||
| ifeq ($(PYTHON_VERSION_CHECK), True) | ||
| $(error Note that Python 3 is required to generate PySpark documentation correctly for now. Current Python executable was less than Python 3. See SPARK-24530. To force Sphinx to use a specific Python executable, please set SPHINXPYTHON to point to the Python 3 executable.) | ||
| endif | ||
| # Check if Sphinx is installed. | ||
| ifeq ($(shell $(SPHINXPYTHON) -c 'import sphinx' >/dev/null 2>&1; echo $$?), 1) | ||
| $(error Python executable '$(SPHINXPYTHON)' did not have Sphinx installed. Make sure you have Sphinx installed, then set the SPHINXPYTHON environment variable to point to the Python executable having Sphinx installed. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) | ||
| endif | ||
| # Use 'SPHINXPYTHON -msphinx' instead of 'sphinx-build'. See https://github.com/sphinx-doc/sphinx/pull/3523 for more details. | ||
| SPHINXBUILD = $(SPHINXPYTHON) -msphinx | ||
| endif | ||
|
|
||
| # You can set these variables from the command line. | ||
| SPHINXOPTS ?= | ||
| SPHINXBUILD ?= sphinx-build | ||
| PAPER ?= | ||
| BUILDDIR ?= _build | ||
| # You can set SPHINXBUILD to specify Sphinx build executable or SPHINXPYTHON to specify the Python executable used in Sphinx. | ||
| # They follow: | ||
| # 1. if SPHINXPYTHON is set, use Python. If SPHINXBUILD is set, use sphinx-build. | ||
| # 2. If both are set, SPHINXBUILD has a higher priority over SPHINXPYTHON | ||
| # 3. By default, SPHINXBUILD is used as 'sphinx-build'. | ||
|
|
||
| export PYTHONPATH=$(realpath ..):$(realpath ../lib/py4j-0.10.7-src.zip) | ||
|
|
||
| # User-friendly check for sphinx-build | ||
| ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) | ||
| $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) | ||
| endif | ||
|
|
||
| # Internal variables. | ||
| PAPEROPT_a4 = -D latex_paper_size=a4 | ||
| PAPEROPT_letter = -D latex_paper_size=letter | ||
|
|
||
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.
Is there a way to check that Sphinx build is running with Py3 as done bellow?
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 couldn't find an easy way.