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
23 changes: 20 additions & 3 deletions .github/workflows/_build-cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ on:
required: false
default: 1
type: number
checkout-fetch-tags:
description: Whether actions/checkout fetches tags.
required: false
default: false
type: boolean
checkout-sparse-checkout:
description: Newline-separated sparse-checkout patterns.
required: false
default: ''
type: string
patches:
description: Apply patches/<package>/<version>/*.patch before building.
required: false
Expand Down Expand Up @@ -260,6 +270,8 @@ jobs:
path: ${{ inputs.package }}
submodules: ${{ inputs['checkout-submodules'] }}
fetch-depth: ${{ inputs['checkout-fetch-depth'] }}
fetch-tags: ${{ inputs['checkout-fetch-tags'] }}
sparse-checkout: ${{ inputs['checkout-sparse-checkout'] }}
persist-credentials: false

- name: Checkout patches
Expand Down Expand Up @@ -388,15 +400,20 @@ jobs:
if name == "CIBW_TEST_SOURCES" and value:
sources = []
for source in shlex.split(value):
if source.startswith("{project}"):
if source.startswith((f"{{project}}/{package}", f"/project/{package}")):
pass
elif source.startswith("{project}"):
source = source.replace("{project}", f"{{project}}/{package}", 1)
elif source == "/project" or source.startswith("/project/"):
source = source.replace("/project", f"/project/{package}", 1)
elif not os.path.isabs(source):
source = os.path.join(package, source)
sources.append(source)
value = " ".join(sources)
elif value:
value = value.replace("{project}", f"{{project}}/{package}")
value = re.sub(r"/project(?=/|[\s:'\"]|$)", f"/project/{package}", value)
suffix = rf"/{re.escape(package)}(?=/|[\s:'\"]|$)"
value = re.sub(rf"\{{project\}}(?!{suffix})", f"{{project}}/{package}", value)
value = re.sub(rf"/project(?!{suffix})(?=/|[\s:'\"]|$)", f"/project/{package}", value)
if not value:
continue
delimiter = f"cibw_{uuid.uuid4().hex}"
Expand Down
56 changes: 19 additions & 37 deletions .github/workflows/build-ahocorasick-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,48 +48,30 @@ jobs:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
name: Build ahocorasick-rs ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64
runs-on: ubuntu-24.04-riscv
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.setup.outputs.matrix) }}

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

steps:
- name: Checkout ahocorasick-rs ${{ env.AHOCORASICK_RS_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: G-Research/ahocorasick_rs
ref: ${{ env.AHOCORASICK_RS_VERSION }}
persist-credentials: false

- name: Build wheels
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
output-dir: wheelhouse/
# musllinux is dropped: rustup.rs ships no riscv64 musl toolchain.
only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64
env:
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
# ahocorasick_rs ships no [tool.cibuildwheel], so the Rust
# toolchain its maturin backend needs is installed in-container.
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"
CIBW_TEST_REQUIRES: pytest hypothesis
CIBW_TEST_SOURCES: tests
CIBW_TEST_COMMAND: >-
python -c "import ahocorasick_rs; assert ahocorasick_rs.ahocorasick_rs.__file__.endswith('.so'), ahocorasick_rs.ahocorasick_rs.__file__" &&
python -m pytest -v tests

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ahocorasick-rs-${{ env.AHOCORASICK_RS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64
path: wheelhouse/*.whl
if-no-files-found: error
uses: $/.github/workflows/_build-cibuildwheel.yml
with:
package: "ahocorasick-rs"
version: "${{ matrix.version }}"
repository: "G-Research/ahocorasick_rs"
ref: "${{ matrix.version }}"
artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64"
# musllinux is dropped: rustup.rs ships no riscv64 musl toolchain.
cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64"
# ahocorasick_rs ships no [tool.cibuildwheel], so the Rust
# toolchain its maturin backend needs is installed in-container.
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\""
cibw-test-requires: "pytest hypothesis"
cibw-test-sources: "tests"
cibw-test-command: >
python -c "import ahocorasick_rs; assert ahocorasick_rs.ahocorasick_rs.__file__.endswith('.so'), ahocorasick_rs.ahocorasick_rs.__file__" &&
python -m pytest -v tests

publish:
name: Publish ahocorasick-rs ${{ matrix.version }}
Expand Down
86 changes: 33 additions & 53 deletions .github/workflows/build-alienplatform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,63 +59,43 @@ jobs:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
name: Build alienplatform ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
# riscv64 builds run several times slower than x86_64; raised from 120 after jobs were killed mid-build by the timeout, not a dead runner.
timeout-minutes: 360
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.setup.outputs.matrix) }}
env:
ALIENPLATFORM_VERSION: ${{ matrix.version }}

steps:
- name: Checkout alienplatform ${{ env.ALIENPLATFORM_REF }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: alienplatform/alien
ref: ${{ env.ALIENPLATFORM_REF }}
persist-credentials: false

- name: Build wheels
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
package-dir: crates/alien-bindings-python
output-dir: wheelhouse/
only: ${{ matrix.python }}-manylinux_riscv64
env:
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
# alien-bindings-python ships no [tool.cibuildwheel], so the Rust
# toolchain its maturin backend needs is installed in-container.
# package-dir is the crate subdirectory, but Cargo still resolves
# the enclosing workspace root (Cargo.lock) by walking up from
# there, so no extra workspace checkout step is needed.
CIBW_BEFORE_ALL_LINUX: >-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs |
sh -s -- -y --profile minimal --default-toolchain ${{ env.RUST_TOOLCHAIN }}
CIBW_ENVIRONMENT: >-
PATH="$PATH:$HOME/.cargo/bin"
RUSTUP_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/
# Base `import alienplatform` only loads the compiled extension:
# grpcio/protobuf are the optional [worker] extra, imported lazily
# inside worker_runtime.py's functions, never at module load.
# storage()/kv()/etc. build a lazy handle synchronously with no
# network or credential access, so this is a safe smoke test -
# matching upstream's own wheels job, which runs no test command at
# all against this feature set (its pytest suite only covers a
# separate --features local build, see python-bindings.yml's `test`
# job).
CIBW_TEST_COMMAND: >-
python -c "import alienplatform;
s = alienplatform.storage('files');
print('alienplatform OK:', type(s).__name__)"

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: alienplatform-${{ env.ALIENPLATFORM_VERSION }}-${{ matrix.python }}-manylinux_riscv64
path: wheelhouse/*.whl
if-no-files-found: error
# riscv64 builds run several times slower than x86_64; raised from 120 after jobs were killed mid-build by the timeout, not a dead runner.
uses: $/.github/workflows/_build-cibuildwheel.yml
with:
package: "alienplatform"
version: "${{ matrix.version }}"
repository: "alienplatform/alien"
ref: "b33b2c81540e1faeee91ef682f3e022039420bac"
artifact-tag: "${{ matrix.python }}-manylinux_riscv64"
timeout-minutes: 360
cibw-package-dir: "crates/alien-bindings-python"
cibw-build: "${{ matrix.python }}-manylinux_riscv64"
# alien-bindings-python ships no [tool.cibuildwheel], so the Rust
# toolchain its maturin backend needs is installed in-container.
# package-dir is the crate subdirectory, but Cargo still resolves
# the enclosing workspace root (Cargo.lock) by walking up from
# there, so no extra workspace checkout step is needed.
cibw-before-all-linux: >
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs |
sh -s -- -y --profile minimal --default-toolchain ${{ env.RUST_TOOLCHAIN }}
cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" RUSTUP_TOOLCHAIN=nightly-2026-10-03"
# Base `import alienplatform` only loads the compiled extension:
# grpcio/protobuf are the optional [worker] extra, imported lazily
# inside worker_runtime.py's functions, never at module load.
# storage()/kv()/etc. build a lazy handle synchronously with no
# network or credential access, so this is a safe smoke test -
# matching upstream's own wheels job, which runs no test command at
# all against this feature set (its pytest suite only covers a
# separate --features local build, see python-bindings.yml's `test`
# job).
cibw-test-command: >
python -c "import alienplatform;
s = alienplatform.storage('files');
print('alienplatform OK:', type(s).__name__)"

publish:
name: Publish alienplatform ${{ matrix.version }}
Expand Down
56 changes: 19 additions & 37 deletions .github/workflows/build-aliyun-log-fastpb.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 aliyun-log-fastpb ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
Expand All @@ -75,41 +73,25 @@ jobs:
- tag: cp314t
build: cp314t-manylinux_riscv64

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

steps:
- name: Checkout aliyun-log-fastpb v${{ env.ALIYUN_LOG_FASTPB_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: aliyun/aliyun-log-python-fastpb
ref: v${{ env.ALIYUN_LOG_FASTPB_VERSION }}
persist-credentials: false

- name: Build wheels
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
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 }}
# aliyun-log-fastpb ships no [tool.cibuildwheel], so the Rust
# toolchain its maturin backend needs is installed in-container.
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"
CIBW_TEST_REQUIRES: pytest protobuf
CIBW_TEST_SOURCES: tests
CIBW_TEST_COMMAND: >-
python -c "import aliyun_log_fastpb.aliyun_log_fastpb as m; assert m.__file__.endswith('.so'), m.__file__" &&
python -m pytest -v tests

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: aliyun-log-fastpb-${{ env.ALIYUN_LOG_FASTPB_VERSION }}-${{ matrix.tag }}-manylinux_riscv64
path: wheelhouse/*.whl
if-no-files-found: error
uses: $/.github/workflows/_build-cibuildwheel.yml
with:
package: "aliyun-log-fastpb"
version: "${{ matrix.version }}"
repository: "aliyun/aliyun-log-python-fastpb"
ref: "v${{ matrix.version }}"
artifact-tag: "${{ matrix.tag }}-manylinux_riscv64"
# musllinux is dropped: rustup.rs ships no riscv64 musl toolchain.
cibw-build: "${{ matrix.build }}"
# aliyun-log-fastpb ships no [tool.cibuildwheel], so the Rust
# toolchain its maturin backend needs is installed in-container.
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\""
cibw-test-requires: "pytest protobuf"
cibw-test-sources: "tests"
cibw-test-command: >
python -c "import aliyun_log_fastpb.aliyun_log_fastpb as m; assert m.__file__.endswith('.so'), m.__file__" &&
python -m pytest -v tests

publish:
name: Publish aliyun-log-fastpb ${{ matrix.version }}
Expand Down
70 changes: 26 additions & 44 deletions .github/workflows/build-anchorpy-core.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 anchorpy-core ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
Expand All @@ -66,48 +64,32 @@ jobs:
cp312-manylinux_riscv64 cp313-manylinux_riscv64
cp314-manylinux_riscv64

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

steps:
- name: Checkout anchorpy-core ${{ env.ANCHORPY_CORE_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: kevinheavey/anchorpy-core
ref: ${{ env.ANCHORPY_CORE_VERSION }}
persist-credentials: false

- name: Build wheels
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
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 }}
# anchorpy-core ships no [tool.cibuildwheel]; install the Rust
# toolchain its maturin backend needs.
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"
# pyproject.toml pins maturin<0.14 (2022), which has no riscv64
# wheel on PyPI and fails to build from sdist (its own bootstrap
# needs setuptools, which Python 3.12+ no longer seeds into a
# fresh build-isolation venv). A current maturin builds this tree
# unmodified, so install one and skip isolation to bypass the pin.
CIBW_BEFORE_BUILD: pip install maturin
CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation"
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_SOURCES: tests
CIBW_TEST_COMMAND: >-
python -c "import anchorpy_core.anchorpy_core as m; assert m.__file__.endswith('.so'), m.__file__" &&
python -m pytest -v tests

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: anchorpy-core-${{ env.ANCHORPY_CORE_VERSION }}-${{ matrix.tag }}-manylinux_riscv64
path: wheelhouse/*.whl
if-no-files-found: error
uses: $/.github/workflows/_build-cibuildwheel.yml
with:
package: "anchorpy-core"
version: "${{ matrix.version }}"
repository: "kevinheavey/anchorpy-core"
ref: "${{ matrix.version }}"
artifact-tag: "${{ matrix.tag }}-manylinux_riscv64"
# musllinux is dropped: rustup.rs ships no riscv64 musl toolchain.
cibw-build: "${{ matrix.build }}"
# anchorpy-core ships no [tool.cibuildwheel]; install the Rust
# toolchain its maturin backend needs.
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\""
# pyproject.toml pins maturin<0.14 (2022), which has no riscv64
# wheel on PyPI and fails to build from sdist (its own bootstrap
# needs setuptools, which Python 3.12+ no longer seeds into a
# fresh build-isolation venv). A current maturin builds this tree
# unmodified, so install one and skip isolation to bypass the pin.
cibw-before-build: "pip install maturin"
cibw-build-frontend: "pip; args: --no-build-isolation"
cibw-test-requires: "pytest"
cibw-test-sources: "tests"
cibw-test-command: >
python -c "import anchorpy_core.anchorpy_core as m; assert m.__file__.endswith('.so'), m.__file__" &&
python -m pytest -v tests

publish:
name: Publish anchorpy-core ${{ matrix.version }}
Expand Down
Loading