Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 4.3k
ARROW-17891: [Docs][Python] Update and sync Win section of the developers/python page#14350
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
986a3bd
Use Python 3.10 in the instructions
AlenkaF d0d1dd0
Remove subsection for Python integration tests - no longer needed as …
AlenkaF 952d3ab
Change INSTALL to install
AlenkaF a056680
Remove setting of PATH - not searched by Python anymore
AlenkaF 0376c7e
Use CONDA_PREFIX
AlenkaF 58ef6f1
Update note about PATH
AlenkaF f4c4cf0
Add info about CONDA_PREFIX
AlenkaF 55cfea7
Change to use Ninja
AlenkaF f76b6cd
Add back the info about Arrow C++ not being bundled for ease of devel…
AlenkaF b8cc22d
Use ARROW_HOME=%CONDA_PREFIX%\Library in the instructions
AlenkaF File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -213,7 +213,7 @@ dependencies for Arrow C++ and PyArrow as pre-built binaries, which can make | ||
| Arrow development easier and faster. | ||
| Let's create a conda environment with all the C++ build and Python dependencies | ||
| from conda-forge, targeting development for Python 3.9: | ||
| from conda-forge, targeting development for Python 3.10: | ||
| On Linux and macOS: | ||
| @@ -225,7 +225,7 @@ On Linux and macOS: | ||
| --file arrow/ci/conda_env_python.txt \ | ||
| --file arrow/ci/conda_env_gandiva.txt \ | ||
| compilers \ | ||
| python=3.9 \ | ||
| python=3.10 \ | ||
| pandas | ||
| As of January 2019, the ``compilers`` package is needed on many Linux | ||
| @@ -509,31 +509,28 @@ First, starting from a fresh clone of Apache Arrow: | ||
| --file arrow\ci\conda_env_cpp.txt ^ | ||
| --file arrow\ci\conda_env_python.txt ^ | ||
| --file arrow\ci\conda_env_gandiva.txt ^ | ||
| python=3.9 | ||
| python=3.10 | ||
| $ conda activate pyarrow-dev | ||
| Now, we build and install Arrow C++ libraries. | ||
| We set a number of environment variables: | ||
| - the path of the installation directory of the Arrow C++ libraries as | ||
| ``ARROW_HOME`` | ||
| - add the path of installed DLL libraries to ``PATH`` | ||
| - and the CMake generator to be used as ``PYARROW_CMAKE_GENERATOR`` | ||
| We set the path of the installation directory of the Arrow C++ libraries as | ||
| ``ARROW_HOME``. When using a conda environment, Arrow C++ is installed | ||
| in the environment directory, which path is saved in the | ||
| `CONDA_PREFIX <https://docs.conda.io/projects/conda-build/en/latest/user-guide/environment-variables.html#environment-variables-that-affect-the-build-process>`_ | ||
| environment variable. | ||
| .. code-block:: | ||
| $ set ARROW_HOME=%cd%\arrow-dist | ||
| $ set PATH=%ARROW_HOME%\bin;%PATH% | ||
| $ set PYARROW_CMAKE_GENERATOR=Visual Studio 15 2017 Win64 | ||
| $ set ARROW_HOME=%CONDA_PREFIX%\Library | ||
| Let's configure, build and install the Arrow C++ libraries: | ||
| .. code-block:: | ||
| $ mkdir arrow\cpp\build | ||
| $ pushd arrow\cpp\build | ||
| $ cmake -G "%PYARROW_CMAKE_GENERATOR%" ^ | ||
| $ cmake -G "Ninja" ^ | ||
| -DCMAKE_INSTALL_PREFIX=%ARROW_HOME% ^ | ||
| -DCMAKE_UNITY_BUILD=ON ^ | ||
| -DARROW_COMPUTE=ON ^ | ||
| @@ -549,7 +546,7 @@ Let's configure, build and install the Arrow C++ libraries: | ||
| -DARROW_WITH_ZLIB=ON ^ | ||
| -DARROW_WITH_ZSTD=ON ^ | ||
| .. | ||
| $ cmake --build . --target INSTALL --config Release | ||
| $ cmake --build . --target install --config Release | ||
| $ popd | ||
| Now, we can build pyarrow: | ||
| @@ -580,10 +577,6 @@ Then run the unit tests with: | ||
| the Python extension. This is recommended for development as it allows the | ||
| C++ libraries to be re-built separately. | ||
AlenkaF marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| As a consequence however, ``python setup.py install`` will also not install | ||
| the Arrow C++ libraries. Therefore, to use ``pyarrow`` in python, ``PATH`` | ||
| must contain the directory with the Arrow .dll-files. | ||
| If you want to bundle the Arrow C++ libraries with ``pyarrow``, add | ||
| the ``--bundle-arrow-cpp`` option when building: | ||
| @@ -594,56 +587,10 @@ Then run the unit tests with: | ||
| Important: If you combine ``--bundle-arrow-cpp`` with ``--inplace`` the | ||
| Arrow C++ libraries get copied to the source tree and are not cleared | ||
| by ``python setup.py clean``. They remain in place and will take precedence | ||
| over any later Arrow C++ libraries contained in ``PATH``. This can lead to | ||
| over any later Arrow C++ libraries contained in ``CONDA_PREFIX``. This can lead to | ||
| incompatibilities when ``pyarrow`` is later built without | ||
| ``--bundle-arrow-cpp``. | ||
| Running C++ unit tests for Python integration | ||
| --------------------------------------------- | ||
| Running C++ unit tests should not be necessary for most developers. If you do | ||
| want to run them, you need to pass ``-DARROW_BUILD_TESTS=ON`` during | ||
| configuration of the Arrow C++ library build: | ||
| .. code-block:: | ||
| $ mkdir arrow\cpp\build | ||
| $ pushd arrow\cpp\build | ||
| $ cmake -G "%PYARROW_CMAKE_GENERATOR%" ^ | ||
| -DCMAKE_INSTALL_PREFIX=%ARROW_HOME% ^ | ||
| -DARROW_BUILD_TESTS=ON ^ | ||
| -DARROW_COMPUTE=ON ^ | ||
| -DARROW_CSV=ON ^ | ||
| -DARROW_CXXFLAGS="/WX /MP" ^ | ||
| -DARROW_DATASET=ON ^ | ||
| -DARROW_FILESYSTEM=ON ^ | ||
| -DARROW_HDFS=ON ^ | ||
| -DARROW_JSON=ON ^ | ||
| -DARROW_PARQUET=ON ^ | ||
| .. | ||
| $ cmake --build . --target INSTALL --config Release | ||
| $ popd | ||
| Getting ``arrow-python-test.exe`` (C++ unit tests for python integration) to | ||
| run is a bit tricky because your ``%PYTHONHOME%`` must be configured to point | ||
| to the active conda environment: | ||
| .. code-block:: | ||
| $ set PYTHONHOME=%CONDA_PREFIX% | ||
| $ pushd arrow\cpp\build\release\Release | ||
| $ arrow-python-test.exe | ||
| $ popd | ||
| To run all tests of the Arrow C++ library, you can also run ``ctest``: | ||
| .. code-block:: | ||
| $ set PYTHONHOME=%CONDA_PREFIX% | ||
| $ pushd arrow\cpp\build | ||
| $ ctest | ||
| $ popd | ||
| Caveats | ||
| ------- | ||
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.
Uh oh!
There was an error while loading. Please reload this page.