From 8696f45a4f23aef4febbed04a4216b880796801d Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Mon, 15 Jun 2026 10:21:29 +0200 Subject: [PATCH 01/17] TMP: Test for intermittent CI failure... --- .github/workflows/buildwheel.yml | 1 + test.py | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 test.py diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index 1acbac9a..fdfbe3e2 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -272,6 +272,7 @@ jobs: - run: bin/install_latest_flint_ubuntu.sh - run: pip install --upgrade pip - run: pip install -r requirements-dev.txt + - run: spin run python test.py - run: spin run -- pytest --doctest-glob='*.rst' doc/source - run: spin docs diff --git a/test.py b/test.py new file mode 100644 index 00000000..0279a03a --- /dev/null +++ b/test.py @@ -0,0 +1,6 @@ +from flint.types._gr import gr_fmpzi_ctx, gr_gr_mpoly_ctx +ctx = gr_gr_mpoly_ctx.new(gr_fmpzi_ctx, ["x", "y"]) +print(repr(ctx.gens())) +x, y = ctx.gens() +p = (x + y)**2 +print(repr(p)) From 66840dd28c9a9aa1d3f29f931473ffe4b426da4d Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Mon, 15 Jun 2026 10:26:11 +0200 Subject: [PATCH 02/17] remove cancel-in-progress --- .github/workflows/buildwheel.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index fdfbe3e2..174d1bc7 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -4,7 +4,6 @@ on: [push, pull_request] concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true permissions: contents: read From 77c5f11124d653e7211d17b7099b7f3cb6e519cc Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Mon, 15 Jun 2026 10:34:48 +0200 Subject: [PATCH 03/17] remove concurrency block --- .github/workflows/buildwheel.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index 174d1bc7..eadc91fe 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -2,9 +2,6 @@ name: Build on: [push, pull_request] -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - permissions: contents: read From e2823ef870d15671dd9b9a260902f82e35f85a98 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Mon, 15 Jun 2026 12:45:11 +0200 Subject: [PATCH 04/17] Add C version to test crash --- .github/workflows/buildwheel.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index eadc91fe..9d221282 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -268,6 +268,8 @@ jobs: - run: bin/install_latest_flint_ubuntu.sh - run: pip install --upgrade pip - run: pip install -r requirements-dev.txt + - run: gcc test.c -l flint -o test.exe + - run: ./test.exe - run: spin run python test.py - run: spin run -- pytest --doctest-glob='*.rst' doc/source - run: spin docs From 0063065ca771a7bd4b7be3d36a5518b4ded26ee5 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Mon, 15 Jun 2026 12:50:47 +0200 Subject: [PATCH 05/17] Add C file --- test.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 test.c diff --git a/test.c b/test.c new file mode 100644 index 00000000..c77a2d03 --- /dev/null +++ b/test.c @@ -0,0 +1,52 @@ +#include "flint/mpoly.h" +#include "flint/gr.h" +#include "flint/gr_mpoly.h" + +int main(int argc, char *argv[]) +{ + int err; + const char *names[] = {"x", "y"}; + char *pretty; + gr_ptr x, y, r1, r2; + + gr_ctx_t ctx_fmpzi, ctx_mpoly; + gr_ctx_init_fmpzi(ctx_fmpzi); + gr_ctx_init_gr_mpoly(ctx_mpoly, ctx_fmpzi, 2, ORD_LEX); + err = gr_ctx_set_gen_names(ctx_mpoly, names); + if(err != GR_SUCCESS) { + printf("Cannot set generator names\n"); + return 0; + } + + GR_TMP_INIT4(x, y, r1, r2, ctx_mpoly); + + gr_vec_t gens; + gr_vec_init(gens, 0, ctx_mpoly); + err = gr_gens(gens, ctx_mpoly); + if(err != GR_SUCCESS) { + printf("Cannot get generators\n"); + return 0; + } + err |= gr_set(x, gr_vec_entry_ptr(gens, 0, ctx_mpoly), ctx_mpoly); + err |= gr_set(y, gr_vec_entry_ptr(gens, 1, ctx_mpoly), ctx_mpoly); + gr_vec_clear(gens, ctx_mpoly); + + err |= gr_add(r1, x, y, ctx_mpoly); + err |= gr_pow_si(r2, r1, 2, ctx_mpoly); + + if(err != GR_SUCCESS) { + printf("Arithmetic failed\n"); + return 0; + } + + err = gr_get_str(&pretty, r2, ctx_mpoly); + + if(err != GR_SUCCESS) { + printf("Pretty printing failed\n"); + return 0; + } + + printf("(x + y)^2 = %s\n", pretty); + + return 0; +} From c05d8f19908829b3d0466e79d442a8b098531bfe Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Mon, 15 Jun 2026 13:02:34 +0200 Subject: [PATCH 06/17] random change - trigger 1 --- test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.c b/test.c index c77a2d03..81d79d78 100644 --- a/test.c +++ b/test.c @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) if(err != GR_SUCCESS) { printf("Arithmetic failed\n"); - return 0; + return 1; } err = gr_get_str(&pretty, r2, ctx_mpoly); From ae9366da9c81adf1dc93d2fb982b9fdc4c974bdb Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Mon, 15 Jun 2026 13:14:31 +0200 Subject: [PATCH 07/17] random change - trigger 2 --- test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.c b/test.c index 81d79d78..0536a1af 100644 --- a/test.c +++ b/test.c @@ -15,7 +15,7 @@ int main(int argc, char *argv[]) err = gr_ctx_set_gen_names(ctx_mpoly, names); if(err != GR_SUCCESS) { printf("Cannot set generator names\n"); - return 0; + return 1; } GR_TMP_INIT4(x, y, r1, r2, ctx_mpoly); From 88c7571fd5a0064c599a37e949fd7ba3be655269 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Mon, 15 Jun 2026 13:15:36 +0200 Subject: [PATCH 08/17] random change 3 --- test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.c b/test.c index 0536a1af..89603ee4 100644 --- a/test.c +++ b/test.c @@ -25,7 +25,7 @@ int main(int argc, char *argv[]) err = gr_gens(gens, ctx_mpoly); if(err != GR_SUCCESS) { printf("Cannot get generators\n"); - return 0; + return 1; } err |= gr_set(x, gr_vec_entry_ptr(gens, 0, ctx_mpoly), ctx_mpoly); err |= gr_set(y, gr_vec_entry_ptr(gens, 1, ctx_mpoly), ctx_mpoly); From 3306facefd913fc998e17d133baefc3097e459cf Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Mon, 15 Jun 2026 13:22:40 +0200 Subject: [PATCH 09/17] remove many CI jobs --- .github/workflows/buildwheel.yml | 49 ++------------------------------ 1 file changed, 3 insertions(+), 46 deletions(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index 9d221282..ba149837 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -22,47 +22,12 @@ jobs: fail-fast: false matrix: include: - - name: Build manylinux x86-64 wheels - os: ubuntu-22.04 - kind: native - artifact_name: wheels-ubuntu-22.04 - cibw_platform: auto - cibw_build: "*" - - name: Build manylinux arm64 wheels - os: ubuntu-22.04-arm - kind: native - artifact_name: wheels-ubuntu-22.04-arm - cibw_platform: auto - cibw_build: "*" - - name: Build Windows x86-64 wheels - os: windows-2022 - kind: native - artifact_name: wheels-windows-2022 - cibw_platform: auto - cibw_build: "*" - - name: Build Windows arm64 wheels - os: windows-11-arm - kind: native - artifact_name: wheels-windows-11-arm - cibw_platform: auto - cibw_build: "*" - - name: Build macOS x86-64 wheels - os: macos-15-intel - kind: native - artifact_name: wheels-macos-15-intel - cibw_platform: auto - cibw_build: "*" - name: Build macOS arm64 wheels os: macos-14 kind: native artifact_name: wheels-macos-14 cibw_platform: auto cibw_build: "*" - - name: Build Pyodide wheels - os: ubuntu-22.04 - kind: pyodide - artifact_name: wheels-pyodide - cibw_platform: pyodide steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 @@ -168,18 +133,10 @@ jobs: fail-fast: false matrix: os: [ - ubuntu-22.04, - ubuntu-24.04, - ubuntu-24.04-arm, - windows-2022, - windows-2025, - windows-11-arm, - macos-15-intel, - macos-14, macos-15, ] # This list to be kept in sync with python-requires in pyproject.toml. - python-version: ['3.11', '3.12', '3.13', '3.13t', '3.14', '3.14t', 'pypy3.11'] + python-version: ['3.11'] exclude: - os: windows-11-arm python-version: pypy3.11 @@ -306,7 +263,7 @@ jobs: fail-fast: false matrix: # Supported Flint versions: - flint-tag: ['v3.0.1', 'v3.1.3-p1', 'v3.2.2', 'v3.3.1'] + flint-tag: ['v3.0.1'] steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: @@ -391,7 +348,7 @@ jobs: strategy: fail-fast: false matrix: - sympy-version: ['1.13.1', '1.14.0'] + sympy-version: ['1.13.1'] steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: From 41995b1919d868b141779abe4560d23d40e774cc Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Mon, 15 Jun 2026 13:49:50 +0200 Subject: [PATCH 10/17] remove more CI jobs --- .github/workflows/buildwheel.yml | 207 +------------------------------ 1 file changed, 4 insertions(+), 203 deletions(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index ba149837..36888969 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -162,59 +162,12 @@ jobs: - run: python -m flint.test --verbose - test_pyodide: - needs: build_wheels - name: Test Pyodide wheel - runs-on: ubuntu-22.04 - permissions: {} - - steps: - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.PYODIDE_PYTHON_VERSION }} - - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - with: - node-version: '22' - - - run: pip install pyodide-build - - run: pyodide xbuildenv install "$PYODIDE_VERSION" - - - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: wheels-pyodide - path: wheelhouse - - - run: | - pyodide venv .venv-pyodide - source .venv-pyodide/bin/activate - pip install wheelhouse/*.whl - pip install pytest hypothesis - python -m pytest -svra -p no:cacheprovider --pyargs flint - - # On new enough Ubuntu we can build against the system deb. - test_pip_flint_deb: - name: Build on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-24.04] - steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: '3.13' - - run: sudo apt-get update - - run: sudo apt-get install libflint-dev - - run: pip install . - - run: python -m flint.test --verbose - test_docs: - name: Test docs (build and doctest) + name: Test docs (build and doctest) {{ matrix.number }} runs-on: ubuntu-24.04 + matrix: + number: + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: @@ -231,158 +184,6 @@ jobs: - run: spin run -- pytest --doctest-glob='*.rst' doc/source - run: spin docs - # Test build with minimum Cython and meson-python versions. - test_old_build_requires: - name: 'Test old Cython/meson-python' - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: '3.13' - - run: sudo apt-get update - - run: sudo apt-get install libflint-dev - # The versions of cython and meson-python here should be kept in sync - # with those in pyproject.toml so that we test the stated minimum - # versions. - # - # We don't need to specify ninja as a requirement in pyproject.toml - # because without --no-build-isolation meson-python handles it - # automatically in get_requirements_for_build_wheel(). - - run: 'pip install "cython==3.0.11" "meson-python==0.18" "ninja<1.11"' - - run: pip install --no-build-isolation . - - run: python -m flint.test --verbose - - # For older Ubuntu we have to build Flint >= 3.0.0 - test_flint_releases: - name: Test flint ${{ matrix.flint-tag }} - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - # Supported Flint versions: - flint-tag: ['v3.0.1'] - steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: '3.13' - - env: - FLINT_TAG: ${{ matrix.flint-tag }} - run: bin/install_flint_ubuntu.sh "$FLINT_TAG" - - run: pip install . - - run: python -m flint.test --verbose - - # Test against flint main - test_flint_main: - name: Test flint main Linux x86-64 - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: '3.13' - - run: bin/install_flint_ubuntu.sh main - # Need to disable flint version check to build against main - - run: pip install --config-settings=setup-args="-Dflint_version_check=false" . - - run: python -m flint.test --verbose - - # Test against flint main - test_flint_main_arm: - name: Test flint main Linux ARM - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: '3.13' - - run: bin/install_flint_ubuntu.sh main - # Need to disable flint version check to build against main - - run: pip install --config-settings=setup-args="-Dflint_version_check=false" . - - run: python -m flint.test --verbose - - # Test that we can make a coverage build and report coverage - test_coverage_build_setuptools: - name: Test coverage setuptools build - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: '3.13' - - run: sudo apt-get update - - run: sudo apt-get install libflint-dev - - run: pip install -r requirements-dev.txt - - run: bin/coverage_setuptools.sh - - # Test that we can make a coverage build and report coverage - test_coverage_build_meson: - name: Test coverage meson build - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: '3.12' # does not work with 3.13 - - run: sudo apt-get update - - run: sudo apt-get install libflint-dev - - run: pip install -r requirements-dev.txt - - run: bin/coverage.sh - - # Run SymPy test suite against python-flint master - test_sympy: - name: Test SymPy ${{ matrix.sympy-version }} - runs-on: ubuntu-24.04 - strategy: - fail-fast: false - matrix: - sympy-version: ['1.13.1'] - steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: '3.13' - - run: sudo apt-get update - - run: sudo apt-get install libflint-dev - - run: pip install . - - run: pip install pytest pytest-xdist hypothesis - - env: - SYMPY_VERSION: ${{ matrix.sympy-version }} - run: pip install "sympy==$SYMPY_VERSION" - - run: python -c 'import sympy; sympy.test(parallel=True)' - - # Run SymPy master branch agains python-flint main - test_sympy_master: - name: Test SymPy master - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: '3.13' - - run: sudo apt-get update - - run: sudo apt-get install libflint-dev - - run: pip install . - - run: pip install pytest pytest-xdist hypothesis - - run: pip install git+https://github.com/sympy/sympy.git@master - - run: python -c 'import sympy; sympy.test(parallel=True)' - # Push nightly wheels to Anaconda scientific-python nightly channel # https://scientific-python.org/specs/spec-0004/ # https://anaconda.org/scientific-python-nightly-wheels/python-flint From 9d10d423ce5b3e53be1c3a326cf042f08e19e0ab Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Mon, 15 Jun 2026 13:53:42 +0200 Subject: [PATCH 11/17] fix GA workflow --- .github/workflows/buildwheel.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index 36888969..cfc83035 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -165,9 +165,11 @@ jobs: test_docs: name: Test docs (build and doctest) {{ matrix.number }} runs-on: ubuntu-24.04 - matrix: - number: - [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + strategy: + fail-fast: false + matrix: + number: + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: From d413c00c198bff45b464eaaa4070a215407f8929 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Mon, 15 Jun 2026 14:15:59 +0200 Subject: [PATCH 12/17] Add prints --- test.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test.c b/test.c index 89603ee4..797bc637 100644 --- a/test.c +++ b/test.c @@ -1,7 +1,11 @@ +#include + #include "flint/mpoly.h" #include "flint/gr.h" #include "flint/gr_mpoly.h" +#define TRACE(n) do { printf("TRACE %d\n", (n)); fflush(stdout); } while (0) + int main(int argc, char *argv[]) { int err; @@ -10,43 +14,75 @@ int main(int argc, char *argv[]) gr_ptr x, y, r1, r2; gr_ctx_t ctx_fmpzi, ctx_mpoly; + TRACE(1); gr_ctx_init_fmpzi(ctx_fmpzi); + TRACE(2); gr_ctx_init_gr_mpoly(ctx_mpoly, ctx_fmpzi, 2, ORD_LEX); + TRACE(3); err = gr_ctx_set_gen_names(ctx_mpoly, names); + TRACE(4); if(err != GR_SUCCESS) { + TRACE(5); printf("Cannot set generator names\n"); + fflush(stdout); + TRACE(6); return 1; } + TRACE(7); GR_TMP_INIT4(x, y, r1, r2, ctx_mpoly); + TRACE(8); gr_vec_t gens; + TRACE(9); gr_vec_init(gens, 0, ctx_mpoly); + TRACE(10); err = gr_gens(gens, ctx_mpoly); + TRACE(11); if(err != GR_SUCCESS) { + TRACE(12); printf("Cannot get generators\n"); + fflush(stdout); + TRACE(13); return 1; } + TRACE(14); err |= gr_set(x, gr_vec_entry_ptr(gens, 0, ctx_mpoly), ctx_mpoly); + TRACE(15); err |= gr_set(y, gr_vec_entry_ptr(gens, 1, ctx_mpoly), ctx_mpoly); + TRACE(16); gr_vec_clear(gens, ctx_mpoly); + TRACE(17); err |= gr_add(r1, x, y, ctx_mpoly); + TRACE(18); err |= gr_pow_si(r2, r1, 2, ctx_mpoly); + TRACE(19); if(err != GR_SUCCESS) { + TRACE(20); printf("Arithmetic failed\n"); + fflush(stdout); + TRACE(21); return 1; } + TRACE(22); err = gr_get_str(&pretty, r2, ctx_mpoly); + TRACE(23); if(err != GR_SUCCESS) { + TRACE(24); printf("Pretty printing failed\n"); + fflush(stdout); + TRACE(25); return 0; } + TRACE(26); printf("(x + y)^2 = %s\n", pretty); + fflush(stdout); + TRACE(27); return 0; } From 6ff054e574c417f0a1a085112faa42fe4058473b Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Mon, 15 Jun 2026 14:26:04 +0200 Subject: [PATCH 13/17] simplify test program --- test.c | 76 ++++------------------------------------------------------ 1 file changed, 4 insertions(+), 72 deletions(-) diff --git a/test.c b/test.c index 797bc637..e24c4665 100644 --- a/test.c +++ b/test.c @@ -8,81 +8,13 @@ int main(int argc, char *argv[]) { - int err; - const char *names[] = {"x", "y"}; - char *pretty; - gr_ptr x, y, r1, r2; + gr_ctx_t ctx_fmpzi; - gr_ctx_t ctx_fmpzi, ctx_mpoly; - TRACE(1); - gr_ctx_init_fmpzi(ctx_fmpzi); - TRACE(2); - gr_ctx_init_gr_mpoly(ctx_mpoly, ctx_fmpzi, 2, ORD_LEX); - TRACE(3); - err = gr_ctx_set_gen_names(ctx_mpoly, names); - TRACE(4); - if(err != GR_SUCCESS) { - TRACE(5); - printf("Cannot set generator names\n"); - fflush(stdout); - TRACE(6); - return 1; - } - TRACE(7); - - GR_TMP_INIT4(x, y, r1, r2, ctx_mpoly); - TRACE(8); - - gr_vec_t gens; - TRACE(9); - gr_vec_init(gens, 0, ctx_mpoly); - TRACE(10); - err = gr_gens(gens, ctx_mpoly); - TRACE(11); - if(err != GR_SUCCESS) { - TRACE(12); - printf("Cannot get generators\n"); - fflush(stdout); - TRACE(13); - return 1; - } - TRACE(14); - err |= gr_set(x, gr_vec_entry_ptr(gens, 0, ctx_mpoly), ctx_mpoly); - TRACE(15); - err |= gr_set(y, gr_vec_entry_ptr(gens, 1, ctx_mpoly), ctx_mpoly); - TRACE(16); - gr_vec_clear(gens, ctx_mpoly); - TRACE(17); - - err |= gr_add(r1, x, y, ctx_mpoly); - TRACE(18); - err |= gr_pow_si(r2, r1, 2, ctx_mpoly); - TRACE(19); + printf("before...\n"); fflush(stdout); - if(err != GR_SUCCESS) { - TRACE(20); - printf("Arithmetic failed\n"); - fflush(stdout); - TRACE(21); - return 1; - } - TRACE(22); - - err = gr_get_str(&pretty, r2, ctx_mpoly); - TRACE(23); - - if(err != GR_SUCCESS) { - TRACE(24); - printf("Pretty printing failed\n"); - fflush(stdout); - TRACE(25); - return 0; - } - TRACE(26); + gr_ctx_init_fmpzi(ctx_fmpzi); - printf("(x + y)^2 = %s\n", pretty); - fflush(stdout); - TRACE(27); + printf("...after\n"); fflush(stdout); return 0; } From 937b5fd36c413491618688d05d98f07263963f81 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Mon, 15 Jun 2026 14:34:13 +0200 Subject: [PATCH 14/17] remove unnecessary steps --- .github/workflows/buildwheel.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index cfc83035..0f3030db 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -172,19 +172,9 @@ jobs: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: '3.13' - run: bin/install_latest_flint_ubuntu.sh - - run: pip install --upgrade pip - - run: pip install -r requirements-dev.txt - run: gcc test.c -l flint -o test.exe - run: ./test.exe - - run: spin run python test.py - - run: spin run -- pytest --doctest-glob='*.rst' doc/source - - run: spin docs # Push nightly wheels to Anaconda scientific-python nightly channel # https://scientific-python.org/specs/spec-0004/ From 46c3bac7fd3addf0909ab768475efe579ac53337 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Mon, 15 Jun 2026 14:48:17 +0200 Subject: [PATCH 15/17] Use FLINT main branch in doctest --- bin/install_latest_flint_ubuntu.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/install_latest_flint_ubuntu.sh b/bin/install_latest_flint_ubuntu.sh index 0006b792..9d7f30a6 100755 --- a/bin/install_latest_flint_ubuntu.sh +++ b/bin/install_latest_flint_ubuntu.sh @@ -7,9 +7,8 @@ source bin/build_variables.sh sudo apt-get update sudo apt-get install libgmp-dev libmpfr-dev xz-utils ninja-build -curl -O -L https://github.com/flintlib/flint/releases/download/v$FLINTVER/flint-$FLINTVER.tar.gz -tar -xzf flint-$FLINTVER.tar.gz -cd flint-$FLINTVER && ./configure --disable-static && make -j$(expr $(nproc) + 1) && sudo make install +git clone https://github.com/flintlib/flint +cd flint && ./bootstrap.sh && ./configure --disable-static && make -j$(expr $(nproc) + 1) && sudo make install ls -l /usr/local/lib sudo ldconfig /usr/local/lib From 93aeba4dea6d97635245f200ecab069a026b591b Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Mon, 15 Jun 2026 15:12:36 +0200 Subject: [PATCH 16/17] Use FLINT 3.5.0 --- bin/build_variables.sh | 2 +- bin/install_latest_flint_ubuntu.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/build_variables.sh b/bin/build_variables.sh index 256f4d84..bb21c9fc 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.4.0 +FLINTVER=3.5.0 diff --git a/bin/install_latest_flint_ubuntu.sh b/bin/install_latest_flint_ubuntu.sh index 9d7f30a6..0006b792 100755 --- a/bin/install_latest_flint_ubuntu.sh +++ b/bin/install_latest_flint_ubuntu.sh @@ -7,8 +7,9 @@ source bin/build_variables.sh sudo apt-get update sudo apt-get install libgmp-dev libmpfr-dev xz-utils ninja-build -git clone https://github.com/flintlib/flint -cd flint && ./bootstrap.sh && ./configure --disable-static && make -j$(expr $(nproc) + 1) && sudo make install +curl -O -L https://github.com/flintlib/flint/releases/download/v$FLINTVER/flint-$FLINTVER.tar.gz +tar -xzf flint-$FLINTVER.tar.gz +cd flint-$FLINTVER && ./configure --disable-static && make -j$(expr $(nproc) + 1) && sudo make install ls -l /usr/local/lib sudo ldconfig /usr/local/lib From a151d9238709b294c6ee7860a4b9261b5495b5c5 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Mon, 15 Jun 2026 15:19:33 +0200 Subject: [PATCH 17/17] add back removed steps --- .github/workflows/buildwheel.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index 0f3030db..cfc83035 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -172,9 +172,19 @@ jobs: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + with: + persist-credentials: false + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + with: + python-version: '3.13' - run: bin/install_latest_flint_ubuntu.sh + - run: pip install --upgrade pip + - run: pip install -r requirements-dev.txt - run: gcc test.c -l flint -o test.exe - run: ./test.exe + - run: spin run python test.py + - run: spin run -- pytest --doctest-glob='*.rst' doc/source + - run: spin docs # Push nightly wheels to Anaconda scientific-python nightly channel # https://scientific-python.org/specs/spec-0004/