diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index 5d2ff042..0134b6ae 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -302,6 +302,7 @@ jobs: 'v3.2.2', 'v3.3.1', 'v3.4.0', + 'v3.5.0', ] steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 diff --git a/README.md b/README.md index 9d9d4be1..db71dfae 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ Compatible versions: | python-flint | Release date | CPython | FLINT | Cython | |--------------|---------------|-------------|------------|------------------| -| `0.9.0` | ??? | `3.11-3.14` | `3.0-3.5` | `3.1-3.2?` | +| `0.9.0` | ??? | `3.11-3.14` | `3.0-3.6` | `3.1-3.2?` | | `0.8.0` | 29th Aug 2025 | `3.11-3.14` | `3.0-3.3` | `3.1` only | | `0.7.0` | 16th Mar 2025 | `3.11-3.13` | `3.0-3.2` | `3.0.11-3.1.0a1` | | `0.6.0` | 1st Feb 2024 | `3.9-3.12` | `3.0` only | `3.0` only | @@ -197,10 +197,41 @@ Changes (0.9.0): work. (OB) - [gh-324](https://github.com/flintlib/python-flint/pull/324), Faster conversion from `int` to `fmpz` and back. (RO). +- [gh-326](https://github.com/flintlib/python-flint/pull/326), + Add support for building with the Python stable ABI. (OB) +- [gh-341](https://github.com/flintlib/python-flint/pull/341), + Disable hashing for inexact `arb` values. (DSM) +- [gh-347](https://github.com/flintlib/python-flint/pull/347), + Fix storing the variable name for `fq_default`. (OB) +- [gh-350](https://github.com/flintlib/python-flint/pull/350), + Add support for Cython 3.2. (OB) +- [gh-352](https://github.com/flintlib/python-flint/pull/352), + Fix a crash in `fmpz_mat.lll()` for empty matrices. (OB) - [gh-359](https://github.com/flintlib/python-flint/pull/359), Sort factorisations of all mpoly types. (OB) -- [gh-374](https://github.com/flintlib/python-flint/pull/374), Fixed a bug in `nmod.__hash__`. (FH) -- [gh-392](https://github.com/flintlib/python-flint/pull/392), Add interface to `acb_theta_jet` (JH, SS) +- [gh-367](https://github.com/flintlib/python-flint/pull/367), + Add type stubs and tests for many more classes. (OB) +- [gh-370](https://github.com/flintlib/python-flint/pull/370), + Fix `unused_gens()` for the zero polynomial. (OB) +- [gh-374](https://github.com/flintlib/python-flint/pull/374), + Fixed a bug in `nmod.__hash__`. (FH) +- [gh-378](https://github.com/flintlib/python-flint/pull/378), + Build Windows extension modules with MSVC. (OB) +- [gh-379](https://github.com/flintlib/python-flint/pull/379), + Add Windows ARM64 wheels. (OB) +- [gh-380](https://github.com/flintlib/python-flint/pull/380), + Support building against FLINT 3.4.0. (OB) +- [gh-393](https://github.com/flintlib/python-flint/pull/393), + Use `fmpz_mod_mat_det()` when building against FLINT 3.1 or newer. (OB) +- [gh-401](https://github.com/flintlib/python-flint/pull/401), + Upload Pyodide wheels to PyPI. (OB) +- [gh-389](https://github.com/flintlib/python-flint/pull/389), + [gh-402](https://github.com/flintlib/python-flint/pull/402), + Support building against FLINT 3.5.0. (OB) +- [gh-392](https://github.com/flintlib/python-flint/pull/392), + Add interface to `acb_theta_jet` (JH, SS) +- [gh-409](https://github.com/flintlib/python-flint/pull/409), + Support building against FLINT 3.6.0. (OB) 0.8.0 ----- diff --git a/bin/build_variables.sh b/bin/build_variables.sh index bb21c9fc..7616aa53 100644 --- a/bin/build_variables.sh +++ b/bin/build_variables.sh @@ -19,4 +19,4 @@ MPIRVER=3.0.0 # MPIR build no longer works (not clear where to download from) # These are the actual dependencies used (at least by default): GMPVER=6.3.0 MPFRVER=4.2.2 -FLINTVER=3.5.0 +FLINTVER=3.6.0 diff --git a/bin/patch-flint-windows-arm64-link-3.6.0.diff b/bin/patch-flint-windows-arm64-link-3.6.0.diff new file mode 100644 index 00000000..950757a0 --- /dev/null +++ b/bin/patch-flint-windows-arm64-link-3.6.0.diff @@ -0,0 +1,32 @@ +diff --git a/Makefile.in b/Makefile.in +index 8185fa609..a3822f53b 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -424,22 +424,16 @@ endif + + ifneq ($(SHARED), 0) + shared: $(FLINT_DIR)/$(FLINT_LIB_FULL) +-# The following is to avoid reaching the maximum length of command line +-# arguments, mainly present on MinGW. +-define xxx_merged_lobj_rule +-$(BUILD_DIR)/$(1)_merged.lo: $($(1)_LOBJS) | $(BUILD_DIR) +- @$(LD) -r $($(1)_LOBJS) -o $(BUILD_DIR)/$(1)_merged.lo +-endef +-$(foreach dir, $(DIRS), $(eval $(call xxx_merged_lobj_rule,$(dir)))) +-MERGED_LOBJS:=$(foreach dir, $(DIRS),$(BUILD_DIR)/$(dir)_merged.lo) + ifeq ($(WANT_LTO),1) + SHARED_LIB_DEPS:=$(LOBJS) + else +-SHARED_LIB_DEPS:=$(MERGED_LOBJS) ++SHARED_LINK_RSP := $(BUILD_DIR)/libflint-shared.rsp ++SHARED_LIB_DEPS:=$(LOBJS) + endif +-$(FLINT_DIR)/$(FLINT_LIB_FULL): $(SHARED_LIB_DEPS) ++$(FLINT_DIR)/$(FLINT_LIB_FULL): $(SHARED_LIB_DEPS) | $(BUILD_DIR) + @echo "Building $(FLINT_LIB_FULL)" +- $(CMD) $(CC) $(CFLAGS) -shared $(EXTRA_SHARED_FLAGS) $(SHARED_LIB_DEPS) -o $(FLINT_LIB_FULL) $(LDFLAGS) $(LIBS) ++ @: $(file >$(SHARED_LINK_RSP))$(foreach obj,$(LOBJS),$(file >>$(SHARED_LINK_RSP),$(obj))) ++ $(CMD) $(CC) $(CFLAGS) -shared $(EXTRA_SHARED_FLAGS) @$(SHARED_LINK_RSP) -o $(FLINT_LIB_FULL) $(LDFLAGS) $(LIBS) + @$(RM_F) $(FLINT_LIB) + @$(RM_F) $(FLINT_LIB_MAJOR) + @$(LN_S) $(FLINT_LIB_FULL) $(FLINT_LIB) diff --git a/doc/source/build.rst b/doc/source/build.rst index c2a8ca6b..356bb925 100644 --- a/doc/source/build.rst +++ b/doc/source/build.rst @@ -87,7 +87,7 @@ Compatible versions: * - 0.9.0 - Not yet - 3.11-3.14 - - 3.0-3.5 + - 3.0-3.6 - 3.1-3.2? * - 0.8.0 - 29th Aug 2025 diff --git a/meson.build b/meson.build index a9ab5bc1..3392cdf7 100644 --- a/meson.build +++ b/meson.build @@ -16,7 +16,7 @@ project( # then we can consider not using a speculative upper version cap here. # flint_lower = '>=3.0' -flint_upper = '<3.6' +flint_upper = '<3.7' cython_lower = '>=3.0.11' cython_upper = '<3.3' diff --git a/src/flint/flintlib/functions/compat.pxd b/src/flint/flintlib/functions/compat.pxd index a060cbb6..a1e3abda 100644 --- a/src/flint/flintlib/functions/compat.pxd +++ b/src/flint/flintlib/functions/compat.pxd @@ -1,6 +1,6 @@ from flint.flintlib.types.flint cimport slong from flint.flintlib.types.fmpz_mod cimport fmpz_mod_mpoly_ctx_t, fmpz_mod_mpoly_t -from flint.flintlib.types.gr cimport gr_ctx_t +from flint.flintlib.types.gr cimport gr_ctx_t, gr_ptr, gr_srcptr, gr_vec_t cdef extern from *: @@ -30,8 +30,19 @@ cdef extern from *: #define compat_fmpz_mod_mpoly_compose_fmpz_mod_mpoly_gen(...) fmpz_mod_mpoly_compose_fmpz_mod_mpoly_gen(__VA_ARGS__) + #endif + + #if __FLINT_RELEASE >= 30600 /* Flint 3.6.0 or later */ + + #define compat_gr_factor(c, factors, exponents, x, flags, ctx) gr_factor(c, factors, (fmpz_vec_struct *) exponents, x, flags, ctx) + + #else + + #define compat_gr_factor(c, factors, exponents, x, flags, ctx) gr_factor(c, factors, exponents, x, flags, ctx) + #endif """ void compat_gr_ctx_init_gr_series(gr_ctx_t ctx, gr_ctx_t base_ring, slong prec) void compat_gr_ctx_init_series_mod_gr_poly(gr_ctx_t ctx, gr_ctx_t base_ring, slong n) void compat_fmpz_mod_mpoly_compose_fmpz_mod_mpoly_gen(fmpz_mod_mpoly_t A, const fmpz_mod_mpoly_t B, const slong * c, const fmpz_mod_mpoly_ctx_t ctxB, const fmpz_mod_mpoly_ctx_t ctxAC) + int compat_gr_factor(gr_ptr c, gr_vec_t factors, gr_vec_t exponents, gr_srcptr x, int flags, gr_ctx_t ctx) diff --git a/src/flint/types/_gr.pxd b/src/flint/types/_gr.pxd index 70a589e1..8ead1bee 100644 --- a/src/flint/types/_gr.pxd +++ b/src/flint/types/_gr.pxd @@ -33,6 +33,7 @@ from flint.flintlib.functions.fmpq_poly cimport ( fmpq_poly_set, ) from flint.flintlib.functions.compat cimport ( + compat_gr_factor, compat_gr_ctx_init_gr_series, # compat_gr_ctx_init_series_mod_gr_poly, ) @@ -159,7 +160,6 @@ from flint.flintlib.functions.gr cimport ( gr_gcd, gr_lcm, - gr_factor, gr_floor, gr_ceil, @@ -782,7 +782,7 @@ cdef class gr_ctx(flint_ctx): c = self.new_gr() gr_vec_init(factors, 0, self.ctx_t) gr_vec_init(exponents, 0, gr_fmpz_ctx_c.ctx_t) - err = gr_factor(c.pval, factors, exponents, x.pval, flags, self.ctx_t) + err = compat_gr_factor(c.pval, factors, exponents, x.pval, flags, self.ctx_t) if err != GR_SUCCESS: raise self._error(err, "Failed to factor gr object") length = gr_vec_length(factors, self.ctx_t) @@ -1716,7 +1716,7 @@ cdef class gr(flint_scalar): c = self.ctx.new_gr() gr_vec_init(factors, 0, self.ctx.ctx_t) gr_vec_init(exponents, 0, gr_fmpz_ctx_c.ctx_t) - err = gr_factor(c.pval, factors, exponents, self.pval, flags, self.ctx.ctx_t) + err = compat_gr_factor(c.pval, factors, exponents, self.pval, flags, self.ctx.ctx_t) if err != GR_SUCCESS: raise self._error(err, "Failed to factor gr object") length = gr_vec_length(factors, self.ctx.ctx_t)