Skip to content

Commit 5e1ae66

Browse files
Merge branch 'main' into more_ruff_fixes
2 parents 48ea638 + 286a54b commit 5e1ae66

File tree

206 files changed

+9816
-3589
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+9816
-3589
lines changed

.github/workflows/buildwheel.yml

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
if: ${{ matrix.os == 'windows-2019' }}
4343

4444
- name: Build wheels
45-
uses: pypa/cibuildwheel@v2.20.0
45+
uses: pypa/cibuildwheel@v2.22.0
4646
env:
4747
# override setting in pyproject.toml to use msys2 instead of msys64 bash
4848
CIBW_BEFORE_ALL_WINDOWS: msys2 -c bin/cibw_before_all_windows.sh
@@ -67,11 +67,7 @@ jobs:
6767
with:
6868
python-version: '3.12'
6969

70-
- run: sudo apt-get update
71-
- run: sudo apt-get install libgmp-dev libmpfr-dev xz-utils ninja-build
72-
- run: curl -O -L https://www.flintlib.org/flint-3.1.0.tar.gz
73-
- run: tar -xzf flint-3.1.0.tar.gz
74-
- run: cd flint-3.1.0 && ./configure --disable-static && make -j4 && sudo make install
70+
- run: bin/install_latest_flint_ubuntu.sh
7571
- run: pip install build
7672
- run: python -m build --sdist
7773

@@ -129,9 +125,7 @@ jobs:
129125
- uses: actions/setup-python@v5
130126
with:
131127
python-version: '3.12'
132-
- run: sudo apt-get update
133-
- run: sudo apt-get install libflint-dev
134-
128+
- run: bin/install_latest_flint_ubuntu.sh
135129
- run: pip install --upgrade pip
136130
- run: pip install -r requirements-dev.txt
137131
- run: spin run -- pytest --doctest-glob='*.rst' doc/source
@@ -222,7 +216,7 @@ jobs:
222216
# Can't use actions/setup-python
223217
# https://github.com/actions/setup-python/issues/771
224218
# deadsnakes only works for Ubuntu...
225-
- uses: deadsnakes/action@v3.1.0
219+
- uses: deadsnakes/action@v3.2.0
226220
with:
227221
python-version: ${{ matrix.python-version }}
228222
nogil: true
@@ -259,6 +253,37 @@ jobs:
259253
- run: pip install sympy==${{ matrix.sympy-version }}
260254
- run: python -c 'import sympy; sympy.test(parallel=True)'
261255

