diff --git a/p/polars/LICENSE b/p/polars/LICENSE new file mode 100644 index 0000000000..8dada3edaf --- /dev/null +++ b/p/polars/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/p/polars/polars_py-1.38.1.patch b/p/polars/polars_py-1.38.1.patch new file mode 100644 index 0000000000..065521cff1 --- /dev/null +++ b/p/polars/polars_py-1.38.1.patch @@ -0,0 +1,239 @@ +diff --git a/requirements.txt b/requirements.txt +new file mode 100644 +index 0000000000..5ba6a8d3c2 +--- /dev/null ++++ b/requirements.txt +@@ -0,0 +1,233 @@ ++accessible-pygments==0.0.5 ++adbc-driver-manager==1.10.0 ++adbc-driver-sqlite==1.10.0 ++aiobotocore==3.3.0 ++aiohappyeyeballs==2.6.1 ++aiohttp==3.13.3 ++aioitertools==0.13.0 ++aiosignal==1.4.0 ++aiosqlite==0.22.1 ++alabaster==1.0.0 ++altair==6.0.0 ++annotated-types==0.7.0 ++apeye==1.4.1 ++apeye-core==1.1.5 ++arro3-core==0.8.0 ++attrs==25.4.0 ++autodocsumm==0.2.14 ++azure-core==1.39.0 ++azure-identity==1.25.3 ++babel==2.18.0 ++backrefs==5.9 ++beautifulsoup4==4.14.3 ++bleach==6.3.0 ++blinker==1.9.0 ++bokeh==3.9.0 ++boto3==1.42.70 ++boto3-stubs==1.42.71 ++botocore==1.42.70 ++botocore-stubs==1.42.41 ++build==1.4.0 ++CacheControl==0.14.4 ++cachetools==6.2.6 ++certifi==2026.2.25 ++cffi==2.0.0 ++charset-normalizer==3.4.6 ++click==8.3.1 ++cloudpickle==3.1.2 ++colorama==0.4.6 ++colorcet==3.1.0 ++commonmark==0.9.1 ++contourpy==1.3.3 ++coverage==7.13.5 ++cryptography==46.0.5 ++cssutils==2.11.1 ++cycler==0.12.1 ++deltalake==1.5.0 ++Deprecated==1.3.1 ++dict2css==0.3.0.post1 ++docutils==0.21.2 ++domdf_python_tools==3.10.0 ++duckdb==1.5.0 ++et_xmlfile==2.0.0 ++execnet==2.1.2 ++faicons==0.2.2 ++fastexcel==0.19.0 ++filelock==3.25.2 ++Flask==3.1.3 ++flask-cors==6.0.2 ++fonttools==4.62.1 ++frozenlist==1.8.0 ++fsspec==2026.2.0 ++gevent==25.9.1 ++ghp-import==2.1.0 ++google-auth==2.49.1 ++google-auth-stubs==0.3.0 ++graphviz==0.21 ++great-tables==0.21.0 ++greenlet==3.3.2 ++grpc-stubs==1.53.0.6 ++grpcio==1.78.0 ++hjson==3.1.0 ++holoviews==1.22.1 ++html5lib==1.1 ++htmltools==0.6.0 ++hvplot==0.12.2 ++hypothesis==6.151.9 ++idna==3.11 ++imagesize==2.0.0 ++importlib_metadata==8.7.1 ++importlib_resources==6.5.2 ++iniconfig==2.3.0 ++itsdangerous==2.2.0 ++jax==0.4.30 ++Jinja2==3.1.6 ++jmespath==1.1.0 ++jsonschema==4.26.0 ++jsonschema-specifications==2025.9.1 ++kiwisolver==1.5.0 ++linkify-it-py==2.1.0 ++livereload==2.7.0 ++Markdown==3.10.2 ++markdown-exec==1.10.0 ++markdown-it-py==4.0.0 ++MarkupSafe==3.0.3 ++material-plausible-plugin==0.3.0 ++matplotlib==3.10.8 ++maturin==1.12.6 ++mdit-py-plugins==0.5.0 ++mdurl==0.1.2 ++mergedeep==1.3.4 ++mizani==0.14.4 ++mkdocs==1.6.1 ++mkdocs-get-deps==0.2.2 ++mkdocs-macros-plugin==1.3.7 ++mkdocs-material==9.6.20 ++mkdocs-material-extensions==1.3.1 ++mkdocs-redirects==1.2.1 ++ml_dtypes==0.5.4 ++mmh3==5.2.1 ++more-itertools==10.8.0 ++moto==5.0.9 ++mpmath==1.3.0 ++msal==1.35.1 ++msal-extensions==1.3.1 ++msgpack==1.1.2 ++multidict==6.7.1 ++mypy==1.14.1 ++mypy_extensions==1.1.0 ++narwhals==2.18.0 ++natsort==8.4.0 ++networkx==3.6.1 ++numba==0.64.0 ++numpy==2.4.3 ++numpydoc==1.8.0 ++openpyxl==3.1.5 ++opt_einsum==3.4.0 ++orjson==3.11.7 ++packaging==26.0 ++paginate==0.5.7 ++pandas==3.0.1 ++pandas-stubs==3.0.0.260204 ++panel==1.8.10 ++param==2.3.2 ++patchelf==0.17.2.4 ++pathspec==1.0.4 ++patsy==1.0.2 ++pillow==12.1.1 ++platformdirs==4.9.4 ++plotly==6.6.0 ++plotnine==0.15.3 ++pluggy==1.6.0 ++propcache==0.4.1 ++py-partiql-parser==0.5.5 ++pyarrow==23.0.1 ++pyasn1==0.6.3 ++pyasn1_modules==0.4.2 ++pycparser==3.0 ++pydantic==2.12.5 ++pydantic_core==2.41.5 ++pydata-sphinx-theme==0.16.0 ++PyGithub==2.6.1 ++Pygments==2.19.2 ++pygments-ansi-color==0.3.0 ++pyiceberg==0.11.1 ++pyiceberg-core==0.8.0 ++PyJWT==2.12.1 ++pymdown-extensions==10.21 ++PyNaCl==1.6.2 ++pyparsing==3.3.2 ++pyproject_hooks==1.2.0 ++pyroaring==1.0.3 ++pytest==8.3.2 ++pytest-codspeed==3.2.0 ++pytest-cov==6.0.0 ++pytest-xdist==3.6.1 ++python-dateutil==2.9.0.post0 ++pytz==2026.1.post1 ++pyviz_comms==3.0.6 ++PyYAML==6.0.3 ++pyyaml_env_tag==1.1 ++referencing==0.37.0 ++requests==2.32.5 ++responses==0.26.0 ++rich==14.3.3 ++rpds-py==0.30.0 ++ruamel.yaml==0.19.1 ++ruff==0.14.3 ++s3fs==2026.2.0 ++s3transfer==0.16.0 ++scipy==1.17.1 ++seaborn==0.13.2 ++six==1.17.0 ++snowballstemmer==3.0.1 ++sortedcontainers==2.4.0 ++soupsieve==2.8.3 ++Sphinx==8.1.3 ++sphinx-autodoc-typehints==3.0.1 ++sphinx-autosummary-accessors==2023.4.0 ++sphinx-copybutton==0.5.2 ++sphinx-favicon==1.0.1 ++sphinx-jinja2-compat==0.4.1 ++sphinx-prompt==1.10.2 ++sphinx-tabs==3.4.5 ++sphinx-toolbox==3.8.1 ++sphinx_design==0.6.1 ++sphinx_reredirects==0.1.5 ++sphinxcontrib-applehelp==2.0.0 ++sphinxcontrib-devhelp==2.0.0 ++sphinxcontrib-htmlhelp==2.1.0 ++sphinxcontrib-jsmath==1.0.1 ++sphinxcontrib-qthelp==2.0.0 ++sphinxcontrib-serializinghtml==2.0.0 ++SQLAlchemy==2.0.48 ++statsmodels==0.14.6 ++strictyaml==1.7.3 ++super_collections==0.6.2 ++sympy==1.14.0 ++tabulate==0.10.0 ++tenacity==9.1.4 ++termcolor==3.3.0 ++tornado==6.5.5 ++tqdm==4.67.3 ++types-awscrt==0.31.3 ++types-requests==2.32.4.20260107 ++types-s3transfer==0.16.0 ++typing-inspection==0.4.2 ++typing_extensions==4.15.0 ++uc-micro-py==2.0.0 ++urllib3==2.6.3 ++uv==0.10.11 ++watchdog==6.0.0 ++webencodings==0.5.1 ++Werkzeug==3.1.6 ++wrapt==2.1.2 ++xlsx2csv==0.8.6 ++xlsxwriter==3.2.9 ++xmltodict==1.0.4 ++xyzservices==2025.11.0 ++yarl==1.23.0 ++zipp==3.23.0 ++zope.event==6.1 ++zope.interface==8.2 ++zstandard==0.25.0 diff --git a/p/polars/polars_py-1.38.1_boringssl.patch b/p/polars/polars_py-1.38.1_boringssl.patch new file mode 100644 index 0000000000..435f6cd30b --- /dev/null +++ b/p/polars/polars_py-1.38.1_boringssl.patch @@ -0,0 +1,14 @@ +diff --git a/src/include/openssl/base.h b/src/include/openssl/base.h +index 190e250ff..523dbfa23 100644 +--- a/src/include/openssl/base.h ++++ b/src/include/openssl/base.h +@@ -121,7 +121,8 @@ extern "C" { + // little-endian architectures. Functions will not produce the correct answer + // on other systems. Run the crypto_test binary, notably + // crypto/compiler_test.cc, before adding a new architecture. +-#error "Unknown target CPU" ++#define OPENSSL_64_BIT ++#define OPENSSL_PPC + #endif + + #if defined(__APPLE__) diff --git a/p/polars/polars_py-1.38.1_ubi9.7.sh b/p/polars/polars_py-1.38.1_ubi9.7.sh new file mode 100755 index 0000000000..bd9ed17529 --- /dev/null +++ b/p/polars/polars_py-1.38.1_ubi9.7.sh @@ -0,0 +1,358 @@ +#!/bin/bash -ex +# ---------------------------------------------------------------------------- +# Package : polars +# Version : py-1.38.1 +# Source repo : https://github.com/pola-rs/polars +# Tested on : UBI 9.7 +# Language : Python +# Ci-Check : true +# Maintainer : Sumit Dubey +# Script License : Apache License, Version 2.0 or later +# +# Disclaimer : This script has been tested in root mode on the specified +# platform and package version. Functionality with newer +# versions of the package or OS is not guaranteed. +# ---------------------------------------------------------------------------- + +# --------------------------- +# Configuration +# --------------------------- +PACKAGE_NAME="polars" +PACKAGE_ORG="pola-rs" +SCRIPT_PACKAGE_VERSION=py-1.38.1 +PACKAGE_VERSION=${1:-${SCRIPT_PACKAGE_VERSION}} +PACKAGE_URL="https://github.com/${PACKAGE_ORG}/${PACKAGE_NAME}.git" +SCRIPT_PATH=$(dirname $(realpath $0)) +RUNTESTS=1 +BUILD_HOME="$(pwd)" +PYTHON_VERSION=3.11.14 +PYTHON_VERSION_WO_DOTS=${PYTHON_VERSION//./} +BAZEL_VERSION=6.5.0 + +# ------------------- +# Parse CLI Arguments +# ------------------- +for i in "$@"; do + case $i in + --skip-tests) + RUNTESTS=0 + echo "Skipping tests" + shift + ;; + -*|--*) + echo "Unknown option $i" + exit 3 + ;; + *) + PACKAGE_VERSION=$i + echo "Building ${PACKAGE_NAME} ${PACKAGE_VERSION}" + ;; + esac +done + +# ---------------------- +# Install required repos +# ---------------------- +echo "Configuring package repositories..." +yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm +ret=0 +dnf config-manager --set-enabled codeready-builder-for-rhel-9-$(arch)-rpms || ret=$? +if [ $ret -ne 0 ]; then + yum config-manager --add-repo https://mirror.stream.centos.org/9-stream/CRB/ppc64le/os + yum config-manager --add-repo https://mirror.stream.centos.org/9-stream/AppStream//ppc64le/os + yum config-manager --add-repo https://mirror.stream.centos.org/9-stream/BaseOS/ppc64le/os + rpm --import https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official-SHA256 +fi + +# --------------------------- +# Dependency Installation +# --------------------------- +echo "Installing required packages..." +yum install -y git wget gcc gcc-c++ perl-IPC-Cmd perl-FindBin perl-File-Compare krb5-devel perl-File-Copy patchelf cmake ninja-build libzstd-devel libedit-devel zlib-devel re2-devel libcurl-devel libjpeg-turbo-devel gfortran openblas-devel openssl-devel protobuf-devel protobuf-compiler libffi-devel expat-devel bzip2-devel xz-devel readline-devel ncurses-devel gdbm-devel libuuid-devel graphviz java-11-openjdk-devel zip unzip + +# -------------------------------------- +# Install sqlite 3.51.3 from source +# -------------------------------------- +cd "${BUILD_HOME}" +if [ -z "$(ls -A $BUILD_HOME/sqlite-autoconf-3510300)" ]; then + wget https://sqlite.org/2026/sqlite-autoconf-3510300.tar.gz + tar -xzf sqlite-autoconf-3510300.tar.gz + rm -rf sqlite-autoconf-3510300.tar.gz + cd sqlite-autoconf-3510300 + ./configure --prefix=/usr/ + make -j$(nproc) +else + cd sqlite-autoconf-3510300 +fi +make install +export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH + +# ------------------------------------ +# Build Python from source and install +# ------------------------------------ +cd "${BUILD_HOME}" +if [ -z "$(ls -A $BUILD_HOME/Python-${PYTHON_VERSION})" ]; then + wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz + tar -xzf Python-${PYTHON_VERSION}.tgz + rm -rf Python-${PYTHON_VERSION}.tgz + cd Python-${PYTHON_VERSION} + ./configure --prefix=/usr/ --with-system-expat -with-system-ffi +else + cd Python-${PYTHON_VERSION} +fi +make altinstall -j$(nproc) +python3.11 -V +pip3.11 -V +rm -rf /usr/bin/python3 /usr/bin/python /usr/bin/pip3 /usr/bin/pip +ln -s /usr/bin/python${PYTHON_VERSION:0:4} /usr/bin/python3 +ln -s /usr/bin/pip${PYTHON_VERSION:0:4} /usr/bin/pip3 +ln -s /usr/bin/python${PYTHON_VERSION:0:4} /usr/bin/python +ln -s /usr/bin/pip${PYTHON_VERSION:0:4} /usr/bin/pip +pip install numpy wheel build maturin pytest "setuptools<71" + +# --------------------------- +# Install Rust +# --------------------------- +curl https://sh.rustup.rs -sSf | sh -s -- -y +source "$HOME/.cargo/env" +rustup toolchain install 1.93.0 +rustup default 1.93.0-powerpc64le-unknown-linux-gnu + +# --------------------------- +# Clone and Prepare Repository +# --------------------------- +cd "${BUILD_HOME}" +if [ -z "$(ls -A $BUILD_HOME/${PACKAGE_NAME})" ]; then + git clone "${PACKAGE_URL}" + cd "${PACKAGE_NAME}" + git checkout "${PACKAGE_VERSION}" + git apply ${SCRIPT_PATH}/${PACKAGE_NAME}_${SCRIPT_PACKAGE_VERSION}.patch +else + cd "${PACKAGE_NAME}" +fi + +# --------------------------- +# Build +# --------------------------- +ret=0 +maturin build -m py-polars/runtime/polars-runtime-32/Cargo.toml --profile dist-release || ret=$? +if [ $ret -ne 0 ]; then + set +ex + echo "------------------ ${PACKAGE_NAME}: Build Failed ------------------" + exit 1 +fi +export POLARS_WHEEL=${BUILD_HOME}/${PACKAGE_NAME}/target/wheels/polars_runtime_32-${PACKAGE_VERSION:3}-cp310-abi3-manylinux_2_34_ppc64le.whl +cd py-polars +python -m build --wheel || ret=$? +if [ $ret -ne 0 ]; then + set +ex + echo "------------------ ${PACKAGE_NAME}: Build Failed ------------------" + exit 1 +fi +export PYPOLARS_WHEEL=${BUILD_HOME}/${PACKAGE_NAME}/py-polars/dist/polars-${PACKAGE_VERSION:3}-py3-none-any.whl +cp "$POLARS_WHEEL" "$BUILD_HOME/" # Copy wheel for wrapper detection + +# --------------------------- +# Skip Tests? +# --------------------------- +if [ "$RUNTESTS" -eq 0 ]; then + set +ex + echo "Complete: Build successful! Polars wheel available at [${POLARS_WHEEL}]" + exit 0 +fi + +# -------------------------------------- +# Install clang llvm lld 20 from source +# -------------------------------------- +cd "${BUILD_HOME}" +if [ -z "$(ls -A $BUILD_HOME/llvm-project)" ]; then + git clone https://github.com/llvm/llvm-project.git + cd llvm-project + git checkout llvmorg-20.1.8 + mkdir build + cd build + cmake -G Ninja ../llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;llvm;lld" + ninja -j$(nproc) +else + cd llvm-project/build +fi +ninja install + +# --------------------------- +# Build connectorx 0.4.5 +# --------------------------- +cd "${BUILD_HOME}" +if [ -z "$(ls -A $BUILD_HOME/connector-x)" ]; then + git clone https://github.com/sfu-db/connector-x.git + cd connector-x + git checkout v0.4.5 + cd connectorx-python + maturin build --release +fi +export CONNECTORX_WHEEL=${BUILD_HOME}/connector-x/connectorx-python/target/wheels/connectorx-0.4.5-cp${PYTHON_VERSION_WO_DOTS:0:3}-cp${PYTHON_VERSION_WO_DOTS:0:3}-manylinux_2_34_ppc64le.whl + +# --------------------------- +# Build llvmlite 0.46.0 +# --------------------------- +cd "${BUILD_HOME}" +if [ -z "$(ls -A $BUILD_HOME/llvmlite)" ]; then + git clone https://github.com/numba/llvmlite.git + cd llvmlite + git checkout v0.46.0 + python setup.py bdist_wheel +fi +export LLVMLITE_WHEEL=${BUILD_HOME}/llvmlite/dist/llvmlite-0.46.0-cp${PYTHON_VERSION_WO_DOTS:0:3}-cp${PYTHON_VERSION_WO_DOTS:0:3}-linux_ppc64le.whl + + +# --------------------------- +# Build polars-cloud 0.5.0 +# --------------------------- +cd "${BUILD_HOME}" +if [ -z "$(ls -A $BUILD_HOME/polars-cloud-client)" ]; then + git clone https://github.com/pola-rs/polars-cloud-client.git + cd polars-cloud-client/client + git checkout client-0.5.0 + maturin build --release +fi +export POLARSCLOUD_WHEEL=${BUILD_HOME}/polars-cloud-client/client/target/wheels/polars_cloud-0.5.0-cp310-abi3-manylinux_2_34_ppc64le.whl + +# --------------------------- +# Build polars-ds 0.11.0 +# --------------------------- +cd "${BUILD_HOME}" +if [ -z "$(ls -A $BUILD_HOME/polars_ds_extension)" ]; then + git clone https://github.com/abstractqqq/polars_ds_extension.git + cd polars_ds_extension + git checkout v0.11.0 + maturin build --release +fi +export POLARSDS_WHEEL=${BUILD_HOME}/polars_ds_extension/target/wheels/polars_ds-0.11.0-cp39-abi3-manylinux_2_34_ppc64le.whl + +# ------------------------------------ +# Build arrow-adbc sqlite driver .so +# ------------------------------------ +cd "${BUILD_HOME}" +if [ -z "$(ls -A $BUILD_HOME/arrow-adbc)" ]; then + git clone https://github.com/apache/arrow-adbc + cd arrow-adbc + git checkout apache-arrow-adbc-22 + mkdir build + cd build + cmake ../c -DADBC_DRIVER_SQLITE=ON + make -j$(nproc) +fi +export ADBC_SQLITE_LIBRARY=${BUILD_HOME}/arrow-adbc/build/driver/sqlite/libadbc_driver_sqlite.so + +# ----------------------- +# Build Apache arrow .so +# ----------------------- +cd "${BUILD_HOME}" +if [ -z "$(ls -A $BUILD_HOME/arrow)" ]; then + git clone https://github.com/apache/arrow.git + cd arrow/cpp + git checkout apache-arrow-23.0.1 + mkdir build + cd build + cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DARROW_S3=ON \ + -DARROW_ACERO=ON \ + -DARROW_CSV=ON \ + -DARROW_JSON=ON \ + -DARROW_DATASET=ON \ + -DARROW_PARQUET=ON \ + -DARROW_FILESYSTEM=ON \ + -DARROW_WITH_SNAPPY=ON \ + -DARROW_WITH_ZSTD=ON \ + -DARROW_WITH_LZ4=ON \ + -DARROW_WITH_BROTLI=ON + make -j$(nproc) +else + cd arrow/cpp/build +fi +make install + +# --------------------------- +# Build pytorch wheel +# --------------------------- +cd $BUILD_HOME +PYTORCH_VERSION=2.10.0 +PYTORCH_VERSION_CPU="${PYTORCH_VERSION}+cpu" +export PYTORCH_BUILD_VERSION=${PYTORCH_VERSION_CPU} +if [ -z "$(ls -A $BUILD_HOME/pytorch)" ]; then + git clone https://github.com/pytorch/pytorch + cd pytorch + git checkout v$PYTORCH_VERSION + pip install -r requirements.txt + git submodule sync + git submodule update --init --recursive + export PYTORCH_BUILD_NUMBER=1 +# sed -i "196d" third_party/gloo/gloo/common/linux.cc +# sed -i "197i \ \ \ \ struct ethtool_link_settings req;" third_party/gloo/gloo/common/linux.cc +# sed -i "s#descr->elsize#PyDataType_ELSIZE(descr)#g" torch/csrc/utils/tensor_numpy.cpp + python setup.py bdist_wheel +fi +export PYTORCH_WHEEL=$BUILD_HOME/pytorch/dist/torch-$PYTORCH_BUILD_VERSION-cp${PYTHON_VERSION_WO_DOTS:0:3}-cp${PYTHON_VERSION_WO_DOTS:0:3}-linux_$(arch).whl + + +# --------------------------- +# Build bazel and install +# --------------------------- +export JAVA_HOME=$(compgen -G '/usr/lib/jvm/java-11-openjdk-*') +export JRE_HOME=${JAVA_HOME}/jre +export PATH=${JAVA_HOME}/bin:$PATH +cd $BUILD_HOME +if [ -z "$(ls -A $BUILD_HOME/bazel)" ]; then + mkdir bazel + cd bazel + wget https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-dist.zip + unzip bazel-${BAZEL_VERSION}-dist.zip + rm -rf bazel-${BAZEL_VERSION}-dist.zip + env EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk" bash ./compile.sh +fi +cp $BUILD_HOME/bazel/output/bazel /usr/bin/ + +# --------------------------- +# Build jaxlib wheel +# --------------------------- +cd $BUILD_HOME +if [ -z "$(ls -A $BUILD_HOME/jax)" ]; then + git clone https://github.com/jax-ml/jax.git + cd jax + git checkout jaxlib-v0.4.28 + git clone https://github.com/google/boringssl.git + cd boringssl + git checkout c00d7ca810e93780bd0c8ee4eea28f4f2ea4bcdc + git apply ${SCRIPT_PATH}/${PACKAGE_NAME}_${SCRIPT_PACKAGE_VERSION}_boringssl.patch + cd .. + build/build.py --noenable_cuda --noenable_mosaic_gpu --nobuild_gpu_plugin --bazel_options=--override_repository=boringssl=${BUILD_HOME}/jax/boringssl +fi +export JAXLIB_WHEEL=$BUILD_HOME/jax/dist/jaxlib-0.4.28*.whl + +# --------------------------- +# Test +# --------------------------- +cd ${BUILD_HOME}/${PACKAGE_NAME} +ret=0 +export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 +export PYARROW_WITH_S3=1 +export ArrowDataset_DIR=/usr/lib64/cmake/arrow/ +export Parquet_DIR=/usr/lib64/cmake/arrow/ +pip install --upgrade uv +uv pip install $CONNECTORX_WHEEL $LLVMLITE_WHEEL $PYTORCH_WHEEL $JAXLIB_WHEEL jax setuptools wheel maturin --system +uv pip install --no-deps $POLARSCLOUD_WHEEL $POLARSDS_WHEEL --system +uv pip install --no-deps --compile-bytecode -r requirements.txt --system +uv pip install --upgrade --compile-bytecode "pyiceberg>=0.7.1" pyiceberg-core --system +uv pip install $POLARS_WHEEL $PYPOLARS_WHEEL --system +cd py-polars +POLARS_TIMEOUT_MS=200000 pytest -n auto -m "slow or not slow" || ret=$? +if [ $ret -ne 0 ]; then + set +ex + echo "------------------ ${PACKAGE_NAME}: Test Failed ------------------" + exit 2 +fi + +set +ex +echo "Complete: Build and Test successful! polars_runtime_32 wheel available at [$POLARS_WHEEL]. polars wheel available at [$PYPOLARS_WHEEL]." +