Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ You can build just the Spark scaladoc and javadoc by running `build/sbt unidoc`

Similarly, you can build just the PySpark docs by running `make html` from the
`$SPARK_HOME/python/docs` directory. Documentation is only generated for classes that are listed as
public in `__init__.py`. The SparkR docs can be built by running `$SPARK_HOME/R/create-docs.sh`, and
public in `__init__.py`. You can also set `SPHINXPYTHON` to specify the Python executable to use with Sphinx.
The SparkR docs can be built by running `$SPARK_HOME/R/create-docs.sh`, and
Copy link
Member Author

@HyukjinKwon HyukjinKwon Jul 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me take out this change in this PR, actually. It makes backporting harder

the SQL docs can be built by running `$SPARK_HOME/sql/create-docs.sh`
after [building Spark](https://github.com/apache/spark#building-spark) first.

Expand Down
28 changes: 22 additions & 6 deletions python/docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
# Makefile for Sphinx documentation
#

ifndef SPHINXPYTHON
SPHINXBUILD ?= sphinx-build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If both are set, we prefer SPHINXPYTHON?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, I updated the manual tests above. There are commands executed in the logs.

# User-friendly check for sphinx-build if explicitly specified.
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If SPHINXPYTHON -msphinx' is preferred instead of 'sphinx-build' by default, should we go for a default SPHINXPYTHON + -msphinx instead of a default SPHINXBUILD if both are not set?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea... that was the problem I faced.. Probably we should change but seems it needs some changes in Jenkins environment .. FYI there are some discussion about the potential effect by setting that as a default in the PR link of the comments.

I was thinking we set SPHINXPYTHON manually when we make a release for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems error prone - why not pick a good default of python3 and allow overriding?

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))')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we fix the SPHINXPYTHON to python3 in release script release-build.sh?

Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forcing SPHINXPYTHON to python3 by default will probably break the distribution builder in Jenkins if they are tried ... Seems there's an issue to force Sphinx to use Python 3 in Jenkins environment. This was the problem I struggled to tweak :(.

Am trying to update the release process - apache/spark-website#122. Would this be enough to address your concern?

ifeq ($(PYTHON_VERSION_CHECK), True)
$(warning 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' by default. 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
# Also, you can set SPHINXBUILD to specify Sphinx build executable or SPHINXPYTHON to specify the Python executable used in Sphinx.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify the priority here.


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
Expand Down