diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml new file mode 100644 index 0000000..c180ce7 --- /dev/null +++ b/.github/workflows/wheels.yml @@ -0,0 +1,201 @@ +name: Build Wheels + +on: + push: + tags: + - "py-v*" + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + linux: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: ubuntu-latest + target: x86_64 + manylinux: "2_28" + - runner: ubuntu-latest + target: aarch64 + manylinux: "2_28" + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + + - name: Install Python + run: uv python install 3.13 + + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist -i 3.13 --manifest-path python/Cargo.toml + sccache: "true" + manylinux: ${{ matrix.platform.manylinux }} + + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-linux-${{ matrix.platform.target }} + path: dist + + musllinux: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: ubuntu-latest + target: x86_64 + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + + - name: Install Python + run: uv python install 3.13 + + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist -i 3.13 --manifest-path python/Cargo.toml + sccache: "true" + manylinux: musllinux_1_2 + + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-musllinux-${{ matrix.platform.target }} + path: dist + + windows: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: windows-latest + target: x64 + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + architecture: ${{ matrix.platform.target }} + + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist -i 3.13 --manifest-path python/Cargo.toml + sccache: "true" + + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-windows-${{ matrix.platform.target }} + path: dist + + macos: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: macos-15-intel + target: x86_64 + - runner: macos-15 + target: aarch64 + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + + - name: Install Python + run: uv python install 3.13 + + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist -i 3.13 --manifest-path python/Cargo.toml + sccache: "true" + + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-macos-${{ matrix.platform.target }} + path: dist + + sdist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + uses: PyO3/maturin-action@v1 + with: + command: sdist + args: --out dist --manifest-path python/Cargo.toml + + - name: Upload sdist + uses: actions/upload-artifact@v4 + with: + name: wheels-sdist + path: dist + + build: + name: Build dist + runs-on: ubuntu-latest + needs: [linux, musllinux, windows, macos, sdist] + steps: + - uses: actions/download-artifact@v8 + with: + pattern: wheels-* + merge-multiple: true + path: dist + + - uses: actions/upload-artifact@v4 + with: + name: artifact + path: dist + + upload_pypi: + name: Upload release to PyPI + needs: [build] + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + environment: + # Note: this environment must be configured in the repo settings + name: pypi-release + url: https://pypi.org/p/zarr-datafusion-search + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - uses: actions/download-artifact@v8 + with: + name: artifact + path: dist + merge-multiple: true + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + # Optional: test upload to Test PyPI instead of production PyPI + # with: + # repository-url: https://test.pypi.org/legacy/ diff --git a/python/Cargo.lock b/python/Cargo.lock index 6ab2012..aa0c593 100644 --- a/python/Cargo.lock +++ b/python/Cargo.lock @@ -2658,6 +2658,29 @@ dependencies = [ "spade", ] +[[package]] +name = "geo-index" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e6b2a121e60180a118037426b1e93d7f5904ebd95cf6e841a575195a65a31ce" +dependencies = [ + "bytemuck", + "float_next_after", + "geo-traits 0.2.0", + "num-traits", + "thiserror 1.0.69", + "tinyvec", +] + +[[package]] +name = "geo-traits" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b018fc19fa58202b03f1c809aebe654f7d70fd3887dace34c3d05c11aeb474b5" +dependencies = [ + "geo-types", +] + [[package]] name = "geo-traits" version = "0.3.0" @@ -2689,7 +2712,7 @@ dependencies = [ "arrow-array", "arrow-buffer", "arrow-schema", - "geo-traits", + "geo-traits 0.3.0", "geoarrow-schema", "num-traits", "wkb", @@ -2705,7 +2728,7 @@ dependencies = [ "arrow-array", "arrow-buffer", "geo", - "geo-traits", + "geo-traits 0.3.0", "geoarrow-array", "geoarrow-schema", ] @@ -2717,7 +2740,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e97be4e9f523f92bd6a0e0458323f4b783d073d011664decd8dbf05651704f34" dependencies = [ "arrow-schema", - "geo-traits", + "geo-traits 0.3.0", "serde", "serde_json", "thiserror 1.0.69", @@ -2734,7 +2757,7 @@ dependencies = [ "arrow-schema", "datafusion", "geo", - "geo-traits", + "geo-traits 0.3.0", "geoarrow-array", "geoarrow-expr-geo", "geoarrow-schema", @@ -6489,7 +6512,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a120b336c7ad17749026d50427c23d838ecb50cd64aaea6254b5030152f890a9" dependencies = [ "byteorder", - "geo-traits", + "geo-traits 0.3.0", "num_enum", "thiserror 1.0.69", ] @@ -6500,7 +6523,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efb2b923ccc882312e559ffaa832a055ba9d1ac0cc8e86b3e25453247e4b81d7" dependencies = [ - "geo-traits", + "geo-traits 0.3.0", "geo-types", "log", "num-traits", @@ -6552,12 +6575,15 @@ dependencies = [ "async-trait", "datafusion", "futures", + "geo-index", + "geo-traits 0.3.0", "geoarrow-schema", "geodatafusion", "icechunk", "object_store 0.12.5", "thiserror 2.0.18", "tokio", + "wkt", "zarrs", "zarrs_filesystem", "zarrs_icechunk",