@@ -10,14 +10,14 @@ jobs:
1010 strategy :
1111 fail-fast : false
1212 matrix :
13- os : [ubuntu-20.04, windows-2019, macos-12 ]
13+ os : [ubuntu-20.04, windows-2019, macos-13, macos-14 ]
1414
1515 steps :
1616 - uses : actions/checkout@v4
1717
1818 - uses : actions/setup-python@v5
1919 with :
20- python-version : ' 3.10 '
20+ python-version : ' 3.12 '
2121
2222 - uses : msys2/setup-msys2@v2
2323 with :
3131 path-type : inherit
3232 if : ${{ matrix.os == 'windows-2019' }}
3333
34+ # Install pkgconfig on Windows from choco rather than from msys and
35+ # avoid using the Strawberry one.
36+ - run : choco install -y --stoponfirstfailure --checksum 6004DF17818F5A6DBF19CB335CC92702 pkgconfiglite
37+ if : ${{ matrix.os == 'windows-2019' }}
38+
39+ # We have to set this here rather than in the cibuildwheel config
40+ # This is probably something to do with \ vs / in paths...
41+ - run : echo "PKG_CONFIG_PATH=${{ github.workspace }}/.local/lib/pkgconfig" >> $env:GITHUB_ENV
42+ if : ${{ matrix.os == 'windows-2019' }}
43+
3444 - name : Build wheels
35- uses : pypa/cibuildwheel@v2.16.5
45+ uses : pypa/cibuildwheel@v2.19.2
3646 env :
3747 # override setting in pyproject.toml to use msys2 instead of msys64 bash
3848 CIBW_BEFORE_ALL_WINDOWS : msys2 -c bin/cibw_before_all_windows.sh
4555
4656 build_sdist :
4757 name : Build sdist
48- runs-on : ubuntu-20 .04
58+ runs-on : ubuntu-22 .04
4959
5060 steps :
5161 - uses : actions/checkout@v4
5464 with :
5565 python-version : ' 3.12'
5666
67+ - run : sudo apt-get update
68+ - run : sudo apt-get install libgmp-dev libmpfr-dev xz-utils ninja-build
69+ - run : curl -O -L https://www.flintlib.org/flint-3.1.0.tar.gz
70+ - run : tar -xzf flint-3.1.0.tar.gz
71+ - run : cd flint-3.1.0 && ./configure --disable-static && make -j4 && sudo make install
5772 - run : pip install build
5873 - run : python -m build --sdist
5974
91106 strategy :
92107 fail-fast : false
93108 matrix :
94- os : [ubuntu-20.04, windows-2019, macos-12 ]
109+ os : [ubuntu-20.04, windows-2019, macos-13, macos-14 ]
95110 python-version : ['3.9', '3.10', '3.11', '3.12']
96111
97112 steps :
@@ -105,36 +120,69 @@ jobs:
105120 - run : pip install --no-index --find-links wheelhouse python_flint
106121 - run : python -m flint.test --verbose
107122
108- test_pip_vcs_sdist :
109- name : pip install ${{ matrix.target }} on ${{ matrix.python-version }}
110- runs-on : ubuntu-22.04
123+ # On new enough Ubuntu we can build against the system deb.
124+ test_pip_flint_deb :
125+ name : Build on ${{ matrix.os }}
126+ runs-on : ${{ matrix.os }}
111127 strategy :
112128 fail-fast : false
113129 matrix :
114- python-version : ['3.11', '3.12', '3.13-dev']
115- # '.' means install from python-flint git checkout
116- # 'python-flint' means install from PyPI sdist
117- target : ['.', 'python-flint']
130+ os : [ubuntu-24.04]
118131 steps :
119132 - uses : actions/checkout@v4
120133 - uses : actions/setup-python@v5
121134 with :
122- python-version : ${{ matrix.python-version }}
123- - run : bin/pip_install_ubuntu.sh ${{ matrix.target }}
135+ python-version : ' 3.12'
136+ - run : sudo apt-get update
137+ - run : sudo apt-get install libflint-dev
138+ - run : pip install .
124139 - run : python -m flint.test --verbose
125140
141+ # For older Ubuntu we have to build Flint >= 3.0.0
126142 test_flint_versions :
127- name : Test flint ${{ matrix.flinttag }}
143+ name : Test flint ${{ matrix.flint-tag }}
128144 runs-on : ubuntu-22.04
129145 strategy :
130146 fail-fast : false
131147 matrix :
132- # minimum supported version and latest git
133- flinttag : ['v3.0.0', 'main']
148+ # Supported versions and latest git
149+ flint-tag : ['v3.0.0', 'v3.0.1', 'v3.1.0', 'v3.1.1', 'v3.1.2 ', 'main']
134150 steps :
135- - uses : actions/checkout@v3
136- - uses : actions/setup-python@v4
151+ - uses : actions/checkout@v4
152+ - uses : actions/setup-python@v5
137153 with :
138- python-version : 3.12
139- - run : bin/pip_install_ubuntu.sh . ${{ matrix.flinttag }}
154+ python-version : ' 3.12'
155+ - run : bin/install_flint_ubuntu.sh ${{ matrix.flint-tag }}
156+ - run : pip install .
140157 - run : python -m flint.test --verbose
158+
159+ # Deploy wheels and sdist to PyPI
160+
161+ pypi_release :
162+ name : Publish to PyPI
163+ needs : [build_wheels, build_sdist]
164+ # Run only when a tag is pushed to the flintlib/python-flint repo
165+ if : " github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && github.repository_owner == 'flintlib'"
166+ environment :
167+ name : pypi
168+ url : https://pypi.org/p/sympy
169+ permissions :
170+ id-token : write
171+ runs-on : ubuntu-latest
172+
173+ steps :
174+ # Downloads all artifacts
175+ - name : Download release artifacts
176+ uses : actions/download-artifact@v4
177+ with :
178+ path : wheelhouse
179+ merge-multiple : true
180+
181+ - name : Copy the PyPI files into dist
182+ run : mkdir dist && cp wheelhouse/*.whl wheelhouse/*.tar.gz dist
183+
184+ - name : Publish package on PyPI
185+ # It is recommended to pin a commit hash here for security but it
186+ # should be kept up to date. Possibly all actions and dependencies used
187+ # by the build script should be pinned...
188+ uses : pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0
0 commit comments