Skip to content
Draft
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
270 changes: 270 additions & 0 deletions .github/workflows/build-passagemath-objects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# passagemath-objects is split out of the passagemath/passagemath monorepo
# (a SageMath fork) at pkgs/sagemath-objects, tagged passagemath-<version>.
# This replays build/pkgs/sagemath_objects/spkg-src (./bootstrap renders the
# package's pyproject.toml, then `python -m build --sdist --no-isolation`)
# rather than the full ./configure && make python_build chain upstream's own
# release tooling uses for the complete Sage distribution.
name: Build passagemath-objects wheels (riscv64)

on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/passagemath-objects.yaml not released yet'
required: false
default: ''
pull_request:
branches: [main]
paths:
- '.github/workflows/build-passagemath-objects.yml'
- 'docs/packages/passagemath-objects.yaml'
- 'patches/passagemath-objects/**'
push:
branches: [main]
paths:
- '.github/workflows/build-passagemath-objects.yml'
- 'docs/packages/passagemath-objects.yaml'
- 'patches/passagemath-objects/**'

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

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

env:
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64

jobs:
setup:
uses: $/.github/workflows/_setup.yml
with:
package: passagemath-objects
version: ${{ inputs.version }}

python_sdist:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
runs-on: ubuntu-24.04-riscv
env:
PASSAGEMATH_OBJECTS_VERSION: ${{ matrix.version }}

