You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2020/02/14 04:52:11 UTC
[spark] branch branch-2.4 updated: [SPARK-30823][PYTHON][DOCS] Set
`%PYTHONPATH%` when building PySpark documentation on Windows
This is an automated email from the ASF dual-hosted git repository.
gurwls223 pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-2.4 by this push:
new a312b85 [SPARK-30823][PYTHON][DOCS] Set `%PYTHONPATH%` when building PySpark documentation on Windows
a312b85 is described below
commit a312b857f58f80abcbaf5ef3d093c3a4de3b5f0b
Author: David Toneian <da...@toneian.com>
AuthorDate: Fri Feb 14 13:49:11 2020 +0900
[SPARK-30823][PYTHON][DOCS] Set `%PYTHONPATH%` when building PySpark documentation on Windows
This commit is published into the public domain.
### What changes were proposed in this pull request?
In analogy to `python/docs/Makefile`, which has
> export PYTHONPATH=$(realpath ..):$(realpath ../lib/py4j-0.10.8.1-src.zip)
on line 10, this PR adds
> set PYTHONPATH=..;..\lib\py4j-0.10.8.1-src.zip
to `make2.bat`.
Since there is no `realpath` in default installations of Windows, I left the relative paths unresolved. Per the instructions on how to build docs, `make.bat` is supposed to be run from `python/docs` as the working directory, so this should probably not cause issues (`%BUILDDIR%` is a relative path as well.)
### Why are the changes needed?
When building the PySpark documentation on Windows, by changing directory to `python/docs` and running `make.bat` (which runs `make2.bat`), the majority of the documentation may not be built if pyspark is not in the default `%PYTHONPATH%`. Sphinx then reports that `pyspark` (and possibly dependencies) cannot be imported.
If `pyspark` is in the default `%PYTHONPATH%`, I suppose it is that version of `pyspark` – as opposed to the version found above the `python/docs` directory – that is considered when building the documentation, which may result in documentation that does not correspond to the development version one is trying to build.
### Does this PR introduce any user-facing change?
No.
### How was this patch tested?
Manual tests on my Windows 10 machine. Additional tests with other environments very welcome!
Closes #27569 from DavidToneian/SPARK-30823.
Authored-by: David Toneian <da...@toneian.com>
Signed-off-by: HyukjinKwon <gu...@apache.org>
(cherry picked from commit b2134ee73cfad4d78aaf8f0a2898011ac0308e48)
Signed-off-by: HyukjinKwon <gu...@apache.org>
---
python/docs/make2.bat | 2 ++
1 file changed, 2 insertions(+)
diff --git a/python/docs/make2.bat b/python/docs/make2.bat
index 05d22eb..742df37 100644
--- a/python/docs/make2.bat
+++ b/python/docs/make2.bat
@@ -2,6 +2,8 @@
REM Command file for Sphinx documentation
+set PYTHONPATH=..;..\lib\py4j-0.10.8.1-src.zip
+
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org