-
Notifications
You must be signed in to change notification settings - Fork 1
add polars support. #5
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
Open
aryehlev
wants to merge
20
commits into
main
Choose a base branch
from
polars
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
17b4080
add bindings and build.rs script.
aryehlev b632569
forgot to push cargo.toml
aryehlev 1c4842d
support thread safety for versions 1.4 and above.
aryehlev 5fabbdb
support thread safety for versions 1.4 and above.
aryehlev bb0d374
add checksum + avoid memory leak
aryehlev 9853ff3
update README.md
aryehlev 40ae111
avoid memory leak when error reading the model.
aryehlev b06cc1d
add ci to check builds.
aryehlev 7b262c0
fix type in ci.
aryehlev c790f02
dix advanced_usage.rs.
aryehlev 2f808fd
fix fmt and clippy
aryehlev e0b8bf7
Merge remote-tracking branch 'origin/main' into bindings
aryehlev 7e95cd7
change mac runner.
aryehlev 9391346
disable doc comments, for bindins.
aryehlev 17ae47f
disable doc comments, and support different name for old versions.
aryehlev 3d866bb
remove windows support for now.
aryehlev cdaa2dd
us cfg target_os target_arch for more clear code.
aryehlev b9609ba
add polars support.
aryehlev e3d7cac
fix fmt.
aryehlev a222d78
simpilfy polars.
aryehlev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
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 |
|---|---|---|
| @@ -0,0 +1,252 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Test ${{ matrix.os }} (${{ matrix.arch }}) - XGBoost ${{ matrix.xgboost_version }} | ||
| runs-on: ${{ matrix.runner }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| # macOS ARM64 (M1/M2/M3) - Test multiple versions | ||
| - os: macos | ||
| arch: arm64 | ||
| runner: macos-14 | ||
| xgboost_version: "3.1.1" | ||
| - os: macos | ||
| arch: arm64 | ||
| runner: macos-14 | ||
| xgboost_version: "3.0.5" | ||
| - os: macos | ||
| arch: arm64 | ||
| runner: macos-14 | ||
| xgboost_version: "2.1.4" | ||
|
|
||
| # macOS x86_64 (Intel) | ||
| - os: macos | ||
| arch: x86_64 | ||
| runner: macos-15-intel | ||
| xgboost_version: "3.1.1" | ||
|
|
||
| # Linux x86_64 - Test multiple versions including thread-safety boundary | ||
| - os: linux | ||
| arch: x86_64 | ||
| runner: ubuntu-latest | ||
| xgboost_version: "3.1.1" | ||
| - os: linux | ||
| arch: x86_64 | ||
| runner: ubuntu-latest | ||
| xgboost_version: "1.7.6" | ||
| - os: linux | ||
| arch: x86_64 | ||
| runner: ubuntu-latest | ||
| xgboost_version: "1.4.2" # First thread-safe version | ||
|
|
||
| # Linux ARM64 | ||
| - os: linux | ||
| arch: arm64 | ||
| runner: ubuntu-latest | ||
| xgboost_version: "3.1.1" | ||
|
|
||
| # Windows x86_64 - Disabled: Python wheels don't include import libraries (.lib) | ||
| # needed for MSVC linking. Enable when we add Windows-specific build support. | ||
| # - os: windows | ||
| # arch: x86_64 | ||
| # runner: windows-latest | ||
| # xgboost_version: "3.1.1" | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - name: Cache cargo registry | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cargo/registry | ||
| key: ${{ runner.os }}-${{ matrix.arch }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-${{ matrix.arch }}-cargo-registry- | ||
|
|
||
| - name: Cache cargo index | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cargo/git | ||
| key: ${{ runner.os }}-${{ matrix.arch }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-${{ matrix.arch }}-cargo-index- | ||
|
|
||
| - name: Cache cargo build | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: target | ||
| key: ${{ runner.os }}-${{ matrix.arch }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-${{ matrix.arch }}-cargo-build-target- | ||
|
|
||
| - name: Install system dependencies (Linux) | ||
| if: matrix.os == 'linux' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y libclang-dev | ||
|
|
||
| - name: Install system dependencies (macOS) | ||
| if: matrix.os == 'macos' | ||
| run: | | ||
| brew install libomp | ||
|
|
||
| - name: Check build (no features) | ||
| env: | ||
| XGBOOST_VERSION: ${{ matrix.xgboost_version }} | ||
| run: cargo check --verbose | ||
|
|
||
| - name: Build (no features) | ||
| env: | ||
| XGBOOST_VERSION: ${{ matrix.xgboost_version }} | ||
| run: cargo build --verbose | ||
|
|
||
| - name: Run tests (no features) | ||
| env: | ||
| XGBOOST_VERSION: ${{ matrix.xgboost_version }} | ||
| run: cargo test --verbose | ||
|
|
||
| - name: Build examples | ||
| env: | ||
| XGBOOST_VERSION: ${{ matrix.xgboost_version }} | ||
| run: | | ||
| cargo build --example basic_usage --verbose | ||
| cargo build --example advanced_usage --verbose | ||
|
|
||
| - name: Verify library architecture (macOS) | ||
| if: matrix.os == 'macos' | ||
| run: | | ||
| echo "Checking library architecture..." | ||
| file target/debug/libxgboost.dylib | ||
| lipo -info target/debug/libxgboost.dylib || otool -L target/debug/libxgboost.dylib | ||
|
|
||
| - name: Verify library architecture (Linux) | ||
| if: matrix.os == 'linux' | ||
| run: | | ||
| echo "Checking library architecture..." | ||
| file target/debug/libxgboost.so | ||
| readelf -h target/debug/libxgboost.so | grep Machine | ||
|
|
||
| - name: Verify library exists (Windows) | ||
| if: matrix.os == 'windows' | ||
| run: | | ||
| echo "Checking library exists..." | ||
| Get-Item target/debug/xgboost.dll | ||
|
|
||
| - name: Verify thread safety detection | ||
| env: | ||
| XGBOOST_VERSION: ${{ matrix.xgboost_version }} | ||
| run: | | ||
| echo "XGBoost version: ${{ matrix.xgboost_version }}" | ||
| cargo build --verbose 2>&1 | grep "thread-safe" || echo "No thread-safe message found" | ||
|
|
||
| clippy: | ||
| name: Clippy | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| components: clippy | ||
|
|
||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y libclang-dev | ||
|
|
||
| - name: Run clippy (no features) | ||
| run: cargo clippy -- -D warnings | ||
|
|
||
| fmt: | ||
| name: Format | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| components: rustfmt | ||
|
|
||
| - name: Check formatting | ||
| run: cargo fmt -- --check | ||
|
|
||
| # Test checksum verification | ||
| security-checksums: | ||
| name: Verify SHA256 checksums | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y libclang-dev | ||
|
|
||
| - name: Test checksum verification for XGBoost 3.1.1 | ||
| env: | ||
| XGBOOST_VERSION: "3.1.1" | ||
| run: | | ||
| cargo check --verbose 2>&1 | tee build.log | ||
| grep "✓ Verified SHA256" build.log | ||
| echo "Checksum verification working for 3.1.1" | ||
|
|
||
| - name: Test checksum verification for XGBoost 2.1.4 | ||
| env: | ||
| XGBOOST_VERSION: "2.1.4" | ||
| run: | | ||
| cargo clean | ||
| cargo check --verbose 2>&1 | tee build.log | ||
| grep "✓ Verified SHA256" build.log | ||
| echo "Checksum verification working for 2.1.4" | ||
|
|
||
| # Test caching behavior | ||
| caching-test: | ||
| name: Test wheel caching | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y libclang-dev | ||
|
|
||
| - name: First build (should download) | ||
| env: | ||
| XGBOOST_VERSION: "3.1.1" | ||
| run: | | ||
| cargo check --verbose 2>&1 | tee build1.log | ||
| grep "Downloading XGBoost wheel" build1.log || true | ||
|
|
||
| - name: Second build (should use cache) | ||
| env: | ||
| XGBOOST_VERSION: "3.1.1" | ||
| run: | | ||
| touch src/lib.rs | ||
| cargo check --verbose 2>&1 | tee build2.log | ||
| grep "Using cached XGBoost library" build2.log | ||
| echo "Caching is working correctly" |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify the Polars version for currency and security advisories.
Ensure that version 0.45 is current and has no known vulnerabilities.
🌐 Web query:
💡 Result:
Latest Polars (Rust) release: 0.52.0 (crate documentation / release metadata). [1]
Security advisories for 0.45:
Sources:
If you want, I can (a) confirm exactly which advisories affect your project by analyzing your Cargo.lock/Cargo.toml, or (b) fetch the latest crates.io release page and RustSec entries now.
I'll verify whether the transitive vulnerabilities actually affect this project's dependency tree.
[/run_scripts]
🏁 Script executed:
Length of output: 223
Upgrade Polars to version 0.52.0.
Version 0.45 is outdated; the latest Polars release is 0.52.0. Additionally, Polars v0.45 may pull transitive dependencies with known vulnerabilities, including fast-float (RUSTSEC-2024-0379) and array-init-cursor (RUSTSEC-2025-0019). Update
Cargo.tomlto useversion = "0.52.0"to address currency and reduce transitive security risk.🤖 Prompt for AI Agents