Skip to content

Commit 262e215

Browse files
authored
bashkit: Add version 0.17.1 (#2320)
Build the cp39-abi3 riscv64 wheel of bashkit (pyo3/maturin) from the v0.17.1 tag and run upstream's pytest suite, including the random-fs interop fixture, on cp39-cp314.
1 parent 1ba04e0 commit 262e215

2 files changed

Lines changed: 137 additions & 0 deletions

File tree

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# SPDX-FileCopyrightText: 2026 The RISE Project
2+
# SPDX-License-Identifier: MIT
3+
---
4+
# This workflow is based on:
5+
# https://github.com/everruns/bashkit/blob/v0.17.1/.github/workflows/publish-python.yml
6+
# https://github.com/everruns/bashkit/blob/v0.17.1/.github/workflows/python.yml
7+
name: Build bashkit wheels (riscv64)
8+
9+
on:
10+
workflow_dispatch:
11+
inputs:
12+
version:
13+
description: 'Version glob to (re)build; empty builds every version of docs/packages/bashkit.yaml not released yet'
14+
required: false
15+
default: ''
16+
pull_request:
17+
branches: [main]
18+
paths:
19+
- '.github/workflows/build-bashkit.yml'
20+
- 'docs/packages/bashkit.yaml'
21+
push:
22+
branches: [main]
23+
paths:
24+
- '.github/workflows/build-bashkit.yml'
25+
- 'docs/packages/bashkit.yaml'
26+
27+
concurrency:
28+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
29+
cancel-in-progress: true
30+
31+
permissions:
32+
contents: read # to fetch code (actions/checkout)
33+
34+
env:
35+
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
36+
37+
jobs:
38+
setup:
39+
uses: $/.github/workflows/_setup.yml
40+
with:
41+
package: bashkit
42+
version: ${{ inputs.version }}
43+
44+
build_wheels:
45+
needs: [setup]
46+
if: needs.setup.outputs.versions != '[]'
47+
name: Build bashkit ${{ matrix.version }} cp39-abi3-manylinux_riscv64
48+
runs-on: ubuntu-24.04-riscv
49+
timeout-minutes: 1440
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
version: ${{ fromJSON(needs.setup.outputs.versions) }}
54+
55+
env:
56+
BASHKIT_VERSION: ${{ matrix.version }}
57+
58+
steps:
59+
- name: Checkout bashkit v${{ env.BASHKIT_VERSION }}
60+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
61+
with:
62+
repository: everruns/bashkit
63+
ref: v${{ env.BASHKIT_VERSION }}
64+
persist-credentials: false
65+
66+
- name: Stage the licence beside bashkit's pyproject.toml
67+
# maturin globs LICEN[CS]E* relative to the pyproject directory, which
68+
# is crates/bashkit-python/ -- upstream's published wheels carry none.
69+
run: cp LICENSE crates/bashkit-python/
70+
71+
- name: Build wheel
72+
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
73+
with:
74+
package-dir: crates/bashkit-python
75+
output-dir: wheelhouse/
76+
env:
77+
# pyo3's abi3-py39 feature is on unconditionally: built once on cp39
78+
# and re-tested on the newer interpreters. No free-threaded wheel
79+
# upstream. musllinux is dropped: rustup.rs ships no riscv64 musl
80+
# toolchain.
81+
CIBW_BUILD: >-
82+
cp39-manylinux_riscv64 cp310-manylinux_riscv64
83+
cp311-manylinux_riscv64 cp312-manylinux_riscv64
84+
cp313-manylinux_riscv64 cp314-manylinux_riscv64
85+
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
86+
CIBW_BEFORE_ALL_LINUX: >-
87+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
88+
CIBW_ENVIRONMENT_LINUX: >-
89+
PATH="$PATH:$HOME/.cargo/bin"
90+
PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/
91+
# The integration-test deps have riscv64 wheels from cp312 only; their
92+
# tests importorskip them.
93+
CIBW_BEFORE_TEST: >-
94+
pip install pytest pytest-asyncio
95+
"langchain-core; python_version >= '3.12'"
96+
"langgraph; python_version >= '3.12'"
97+
"fastapi; python_version >= '3.12'"
98+
"httpx; python_version >= '3.12'" &&
99+
pip install {project}/crates/bashkit-python/test-fixtures/random-fs
100+
CIBW_TEST_SOURCES: >-
101+
crates/bashkit-python/tests
102+
crates/bashkit-python/bashkit/deepagents.py
103+
crates/bashkit-python/pyproject.toml
104+
CIBW_TEST_COMMAND: >-
105+
python -c "import bashkit._bashkit as m, importlib.metadata as md;
106+
assert m.__file__.endswith('.so'), m.__file__;
107+
assert any(str(p).endswith('licenses/LICENSE') for p in md.files('bashkit'))" &&
108+
cd crates/bashkit-python &&
109+
pytest tests/ -v
110+
111+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
112+
with:
113+
name: bashkit-${{ env.BASHKIT_VERSION }}-cp39-abi3-manylinux_riscv64
114+
path: wheelhouse/*.whl
115+
if-no-files-found: error
116+
117+
publish:
118+
name: Publish bashkit ${{ matrix.version }}
119+
needs: [setup, build_wheels]
120+
if: needs.setup.outputs.versions != '[]'
121+
strategy:
122+
fail-fast: false
123+
matrix:
124+
version: ${{ fromJSON(needs.setup.outputs.versions) }}
125+
permissions:
126+
contents: write
127+
pull-requests: write
128+
uses: $/.github/workflows/_publish-wheel.yml
129+
secrets:
130+
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
131+
with:
132+
artifact-pattern: bashkit-${{ matrix.version }}-*-manylinux_riscv64

‎docs/packages/bashkit.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package-name: bashkit
2+
source-code: https://github.com/everruns/bashkit
3+
license: MIT
4+
versions:
5+
- version: 0.17.1

0 commit comments

Comments
 (0)