Last active
February 9, 2022 13:55
-
-
Save cmpadden/3b60b604b2457ceeeed3024bfc2950c0 to your computer and use it in GitHub Desktop.
Apache Arrow Python Development Environment
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
| #!/usr/bin/env bash | |
| # Apache Arrow - Python Development Environment Configuration | |
| ################################################################################################################### | |
| # Environment Setup # | |
| ################################################################################################################### | |
| git clone https://github.com/apache/arrow.git | |
| pushd arrow | |
| git submodule init | |
| git submodule update | |
| export PARQUET_TEST_DATA="${PWD}/cpp/submodules/parquet-testing/data" | |
| export ARROW_TEST_DATA="${PWD}/testing/data" | |
| popd | |
| ################################################################################################################### | |
| # Using Pip # | |
| ################################################################################################################### | |
| brew update && brew bundle --file=arrow/cpp/Brewfile | |
| python3 -m venv venv | |
| source venv/bin/activate | |
| pip install \ | |
| -r arrow/python/requirements-build.txt \ | |
| -r arrow/python/requirements-test.txt | |
| export ARROW_HOME=$(pwd)/dist | |
| export LD_LIBRARY_PATH=$(pwd)/dist/lib | |
| mkdir dist | |
| ################################################################################################################### | |
| # Build and Test # | |
| ################################################################################################################### | |
| mkdir arrow/cpp/build | |
| # NOTE: `-DARROW_INSTALL_NAME_RPATH=OFF` was required for my system's configuration | |
| pushd arrow/cpp/build | |
| cmake -DCMAKE_INSTALL_PREFIX=$ARROW_HOME \ | |
| -DCMAKE_INSTALL_LIBDIR=lib \ | |
| -DCMAKE_BUILD_TYPE=debug \ | |
| -DARROW_WITH_BZ2=ON \ | |
| -DARROW_WITH_ZLIB=ON \ | |
| -DARROW_WITH_ZSTD=ON \ | |
| -DARROW_WITH_LZ4=ON \ | |
| -DARROW_WITH_SNAPPY=ON \ | |
| -DARROW_WITH_BROTLI=ON \ | |
| -DARROW_PARQUET=ON \ | |
| -DARROW_PYTHON=ON \ | |
| -DARROW_BUILD_TESTS=ON \ | |
| -DCMAKE_BUILD_TYPE=debug \ | |
| -DPython3_EXECUTABLE=$VIRTUAL_ENV/bin/python \ | |
| -DARROW_DEPENDENCY_SOURCE=AUTO \ | |
| -DCMAKE_INSTALL_LIBDIR=lib \ | |
| -DARROW_INSTALL_NAME_RPATH=OFF \ | |
| .. | |
| make -j4 | |
| make install | |
| popd | |
| pushd arrow/python | |
| export PYARROW_WITH_PARQUET=1 | |
| python setup.py build_ext --inplace | |
| popd | |
| ################################################################################################################### | |
| # Unit Testing # | |
| ################################################################################################################### | |
| python -m pytest arrow/python/pyarrow |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment