Skip to content

matscipy: Add version 1.2.0 #11

matscipy: Add version 1.2.0

matscipy: Add version 1.2.0 #11

Workflow file for this run

# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# This workflow is based on the `build` job of
# https://github.com/libAtoms/matscipy/blob/v1.2.0/.github/workflows/wheels.yml
# and the `pytest` step of
# https://github.com/libAtoms/matscipy/blob/v1.2.0/.github/workflows/tests.yml
name: Build matscipy wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/matscipy.yaml not released yet'
required: false
default: ''
pull_request:
branches: [main]
paths:
- '.github/workflows/build-matscipy.yml'
- 'docs/packages/matscipy.yaml'
- 'patches/matscipy/**'
push:
branches: [main]
paths:
- '.github/workflows/build-matscipy.yml'
- 'docs/packages/matscipy.yaml'
- 'patches/matscipy/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
setup:
uses: $/.github/workflows/_setup.yml
with:
package: matscipy
version: ${{ inputs.version }}
build_wheels:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
name: Build matscipy ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
python: ["cp312", "cp313", "cp314"]
env:
MATSCIPY_VERSION: ${{ matrix.version }}
steps:
- name: Checkout matscipy v${{ env.MATSCIPY_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: libAtoms/matscipy
ref: v${{ env.MATSCIPY_VERSION }}
fetch-depth: 0
persist-credentials: false
- name: Checkout python-wheels
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: python-wheels
persist-credentials: false
- name: Patch matscipy source
run: |
git apply python-wheels/patches/matscipy/${{ env.MATSCIPY_VERSION }}/*.patch
# meson-python reads the wheel version from `git describe` on this tree; a
# dirty tree gives "1.2.0.dirty", which packaging.version.Version rejects
# outright (InvalidVersion), failing the build before compilation even
# starts. Hide just the patched files from dirty-detection instead.
git diff --name-only | xargs git update-index --skip-worktree
- name: Build wheels
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
only: ${{ matrix.python }}-manylinux_riscv64
env:
CIBW_BUILD_FRONTEND: build
CIBW_BEFORE_BUILD: pip install meson meson-python ninja
CIBW_ENVIRONMENT: >-
PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/
PIP_ONLY_BINARY=numpy,scipy,matplotlib,contourpy,kiwisolver,pillow
# Upstream's wheel job only imports the extension; run its tests.yml suite instead.
# ase.constraints.UnitCellFilter (and friends), which this v1.2.0 tag's tests/
# still imports, was a @deprecated re-export from ase.filters through 3.26.0;
# 3.27.0 drops the re-export entirely (checked gitlab.com/ase/ase directly,
# tag by tag). matscipy's pyproject.toml floor (ase>=3.26.0) doesn't cap the
# other end, so an unconstrained resolve picks today's ase and breaks 29
# tests / errors on 12 modules. ase<3.27 is its own space-separated token
# here (no quote characters anywhere in this YAML scalar), resolved together
# with matscipy's own floor by the same `pip install` that installs the wheel.
CIBW_TEST_REQUIRES: pytest pytest-subtests pytest-timeout pytest-xdist sympy ase<3.27
# Upstream's --timeout=600 is sized for x86; test_bop/test_dislocation cases take 350-600s here.
CIBW_TEST_COMMAND: cd {project}/tests && pytest -v --durations=20 --timeout=1800 -n auto
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: matscipy-${{ env.MATSCIPY_VERSION }}-${{ matrix.python }}-manylinux_riscv64
path: ./wheelhouse/*.whl
if-no-files-found: error
publish:
name: Publish matscipy ${{ matrix.version }}
needs: [setup, build_wheels]
if: needs.setup.outputs.versions != '[]'
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
permissions:
contents: write
pull-requests: write
uses: $/.github/workflows/_publish-wheel.yml
secrets:
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
with:
artifact-pattern: matscipy-${{ matrix.version }}-*-manylinux_riscv64