Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 16 additions & 35 deletions .github/workflows/build-anycrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ jobs:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
name: Build anycrc ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
Expand All @@ -66,39 +64,22 @@ jobs:
- tag: cp314t
build: cp314t-manylinux_riscv64

env:
ANYCRC_VERSION: ${{ matrix.version }}

steps:
- name: Checkout anycrc ${{ env.ANYCRC_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: marzooqy/anycrc
ref: ${{ env.ANYCRC_VERSION }}
submodules: recursive
persist-credentials: false

- name: Write a cibuildwheel config without upstream's `skip`
# Upstream's only [tool.cibuildwheel] setting is `skip = ["cp31[!01]-*"]`,
# which would drop cp312/cp313/cp314 from the abi3 build/test matrix below.
run: printf '[tool.cibuildwheel]\n' > "$RUNNER_TEMP/cibuildwheel.toml"

- uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
config-file: ${{ runner.temp }}/cibuildwheel.toml
env:
CIBW_ARCHS: riscv64
CIBW_BUILD: ${{ matrix.build }}
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
CIBW_TEST_COMMAND: >-
python -c "import anycrc.crc as m; assert m.__file__.endswith('.so'), m.__file__"
&& python {project}/test.py

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: anycrc-${{ env.ANYCRC_VERSION }}-${{ matrix.tag }}-manylinux_riscv64
path: ./wheelhouse/*.whl
if-no-files-found: error
# Upstream's only [tool.cibuildwheel] setting is `skip = ["cp31[!01]-*"]`,
# which would drop cp312/cp313/cp314 from the abi3 build/test matrix below.
uses: $/.github/workflows/_build-cibuildwheel.yml
with:
package: "anycrc"
version: "${{ matrix.version }}"
repository: "marzooqy/anycrc"
ref: "${{ matrix.version }}"
artifact-tag: "${{ matrix.tag }}-manylinux_riscv64"
checkout-submodules: "recursive"
pre-build: "printf '[tool.cibuildwheel]\\n' > cibuildwheel.toml"
cibw-config-file: "cibuildwheel.toml"
cibw-build: "${{ matrix.build }}"
cibw-test-command: >
python -c "import anycrc.crc as m; assert m.__file__.endswith('.so'), m.__file__"
&& python {project}/test.py

publish:
name: Publish anycrc ${{ matrix.version }}
Expand Down
92 changes: 36 additions & 56 deletions .github/workflows/build-arro3-compute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ jobs:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
name: Build arro3-compute ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
timeout-minutes: 360
strategy:
fail-fast: false
matrix:
Expand All @@ -74,60 +72,42 @@ jobs:
build: cp314t-manylinux_riscv64
features: --features extension-module

env:
ARRO3_COMPUTE_VERSION: ${{ matrix.version }}

steps:
- name: Checkout arro3 py-v${{ env.ARRO3_COMPUTE_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: kylebarron/arro3
ref: py-v${{ env.ARRO3_COMPUTE_VERSION }}
persist-credentials: false

- name: Stage the licences beside arro3-compute's pyproject.toml
# maturin globs LICEN[CS]E* relative to the pyproject directory, which
# in this monorepo is arro3-compute/ -- so upstream's published wheels
# carry no licence text at all, only the License-Expression metadata.
run: cp LICENSE_MIT LICENSE_APACHE arro3-compute/

- name: Build wheels
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
package-dir: arro3-compute
output-dir: wheelhouse/
env:
# musllinux is dropped: rustup.rs ships no riscv64 musl toolchain.
CIBW_BUILD: ${{ matrix.build }}
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
# arro3 ships no [tool.cibuildwheel], so the Rust toolchain its
# maturin backend needs is installed in-container here.
CIBW_BEFORE_ALL_LINUX: >-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
CIBW_ENVIRONMENT_LINUX: >-
PATH="$PATH:$HOME/.cargo/bin"
MATURIN_PEP517_ARGS="${{ matrix.features }}"
PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/
# Without it pip prefers PyPI's newer numpy/pyarrow/arro3-core,
# none of which has a riscv64 wheel on PyPI, and source-builds or
# fails to resolve them in the container.
CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy,pyarrow,arro3-core
CIBW_TEST_REQUIRES: pytest pyarrow
# cp311 has no riscv64 pyarrow wheel on our registry (pyarrow's
# own riscv64 builds start at cp312), so the wheel still builds
# on cp311 for the abi3 tag but isn't test-exercised there.
CIBW_TEST_SKIP: cp311-*
CIBW_TEST_SOURCES: tests
CIBW_TEST_COMMAND: >-
python -m pytest -v
tests/compute/test_aggregate.py
tests/compute/test_arith.py

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: arro3-compute-${{ env.ARRO3_COMPUTE_VERSION }}-${{ matrix.tag }}-manylinux_riscv64
path: wheelhouse/*.whl
if-no-files-found: error
# maturin globs LICEN[CS]E* relative to the pyproject directory, which
# in this monorepo is arro3-compute/ -- so upstream's published wheels
# carry no licence text at all, only the License-Expression metadata.
uses: $/.github/workflows/_build-cibuildwheel.yml
with:
package: "arro3-compute"
version: "${{ matrix.version }}"
repository: "kylebarron/arro3"
ref: "py-v${{ matrix.version }}"
artifact-tag: "${{ matrix.tag }}-manylinux_riscv64"
timeout-minutes: 360
pre-build: "cp LICENSE_MIT LICENSE_APACHE arro3-compute/"
cibw-package-dir: "arro3-compute"
# musllinux is dropped: rustup.rs ships no riscv64 musl toolchain.
cibw-build: "${{ matrix.build }}"
# arro3 ships no [tool.cibuildwheel], so the Rust toolchain its
# maturin backend needs is installed in-container here.
cibw-before-all-linux: >
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
cibw-environment-linux: >
PATH="$PATH:$HOME/.cargo/bin"
MATURIN_PEP517_ARGS="${{ matrix.features }}"
# Without it pip prefers PyPI's newer numpy/pyarrow/arro3-core,
# none of which has a riscv64 wheel on PyPI, and source-builds or
# fails to resolve them in the container.
cibw-test-environment: "PIP_ONLY_BINARY=numpy,pyarrow,arro3-core"
cibw-test-requires: "pytest pyarrow"
# cp311 has no riscv64 pyarrow wheel on our registry (pyarrow's
# own riscv64 builds start at cp312), so the wheel still builds
# on cp311 for the abi3 tag but isn't test-exercised there.
cibw-test-skip: "cp311-*"
cibw-test-sources: "tests"
cibw-test-command: >
python -m pytest -v
tests/compute/test_aggregate.py
tests/compute/test_arith.py

publish:
name: Publish arro3-compute ${{ matrix.version }}
Expand Down
Loading