1919 CAN_DEPLOY : ${{ secrets.SAGEMATH_PYPI_API_TOKEN != '' }}
2020 steps :
2121 - uses : actions/checkout@v4
22+ - name : Install pari
23+ run : |
24+ bash -x .install-pari.sh
25+ env :
26+ PARI_VERSION : pari-2.15.4
2227 - uses : actions/setup-python@v4
2328 - name : make sdist
2429 run : |
@@ -37,20 +42,61 @@ jobs:
3742 if : env.CAN_DEPLOY == 'true' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
3843
3944 build_wheels :
40- name : Build wheels on ${{ matrix.os }}
45+ name : Build wheels on ${{ matrix.os }}, arch ${{ matrix.arch }}
4146 runs-on : ${{ matrix.os }}
47+ needs : sdists_for_pypi
4248 strategy :
49+ fail-fast : false
4350 matrix :
44- os : [ubuntu-latest, macOS-latest]
45-
51+ include :
52+ - os : ubuntu-latest
53+ arch : x86_64
54+ - os : ubuntu-latest
55+ arch : i686
56+ - os : macos-latest
57+ arch : auto
58+ env :
59+ # SPKGs to install as system packages
60+ SPKGS : _bootstrap _prereq
61+ # Non-Python packages to install as spkgs
62+ TARGETS_PRE : pari
63+ # Disable building PyPy wheels on all platforms
64+ # Disable musllinux until #33083 provides alpine package information
65+ CIBW_SKIP : " pp* *-musllinux*"
66+ #
67+ CIBW_ARCHS : ${{ matrix.arch }}
68+ # https://cibuildwheel.readthedocs.io/en/stable/options/#requires-python
69+ CIBW_PROJECT_REQUIRES_PYTHON : " >=3.9"
70+ # Environment during wheel build
71+ CIBW_ENVIRONMENT : " PATH=$(pwd)/local/bin:$PATH CPATH=$(pwd)/local/include:$CPATH LIBRARY_PATH=$(pwd)/local/lib:$LIBRARY_PATH PKG_CONFIG_PATH=$(pwd)/local/share/pkgconfig:$PKG_CONFIG_PATH ACLOCAL_PATH=/usr/share/aclocal"
72+ # Use 'build', not 'pip wheel'
73+ CIBW_BUILD_FRONTEND : build
4674 steps :
4775 - uses : actions/checkout@v4
76+ with :
77+ repository : sagemath/sage
78+ ref : develop
4879
49- # Used to host cibuildwheel
50- - uses : actions/setup-python@v4
80+ - uses : actions/download-artifact@v3
81+ with :
82+ name : dist
83+ path : dist
5184
52- - name : Build wheels
53- 85+ - name : Build platform wheels
86+ # We build the wheel from the sdist.
87+ # But we must run cibuildwheel with the unpacked source directory, not a tarball,
88+ # so that SAGE_ROOT is copied into the build containers.
89+ #
90+ # In the CIBW_BEFORE_ALL phase, we install libraries using the Sage distribution.
91+ # https://cibuildwheel.readthedocs.io/en/stable/options/#before-all
92+ run : |
93+ export PATH=build/bin:$PATH
94+ export CIBW_BEFORE_ALL="( $(sage-print-system-package-command debian --yes --no-install-recommends install $(sage-get-system-packages debian $SPKGS)) || $(sage-print-system-package-command fedora --yes --no-install-recommends install $(sage-get-system-packages fedora $SPKGS | sed s/pkg-config/pkgconfig/)) || ( $(sage-print-system-package-command homebrew --yes --no-install-recommends install $(sage-get-system-packages homebrew $SPKGS)) || echo error ignored) ) && ./bootstrap && ./configure --enable-build-as-root && make -j4 V=0 $TARGETS_PRE"
95+ mkdir -p unpacked
96+ for pkg in cypari2; do
97+ (cd unpacked && tar xfz - ) < dist/$pkg*.tar.gz
98+ pipx run cibuildwheel==2.16.0 unpacked/$pkg*
99+ done
54100
55101 - uses : actions/upload-artifact@v3
56102 with :
0 commit comments