256+
# Push nightly wheels to Anaconda scientific-python nightly channel
257+
# https://scientific-python.org/specs/spec-0004/
258+
# https://anaconda.org/scientific-python-nightly-wheels/python-flint
259+
# https://github.com/scientific-python/upload-nightly-action/issues/111
260+
261+
nightly-wheels-upload:
262+
name: Upload Anaconda Scientific Python nightly wheels
263+
needs: [build_wheels]
264+
# Run on push/merge to main
265+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
266+
runs-on: ubuntu-latest
267+
268+
steps:
269+
# Downloads all artifacts
270+
- name: Download release artifacts
271+
uses: actions/download-artifact@v4
272+
with:
273+
path: wheelhouse
274+
merge-multiple: true
275+
276+
- name: Copy the wheels into dist
277+
run: mkdir dist && cp wheelhouse/*.whl dist
278+
279+
- name: Upload wheels
280+
uses: scientific-python/upload-nightly-action@82396a2ed4269ba06c6b2988bb4fd568ef3c3d6b # 0.6.1
281+
with:
282+
artifacts_path: dist
283+
# This token is generated from anaconda.org
284+
# https://github.com/scientific-python/upload-nightly-action/issues/111
285+
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }}
286+
262287
# Deploy wheels and sdist to PyPI
263288

264289
pypi_release:
@@ -288,7 +313,7 @@ jobs:
288313
# It is recommended to pin a commit hash here for security but it
289314
# should be kept up to date. Possibly all actions and dependencies used
290315
# by the build script should be pinned...
291-
uses: pypa/gh-action-pypi-publish@8a08d616893759ef8e1aa1f2785787c0b97e20d6 # v1.10.0
316+
uses: pypa/gh-action-pypi-publish@fb13cb306901256ace3dab689990e13a5550ffaa # v1.11.0
292317

293318
# Make a GitHub release
294319

@@ -300,6 +325,8 @@ jobs:
300325
contents: write
301326

302327
steps:
328+
- uses: actions/checkout@v4
329+
303330
- name: Download sdist
304331
uses: actions/download-artifact@v4
305332
with:

.readthedocs.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,24 @@ build:
1010
os: ubuntu-24.04
1111
tools:
1212
python: "3.12"
13-
# You can also specify other tool versions:
14-
# nodejs: "19"
15-
# rust: "1.64"
16-
# golang: "1.19"
13+
1714
apt_packages:
1815
- libflint-dev
1916
jobs:
2017
pre_build:
2118
- pip install .
2219

20+
# Tried to use this to build latest version of FLINT but FLINT does not build
21+
# in rtd for some reason. FLINT's configure seems to fail in all sorts of ways
22+
# even though GMP and MPFR build fine.
23+
#
24+
# commands:
25+
# - pip install -r requirements-dev.txt
26+
# - bin/build_dependencies_unix.sh --use-gmp-github-mirror
27+
# - spin build -- --pkg-config-path=.local/lib/pkgconfig -Dadd_flint_rpath=true
28+
# - spin docs
29+
# - mv doc/build/html $READTHEDOCS_OUTPUT/html
30+
2331
# Build documentation in the "docs/" directory with Sphinx
2432
sphinx:
2533
configuration: doc/source/conf.py

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ Contributors (0.7.0):
164164
- Giacomo Pope (GP)
165165
- Joris Roos (JR)
166166
- Edgar Costa (EC)
167+
- Frédéric Chapoton (FC)
167168
- Oscar Benjamin (OB)
168169

169170
Highlights (0.7.0):
@@ -175,18 +176,34 @@ Highlights (0.7.0):
175176
- [gh-132](https://github.com/flintlib/python-flint/pull/132),
176177
[gh-164](https://github.com/flintlib/python-flint/pull/164),
177178
[gh-190](https://github.com/flintlib/python-flint/pull/190),
179+
[gh-191](https://github.com/flintlib/python-flint/pull/191):
178180
[gh-192](https://github.com/flintlib/python-flint/pull/192):
181+
[gh-216](https://github.com/flintlib/python-flint/pull/216):
182+
[gh-225](https://github.com/flintlib/python-flint/pull/225):
179183
Add `fmpz_mpoly`, `fmpq_mpoly`, `nmod_poly` and `fmpz_mod_poly`
180184
types for multivariate polynomials with integer, rational or
181-
integers mod n coefficients. (JM)
185+
integers mod `n` coefficients. (JM)
182186
- [gh-142](https://github.com/flintlib/python-flint/pull/142)
183187
Add `acb_theta` module for the numerical evaluation of [theta
184188
functions](https://flintlib.org/doc/acb_theta.html) (only
185189
available for `Flint >= 3.1`). (EC)
190+
- [gh-218](https://github.com/flintlib/python-flint/pull/218)
191+
An experimental interface for FLINT's generic rings has been
192+
added. This provides access to many of FLINT's types that
193+
are not yet wrapped by python-flint such as Gaussian integer,
194+
number fields, qqbar, calcium, as well as both univariate and
195+
multivariate polynomials and series over these rings (no
196+
matrices yet though). (OB)
186197
- [gh-129](https://github.com/flintlib/python-flint/pull/129)
198+
[gh-208](https://github.com/flintlib/python-flint/pull/208)
187199
Use meson/meson-python instead of setuptools as the build system
188200
for parallel builds and better detection of build and dependency
189201
requirements. (OB)
202+
- [gh-201](https://github.com/flintlib/python-flint/pull/201)
203+
[gh-202](https://github.com/flintlib/python-flint/pull/202)
204+
The documentation has been updated and is now at
205+
[readthedocs](https://python-flint.readthedocs.io/en/latest/).
206+
(OB)
190207

191208
Compatibility break (0.7.0):
192209

@@ -198,11 +215,23 @@ Compatibility break (0.7.0):
198215

199216
Other changes (0.7.0):
200217

218+
- [gh-215](https://github.com/flintlib/python-flint/pull/215)
219+
[gh-219](https://github.com/flintlib/python-flint/pull/219)
220+
The FLINT binding declarations are now fully generated
221+
automatically from the FLINT docs. (OB)
222+
- [gh-203](https://github.com/flintlib/python-flint/pull/203)
223+
[gh-204](https://github.com/flintlib/python-flint/pull/204)
224+
[gh-205](https://github.com/flintlib/python-flint/pull/205)
225+
[gh-206](https://github.com/flintlib/python-flint/pull/206)
226+
[gh-207](https://github.com/flintlib/python-flint/pull/207)
227+
[gh-211](https://github.com/flintlib/python-flint/pull/211)
228+
[gh-212](https://github.com/flintlib/python-flint/pull/212)
229+
Various linting fixes and codebase improvements (FC and GP).
201230
- [gh-189](https://github.com/flintlib/python-flint/pull/189)
202231
All scalar and poly types now have `sqrt`. All poly types now
203232
have `factor_squarefree` and `leading_coefficient` methods.
204233
Exception types raised in a number of places were changed to
205-
`DomainError` for better consistency.
234+
`DomainError` for better consistency. (OB)
206235
- [gh-196](https://github.com/flintlib/python-flint/pull/196)
207236
Supported Python versions are 3.10-3.13 (3.9 dropped). CI
208237
Testing added for 3.13 free-threaded CPython.

bin/all_rst_to_pxd.sh

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
if [ $# -eq 0 ]
6+
then
7+
echo "Usage: bin/all_rst_to_pxd.sh /path/to/flint/doc/source"
8+
exit 1
9+
fi
10+
11+
FLINT_DOC_DIR=$1
12+
13+
modules=(
14+
# "flint"
15+
"mpoly"
16+
# "thread_pool"
17+
# "machine_vectors"
18+
"gr"
19+
"gr_domains"
20+
"gr_generic"
21+
"gr_implementing"
22+
"gr_mat"
23+
"gr_mpoly"
24+
"gr_poly"
25+
"gr_special"
26+
"gr_vec"
27+
"ulong_extras"
28+
"fmpz"
29+
# "fmpz_extras"
30+
"fmpz_factor"
31+
"fmpz_lll"
32+
"fmpz_mat"
33+
"fmpz_mpoly"
34+
"fmpz_mpoly_factor"
35+
"fmpz_mpoly_q"
36+
"fmpz_poly"
37+
"fmpz_poly_factor"
38+
# "fmpz_poly_mat"
39+
# "fmpz_poly_q"
40+
"fmpz_vec"
41+
# "long_extras"
42+
# "longlong"
43+
# "mpn_extras"
44+
# "aprcl"
45+
"arith"
46+
# "fft"
47+
# "fft_small"
48+
# "qsieve"
49+
"fmpq"
50+
"fmpq_mat"
51+
"fmpq_mpoly"
52+
"fmpq_mpoly_factor"
53+
"fmpq_poly"
54+
"fmpq_vec"
55+
"nmod"
56+
"nmod_mat"
57+
"nmod_mpoly"
58+
"nmod_mpoly_factor"
59+
"nmod_poly"
60+
"nmod_poly_factor"
61+
# "nmod_poly_mat"
62+
"nmod_vec"
63+
# "mpn_mod"
64+
"fmpz_mod"
65+
"fmpz_mod_mat"
66+
"fmpz_mod_mpoly"
67+
"fmpz_mod_mpoly_factor"
68+
"fmpz_mod_poly"
69+
"fmpz_mod_poly_factor"
70+
"fmpz_mod_vec"
71+
"dirichlet"
72+
# "dlog"
73+
# "bool_mat"
74+
# "perm"
75+
# "qfb"
76+
# "nf"
77+
# "nf_elem"
78+
# "fmpzi"
79+
# "qqbar"
80+
"mag"
81+
# "nfloat"
82+
"arf"
83+
# "acf"
84+
"arb"
85+
# "arb_calc"
86+
"arb_fmpz_poly"
87+
# "arb_fpwrap"
88+
"arb_hypgeom"
89+
"arb_mat"
90+
"arb_poly"
91+
"acb"
92+
"acb_calc"
93+
"acb_dft"
94+
"acb_dirichlet"
95+
"acb_elliptic"
96+
"acb_hypgeom"
97+
"acb_mat"
98+
"acb_modular"
99+
"acb_poly"
100+
"acb_theta"
101+
"bernoulli"
102+
# "hypgeom"
103+
"partitions"
104+
# "ca"
105+
# "ca_ext"
106+
# "ca_field"
107+
# "ca_mat"
108+
# "ca_poly"
109+
# "ca_vec"
110+
# "calcium"
111+
# "fexpr"
112+
# "fexpr_builtin"
113+
"fq"
114+
# "fq_embed"
115+
"fq_mat"
116+
"fq_poly"
117+
"fq_poly_factor"
118+
# "fq_vec"
119+
"fq_nmod"
120+
# "fq_nmod_embed"
121+
"fq_nmod_mat"
122+
# "fq_nmod_mpoly"
123+
# "fq_nmod_mpoly_factor"
124+
"fq_nmod_poly"
125+
"fq_nmod_poly_factor"
126+
# "fq_nmod_vec"
127+
"fq_zech"
128+
# "fq_zech_embed"
129+
"fq_zech_mat"
130+
"fq_zech_poly"
131+
"fq_zech_poly_factor"
132+
# "fq_zech_vec"
133+
"fq_default"
134+
"fq_default_mat"
135+
"fq_default_poly"
136+
"fq_default_poly_factor"
137+
# "padic"
138+
# "padic_mat"
139+
# "padic_poly"
140+
# "qadic"
141+
# "double_extras"
142+
# "double_interval"
143+
# "d_mat"
144+
# "d_vec"
145+
# "mpfr_mat"
146+
# "mpfr_vec"
147+
)
148+
149+
for module in ${modules[@]}; do
150+
echo "Processing $module"
151+
bin/rst_to_pxd.py flint/$module \
152+
--flint-doc-dir=$FLINT_DOC_DIR \
153+
> src/flint/flintlib/functions/$module.pxd
154+
done

bin/install_latest_flint_ubuntu.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
source bin/build_variables.sh
6+
7+
sudo apt-get update
8+
sudo apt-get install libgmp-dev libmpfr-dev xz-utils ninja-build
9+
10+
curl -O -L https://github.com/flintlib/flint/releases/download/v$FLINTVER/flint-$FLINTVER.tar.gz
11+
tar -xzf flint-$FLINTVER.tar.gz
12+
cd flint-$FLINTVER && ./configure --disable-static && make -j$(expr $(nproc) + 1) && sudo make install
13+
14+
ls -l /usr/local/lib
15+
sudo ldconfig /usr/local/lib

0 commit comments

Comments
 (0)