Skip to content
Merged
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
97 changes: 97 additions & 0 deletions .github/workflows/build-psygnal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# This workflow is based on: https://github.com/pyapp-kit/psygnal/blob/v0.15.1/.github/workflows/pypi.yml
name: Build psygnal wheels (riscv64)

on:
workflow_dispatch:
inputs:
version:
description: 'psygnal version to build (git tag without the v, e.g. 0.15.1)'
required: true
default: '0.15.1'
pull_request:
paths:
- '.github/workflows/build-psygnal.yml'

concurrency:
group: ${{ github.workflow }}-${{ inputs.version || '0.15.1' }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read # to fetch code (actions/checkout)

env:
PSYGNAL_VERSION: ${{ inputs.version || '0.15.1' }}
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64

jobs:
build_wheels:
name: Build psygnal ${{ inputs.version || '0.15.1' }} ${{ matrix.python }}-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
strategy:
fail-fast: false
matrix:
# mypyc emits per-interpreter (non-abi3) wheels; upstream ships no
# free-threaded wheel, so cp314t is out.
python: ["cp312", "cp313", "cp314"]

steps:
- name: Checkout psygnal ${{ env.PSYGNAL_VERSION }}
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: pyapp-kit/psygnal
ref: v${{ env.PSYGNAL_VERSION }}
persist-credentials: false

- name: Build wheels
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
output-dir: wheelhouse/
only: ${{ matrix.python }}-manylinux_riscv64
env:
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
# Upstream's uv frontend asserts a host `uv`, which the runner has not got.
# --no-isolation makes the mypy pin below stick.
CIBW_BUILD_FRONTEND: "build; args: --no-isolation"
# mypy 1.20 mypyc miscompiles psygnal 0.15.1: importing the wheel segfaults.
CIBW_BEFORE_BUILD: >-
pip install "hatchling>=1.8.0" hatch-vcs "hatch-mypyc>=0.13.0"
"mypy<1.20" "mypy_extensions>=0.4.2" "pydantic!=2.10.0" types-attrs
"msgspec; python_version < '3.14'"
# Restates upstream's [tool.cibuildwheel.environment], which this replaces.
# only-binary keeps the compiled deps on the registry's riscv64 wheels.
CIBW_ENVIRONMENT: >-
HATCH_BUILD_HOOKS_ENABLE=1
PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/
PIP_ONLY_BINARY=numpy,pydantic-core,msgspec
# The mypyc hook is opt-in, and a failure to enable it yields a
# pure-Python wheel under a manylinux tag.
CIBW_TEST_COMMAND: >-
python -c "import psygnal; assert psygnal._compiled, 'wheel is not compiled'"
&& pytest {project}/tests -v

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: psygnal-${{ env.PSYGNAL_VERSION }}-${{ matrix.python }}-manylinux_riscv64
path: wheelhouse/*.whl
if-no-files-found: error

publish:
name: Publish psygnal ${{ inputs.version || '0.15.1' }} to GitLab
needs: [build_wheels]
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Publish wheels and open docs PR
uses: riseproject-dev/python-wheels/actions/publish-wheels@main
with:
artifact-pattern: psygnal-${{ env.PSYGNAL_VERSION }}-*-manylinux_riscv64
gitlab-username: ${{ vars.GITLAB_DEPLOY_USER }}
gitlab-token: ${{ secrets.GITLAB_DEPLOY_TOKEN }}
gitlab-project-id: ${{ vars.GITLAB_PROJECT_ID }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
Loading