DavidToneian opened a new pull request #27569: [SPARK-30823] Set `%PYTHONPATH%` 
when building PySpark documentation on Windows.
URL: https://github.com/apache/spark/pull/27569
 
 
   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!
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to