steps:
- name: checkout passagemath/passagemath passagemath-${{ env.PASSAGEMATH_OBJECTS_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: passagemath/passagemath
ref: passagemath-${{ env.PASSAGEMATH_OBJECTS_VERSION }}
filter: blob:none
sparse-checkout: |
/bootstrap
/pyproject.toml
build
m4
pkgs/sagemath-objects
src/sage/structure
src/sage/cpython
src/sage/libs/gmp
src/sage/libs/gmpxx.pxd
src/sage/categories/action.*
src/sage/categories/algebra_functor.*
src/sage/categories/basic.*
src/sage/categories/cartesian_product.*
src/sage/categories/category*.*
src/sage/categories/covariant_functorial_construction.*
src/sage/categories/facade_sets.*
src/sage/categories/functor.*
src/sage/categories/homset.*
src/sage/categories/homsets.*
src/sage/categories/map.*
src/sage/categories/morphism.*
src/sage/categories/isomorphic_objects.*
src/sage/categories/objects.*
src/sage/categories/primer.*
src/sage/categories/pushout.*
src/sage/categories/quotients.*
src/sage/categories/realizations.*
src/sage/categories/sets_cat.*
src/sage/categories/sets_with_partial_maps.*
src/sage/categories/subobjects.*
src/sage/categories/subquotients.*
src/sage/categories/with_realizations.*
src/sage/categories/__init__.py
src/sage/misc/classcall_metaclass.*
src/sage/misc/inherit_comparison*.*
src/sage/misc/weak_dict.*
src/sage/misc/nested_class*.*
src/sage/misc/test_nested_class*.p*
src/sage/misc/abstract_method.*
src/sage/misc/cachefunc.*
src/sage/misc/decorators.*
src/sage/misc/c3_controlled.*
src/sage/misc/lazy_attribute.*
src/sage/misc/function_mangling.*
src/sage/misc/lazy_string.*
src/sage/misc/lazy_format.*
src/sage/misc/unknown.*
src/sage/misc/fast_methods.*
src/sage/misc/constant_function.*
src/sage/misc/call.*
src/sage/misc/bindable_class.*
src/sage/misc/namespace_package.p*
src/sage/misc/verbose.*
src/sage/misc/repr.*
src/sage/misc/superseded.*
src/sage/misc/misc_c.*
src/sage/misc/flatten.*
src/sage/misc/lazy_list.p*
src/sage/misc/lazy_import*.*
src/sage/misc/sageinspect.*
src/sage/misc/instancedoc.*
src/sage/misc/persist.*
src/sage/misc/sage_unittest.*
src/sage/misc/fpickle.p*
src/sage/misc/randstate.*
src/sage/misc/prandom.*
src/sage/misc/misc.*
src/sage/misc/timing.p*
src/sage/misc/globals.p*
src/sage/misc/sage_timeit*.p*
src/sage/misc/session.p*
src/sage/misc/reset.p*
src/sage/misc/sage_ostools.p*
src/sage/misc/inherit_comparison_impl.c
src/sage/misc/__init__.py
src/sage/ext/stdsage.pxd
src/sage/ext/mod_int.*
src/sage/ext/cplusplus.pxd
src/sage/ext/ccobject.h
src/sage/ext/__init__.py
src/sage/sets/pythonclass.*
src/sage/sets/__init__.py
src/sage/arith/power.*
src/sage/arith/numerical_approx.*
src/sage/arith/long.*
src/sage/arith/__init__.py
src/sage/rings/integer_fake.*
src/sage/rings/__init__.py
src/sage/groups/group.*
src/sage/groups/old.*
src/sage/groups/__init__.py
src/sage/modules/module.p*
src/sage/modules/__init__.py
src/sage/cpython/debugimpl.c
src/sage/__init__.py
src/sage/all__sagemath_objects.py
sparse-checkout-cone-mode: false
persist-credentials: false

- name: Checkout python-wheels
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: python-wheels
persist-credentials: false

# setup.py imports sage_setup, and pyproject.toml.m4 needs the
# SPKG_INSTALL_REQUIRES_* macros bootstrap renders from the top-level
# pyproject.toml, falling back to every spkg's version_requirements.txt
# (hence /pyproject.toml and the full build/ checkout above); this
# is the lightweight per-package render, not the full
# ./configure && make python_build chain the whole Sage distribution needs.
- name: Patch passagemath-objects source
run: git apply python-wheels/patches/passagemath-objects/${{ env.PASSAGEMATH_OBJECTS_VERSION }}/00*.patch

- name: Render pyproject.toml
run: ./bootstrap

- name: setup uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
python-version: '3.12'
activate-environment: true
enable-cache: false

- name: build sdist
working-directory: pkgs/sagemath-objects
run: |
rm -rf dist/ *.egg-info
# --no-isolation means build uses this environment as-is rather than
# creating its own from build-system.requires, so setuptools (the
# rendered pyproject.toml's build backend) must be installed here too.
uv pip install build setuptools "passagemath-setup==${{ env.PASSAGEMATH_OBJECTS_VERSION }}" "passagemath-environment==${{ env.PASSAGEMATH_OBJECTS_VERSION }}"
python -m build --sdist --no-isolation --skip-dependency-check

- name: upload sdist artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: passagemath-objects-${{ env.PASSAGEMATH_OBJECTS_VERSION }}-sdist
path: pkgs/sagemath-objects/dist/*.tar.gz
if-no-files-found: error

linux:
needs: [setup, python_sdist]
if: needs.setup.outputs.versions != '[]'
name: Build passagemath-objects ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
python: ["cp312", "cp313", "cp314", "cp314t"]
# musllinux dropped: gmpy2, a hard runtime dependency, has no
# musllinux riscv64 wheel on this registry at all.

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

steps:
- name: Download sdist
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: passagemath-objects-${{ env.PASSAGEMATH_OBJECTS_VERSION }}-sdist
path: dist/

- id: sdist_path
run: echo "path=$(echo dist/*.tar.gz)" >> "$GITHUB_OUTPUT"

- name: Build wheels
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
package-dir: ${{ steps.sdist_path.outputs.path }}
output-dir: wheelhouse/
only: ${{ matrix.python }}-manylinux_riscv64
env:
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
# gmp/mpfr/mpc satisfy Sage's own spkg-configure.m4 minimum-version
# checks, so the system -devel packages are enough; no from-source
# build needed (unlike gmpy2, which vendors its own copies).
CIBW_BEFORE_ALL_LINUX: dnf install -y gmp-devel mpfr-devel libmpc-devel
CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/

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

publish:
name: Publish passagemath-objects ${{ matrix.version }}
needs: [setup, linux]
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: passagemath-objects-${{ matrix.version }}-*-manylinux_riscv64
5 changes: 5 additions & 0 deletions docs/packages/passagemath-objects.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package-name: passagemath-objects
source-code: https://github.com/passagemath/passagemath/tree/main/pkgs/sagemath-objects
license: GPL-2.0-or-later
versions:
- version: 10.8.13
Loading
Loading