From fc2411620f63ff0d489b1a952f4f158f87fdc3e6 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 11:34:05 +0100 Subject: [PATCH 01/18] Test: require Flint >= 3.1, < 3.2 See if the fails the build in CI... --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index fd2f7950..9ab8f44a 100644 --- a/meson.build +++ b/meson.build @@ -7,7 +7,7 @@ cc = meson.get_compiler('c') gmp_dep = dependency('gmp') mpfr_dep = dependency('mpfr') -flint_dep = dependency('flint') +flint_dep = dependency('flint', version: ['>=3.1', '<3.2']) add_project_arguments( '-X', 'embedsignature=True', From 07ed9cdabe3c4903b2b79a1831bedf7107a8d1bb Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 11:41:01 +0100 Subject: [PATCH 02/18] Set the minimum Flint version back to 3.0 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 9ab8f44a..cbcb0fa5 100644 --- a/meson.build +++ b/meson.build @@ -7,7 +7,7 @@ cc = meson.get_compiler('c') gmp_dep = dependency('gmp') mpfr_dep = dependency('mpfr') -flint_dep = dependency('flint', version: ['>=3.1', '<3.2']) +flint_dep = dependency('flint', version: ['>=3.0', '<3.2']) add_project_arguments( '-X', 'embedsignature=True', From 8f66092d7d93c950acc3b887f2de244fdcae89cf Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 12:20:09 +0100 Subject: [PATCH 03/18] Add an option to disable Flint version check --- meson.build | 21 ++++++++++++++++++++- meson.options | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index cbcb0fa5..f1f5e681 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,24 @@ project('python-flint', 'cython', 'c') +# +# For the source release, we should by default fail for newer versions of Flint +# that are untested with a nice error message: +# +# ../meson.build:10:12: +# ERROR: Dependency lookup for flint with method 'pkgconfig' failed: +# Invalid version, need 'flint' ['<3.2'] found '3.2.0'. +# +# We need an option to disable this though so that we can test newer versions +# of Flint. Also good to have an escape hatch for users since we don't know +# that future versions of Flint will not work. +# +if get_option('flint_version_check') + flint_version_required = ['>=3.0', '<3.2'] +else + # We do know that Flint < 3.0 will not work so no point allowing it. + flint_version_required = ['>=3.0'] +endif + py = import('python').find_installation(pure: false) dep_py = py.dependency() @@ -7,7 +26,7 @@ cc = meson.get_compiler('c') gmp_dep = dependency('gmp') mpfr_dep = dependency('mpfr') -flint_dep = dependency('flint', version: ['>=3.0', '<3.2']) +flint_dep = dependency('flint', version: flint_version_required) add_project_arguments( '-X', 'embedsignature=True', diff --git a/meson.options b/meson.options index 4c96f71d..efaf420c 100644 --- a/meson.options +++ b/meson.options @@ -1,2 +1,3 @@ option('coverage', type : 'boolean', value : false, description : 'enable coverage build') option('add_flint_rpath', type : 'boolean', value : false) +option('flint_version_check', type: 'boolean', value : true) From 99058229ed73797d5a0c2ee7512c5152a6b57ceb Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 12:31:29 +0100 Subject: [PATCH 04/18] Disable Flint version check to test against main --- .github/workflows/buildwheel.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index a285cfed..24b870a0 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -181,7 +181,7 @@ jobs: fail-fast: false matrix: # Supported versions and latest git - flint-tag: ['v3.0.0', 'v3.0.1', 'v3.1.0', 'v3.1.1', 'v3.1.2', 'main'] + flint-tag: ['v3.0.0', 'v3.0.1', 'v3.1.0', 'v3.1.1', 'v3.1.2'] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -191,6 +191,24 @@ jobs: - run: pip install . - run: python -m flint.test --verbose + # Test against flint main (with disabled version check) + test_flint_versions: + name: Test flint ${{ matrix.flint-tag }} + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + # Supported versions and latest git + flint-tag: ['main'] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - run: bin/install_flint_ubuntu.sh ${{ matrix.flint-tag }} + - run: pip install --config-settings=setup-args="-Dflint_version_check=false" . + - run: python -m flint.test --verbose + # Deploy wheels and sdist to PyPI pypi_release: From 3167e1316eee0ad8c901cef5082bacdf5f405da5 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 12:35:45 +0100 Subject: [PATCH 05/18] Fix workflow syntax --- .github/workflows/buildwheel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index 24b870a0..3486c621 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -174,7 +174,7 @@ jobs: - run: python -c 'import sympy; sympy.test(parallel=True)' # For older Ubuntu we have to build Flint >= 3.0.0 - test_flint_versions: + test_flint_releases: name: Test flint ${{ matrix.flint-tag }} runs-on: ubuntu-22.04 strategy: @@ -192,7 +192,7 @@ jobs: - run: python -m flint.test --verbose # Test against flint main (with disabled version check) - test_flint_versions: + test_flint_main: name: Test flint ${{ matrix.flint-tag }} runs-on: ubuntu-22.04 strategy: From 8abca1811407756f101427970f5f1c2770138635 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 12:58:29 +0100 Subject: [PATCH 06/18] Add and test minimum Cython/meson-python build requires --- .github/workflows/buildwheel.yml | 70 ++++++++++++++++++++------------ pyproject.toml | 3 +- 2 files changed, 46 insertions(+), 27 deletions(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index 3486c621..2d6cee44 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -138,29 +138,10 @@ jobs: - run: pip install . - run: python -m flint.test --verbose - # Test that we can still make a coverage build with setuptools. - test_coverage_setuptools: - name: Test coverage setuptools build - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - run: sudo apt-get update - - run: sudo apt-get install libflint-dev - - run: pip install git+https://github.com/oscarbenjamin/cython.git@pr_relative_paths - - 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 }} + # Test build with minimum Cython and meson-python versions. + test_old_build_requires: + name: 'Test old Cython/meson-python' runs-on: ubuntu-24.04 - strategy: - fail-fast: false - matrix: - sympy-version: ['1.13.1'] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -168,10 +149,10 @@ jobs: python-version: '3.12' - 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 sympy==${{ matrix.sympy-version }} - - run: python -c 'import sympy; sympy.test(parallel=True)' + # The versions here should be kept in sync with pyproject.toml. + - run: 'pip install cython==3.0 meson-python==0.13' + - 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: @@ -209,6 +190,43 @@ jobs: - 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_setuptools: + name: Test coverage setuptools build + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - run: sudo apt-get update + - run: sudo apt-get install libflint-dev + # This is branch is for a Cython PR: + # https://github.com/cython/cython/pull/6341 + - run: pip install git+https://github.com/oscarbenjamin/cython.git@pr_relative_paths + - 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@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - 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 sympy==${{ matrix.sympy-version }} + - run: python -c 'import sympy; sympy.test(parallel=True)' + # Deploy wheels and sdist to PyPI pypi_release: diff --git a/pyproject.toml b/pyproject.toml index c4f167ee..f7038e21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,6 @@ [build-system] -requires = ["meson-python", "cython"] +# Minimum build requirements tested in CI need to be kept in sync with this. +requires = ["meson-python>=0.13", "cython>=3.0"] build-backend = "mesonpy" [project] From 8b6f3d5f9eba8db324de254f2a6a21c029176235 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 13:11:40 +0100 Subject: [PATCH 07/18] Use newer meson-python... --- .github/workflows/buildwheel.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index 2d6cee44..fda24335 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -150,7 +150,10 @@ jobs: - run: sudo apt-get update - run: sudo apt-get install libflint-dev # The versions here should be kept in sync with pyproject.toml. - - run: 'pip install cython==3.0 meson-python==0.13' + # Not sure if ninja should be listed as a requirement in pyproject.toml + # as with newer meson-python it does not seem to be needed but this CI + # job would fail without it being installed explicitly here... + - run: 'pip install cython==3.0 meson-python' - run: pip install --no-build-isolation . - run: python -m flint.test --verbose From c90667f8be5e1ccfbf3180894c3c4726cbea217f Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 13:48:04 +0100 Subject: [PATCH 08/18] Install ninja in CI job --- .github/workflows/buildwheel.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index fda24335..de428f0d 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -149,11 +149,14 @@ jobs: python-version: '3.12' - run: sudo apt-get update - run: sudo apt-get install libflint-dev - # The versions here should be kept in sync with pyproject.toml. - # Not sure if ninja should be listed as a requirement in pyproject.toml - # as with newer meson-python it does not seem to be needed but this CI - # job would fail without it being installed explicitly here... - - run: 'pip install cython==3.0 meson-python' + # 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 meson-python==0.13 ninja==1.8.2' - run: pip install --no-build-isolation . - run: python -m flint.test --verbose From 4828932489ef41f1f332652c228e5f1ba8e59bfa Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 13:53:02 +0100 Subject: [PATCH 09/18] Use ninja 1.9.0 --- .github/workflows/buildwheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index de428f0d..9ca6752e 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -156,7 +156,7 @@ jobs: # 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 meson-python==0.13 ninja==1.8.2' + - run: 'pip install cython==3.0 meson-python==0.13 ninja==1.9.0' - run: pip install --no-build-isolation . - run: python -m flint.test --verbose From 0ba2cba27d40f457a9e67308a33967411d64396c Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 13:56:30 +0100 Subject: [PATCH 10/18] Use ninja 1.0 --- .github/workflows/buildwheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index 9ca6752e..25527fe3 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -156,7 +156,7 @@ jobs: # 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 meson-python==0.13 ninja==1.9.0' + - run: 'pip install cython==3.0 meson-python==0.13 ninja==1.10' - run: pip install --no-build-isolation . - run: python -m flint.test --verbose From 3b349b9ab923f59715fcd7f0b2ca78154805f523 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 13:58:43 +0100 Subject: [PATCH 11/18] Use ninja<1.11 as the constraint. --- .github/workflows/buildwheel.yml | 2 +- pyproject.toml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index 25527fe3..66022300 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -156,7 +156,7 @@ jobs: # 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 meson-python==0.13 ninja==1.10' + - run: 'pip install cython==3.0 meson-python==0.13 ninja<1.11' - run: pip install --no-build-isolation . - run: python -m flint.test --verbose diff --git a/pyproject.toml b/pyproject.toml index f7038e21..13f5c3b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,3 @@ -[build-system] -# Minimum build requirements tested in CI need to be kept in sync with this. -requires = ["meson-python>=0.13", "cython>=3.0"] -build-backend = "mesonpy" - [project] name = "python-flint" description = "Bindings for FLINT and Arb" @@ -20,6 +15,11 @@ classifiers = [ file = "README.md" content-type = "text/markdown" +[build-system] +# Minimum build requirements tested in CI need to be kept in sync with this. +requires = ["meson-python>=0.13", "cython>=3.0"] +build-backend = "mesonpy" + [tool.spin] package = "flint" From 354629e1d423a81a64954fe3c4f8d4d5195ef63c Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 14:16:22 +0100 Subject: [PATCH 12/18] Escape strings in yml --- .github/workflows/buildwheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index 66022300..b3ce109a 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -156,7 +156,7 @@ jobs: # 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 meson-python==0.13 ninja<1.11' + - run: 'pip install "cython==3.0" "meson-python==0.13" "ninja<1.11"' - run: pip install --no-build-isolation . - run: python -m flint.test --verbose From 2e597164915e53bde63e804d00c68814e42c5b38 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 14:42:59 +0100 Subject: [PATCH 13/18] Add an upper cap on Cython --- pyproject.toml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 13f5c3b3..0a5fa5b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,8 +16,20 @@ file = "README.md" content-type = "text/markdown" [build-system] -# Minimum build requirements tested in CI need to be kept in sync with this. -requires = ["meson-python>=0.13", "cython>=3.0"] +# +# Minimum build requirements tested in CI need to be kept in sync with the +# versions in requires below so that they are tested. +# +# The upper cap on Cython is speculative but we may as well cap it given that +# it is only a build requirement and that it is not uncommon for newer Cython +# versions to break the build. For example Cython 3.0 broke the build and then +# Cython 3.1 broke the build again so python-flint 0.6.0 did not have any upper +# cap but it should have had cython>=3.0,<3.1 i.e. precisely one minor release +# of Cython works. In future we could contemplate not having an upper cap but +# until we have actually witnessed a Cython 3.x release that does not break the +# build we should keep the upper cap. +# +requires = ["meson-python>=0.13", "cython>=3.0,<3.1"] build-backend = "mesonpy" [tool.spin] From 9e24c16c966de535987c5647251a92bbebd1688d Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 15:35:19 +0100 Subject: [PATCH 14/18] Add requires-python >= 3.9 sinve 3.8 is untested --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0a5fa5b8..385b2412 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,8 @@ [project] name = "python-flint" -description = "Bindings for FLINT and Arb" +description = "Bindings for FLINT" version = "0.7.0a4" +requires-python = ">= 3.9" urls = {Homepage = "https://github.com/flintlib/python-flint"} authors = [ {name = "Fredrik Johansson", email = "fredrik.johansson@gmail.com"}, @@ -54,6 +55,8 @@ package = "flint" ] [tool.cibuildwheel] +# requires-python needs to keep in sync with this and also the list of Python +# versions the wheels are tested against in CI. build = "cp39-* cp310-* cp311-* cp312-*" skip = "*-win32 *-manylinux_i686 *-musllinux_*" manylinux-x86_64-image = "manylinux2014" From 0569518c20fa2c4950dca8394b56b7e7a7e8913d Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 15:36:40 +0100 Subject: [PATCH 15/18] Add Python 3.13 to the build matrix --- .github/workflows/buildwheel.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index b3ce109a..d05afbd7 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -107,7 +107,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-20.04, windows-2019, macos-13, macos-14] - python-version: ['3.9', '3.10', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13-dev'] steps: - uses: actions/setup-python@v5 diff --git a/pyproject.toml b/pyproject.toml index 385b2412..941cab1f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,7 @@ package = "flint" [tool.cibuildwheel] # requires-python needs to keep in sync with this and also the list of Python # versions the wheels are tested against in CI. -build = "cp39-* cp310-* cp311-* cp312-*" +build = "cp39-* cp310-* cp311-* cp312-* cp313-*" skip = "*-win32 *-manylinux_i686 *-musllinux_*" manylinux-x86_64-image = "manylinux2014" manylinux-i686-image = "manylinux2014" From 26f2b4b1e2dab1adf85ff36babbe71495db55a93 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 15:59:16 +0100 Subject: [PATCH 16/18] Cleanup in buildwheel.yml --- .github/workflows/buildwheel.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index d05afbd7..162eb408 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -42,7 +42,7 @@ jobs: if: ${{ matrix.os == 'windows-2019' }} - name: Build wheels - uses: pypa/cibuildwheel@v2.19.2 + uses: pypa/cibuildwheel@v2.20.0 env: # override setting in pyproject.toml to use msys2 instead of msys64 bash CIBW_BEFORE_ALL_WINDOWS: msys2 -c bin/cibw_before_all_windows.sh @@ -167,7 +167,7 @@ jobs: strategy: fail-fast: false matrix: - # Supported versions and latest git + # Supported Flint versions: flint-tag: ['v3.0.0', 'v3.0.1', 'v3.1.0', 'v3.1.1', 'v3.1.2'] steps: - uses: actions/checkout@v4 @@ -178,26 +178,22 @@ jobs: - run: pip install . - run: python -m flint.test --verbose - # Test against flint main (with disabled version check) + # Test against flint main test_flint_main: - name: Test flint ${{ matrix.flint-tag }} + name: Test flint main runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - # Supported versions and latest git - flint-tag: ['main'] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.12' - - run: bin/install_flint_ubuntu.sh ${{ matrix.flint-tag }} + - 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_setuptools: + test_coverage_build: name: Test coverage setuptools build runs-on: ubuntu-24.04 steps: From 3bdb5f1bce9a86fa2650ac8688bf0710cba341d2 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 16:51:20 +0100 Subject: [PATCH 17/18] Improve error message about upper Flint cap --- meson.build | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/meson.build b/meson.build index f1f5e681..b278fa3c 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,17 @@ project('python-flint', 'cython', 'c') +py = import('python').find_installation(pure: false) +dep_py = py.dependency() + +cc = meson.get_compiler('c') + +flint_ver_lower = '3.0' # >=3.0 +flint_ver_upper = '3.2' # <3.2 + +gmp_dep = dependency('gmp') +mpfr_dep = dependency('mpfr') +flint_dep = dependency('flint', version: ['>=' + flint_ver_lower]) + # # For the source release, we should by default fail for newer versions of Flint # that are untested with a nice error message: @@ -13,20 +25,31 @@ project('python-flint', 'cython', 'c') # that future versions of Flint will not work. # if get_option('flint_version_check') - flint_version_required = ['>=3.0', '<3.2'] -else - # We do know that Flint < 3.0 will not work so no point allowing it. - flint_version_required = ['>=3.0'] -endif + if flint_dep.version().version_compare('>=' + flint_ver_upper) + error(''' -py = import('python').find_installation(pure: false) -dep_py = py.dependency() + Invalid Flint version: + Version needed is: @0@ <= flint < @1@ + Version found is: flint == @2@ -cc = meson.get_compiler('c') + By default, python-flint will only build against Flint versions that have + been tested. If you are sure you want to use this version of Flint, you + can disable this check with -Dflint_version_check=false. -gmp_dep = dependency('gmp') -mpfr_dep = dependency('mpfr') -flint_dep = dependency('flint', version: flint_version_required) + If building from the source directory using meson directly, you can do + this with: + + meson setup build -Dflint_version_check=false + + If you are installing with pip, you can do this with: + + pip install --config-settings=setup-args="-Dflint_version_check=false" python-flint + + Other build frontends have similar options for passing this to meson. + '''.format(flint_ver_lower, flint_ver_upper, flint_dep.version()) + ) + endif +endif add_project_arguments( '-X', 'embedsignature=True', From 8898d6f79ecb811c0b0319737eb03661cf4bb6a1 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Wed, 21 Aug 2024 16:58:53 +0100 Subject: [PATCH 18/18] Explain version support --- meson.build | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/meson.build b/meson.build index b278fa3c..71863628 100644 --- a/meson.build +++ b/meson.build @@ -13,12 +13,15 @@ mpfr_dep = dependency('mpfr') flint_dep = dependency('flint', version: ['>=' + flint_ver_lower]) # -# For the source release, we should by default fail for newer versions of Flint -# that are untested with a nice error message: +# The minimum Flint version is because we know that it will not work with +# earlier versions. The maximum version is because python-flint has not been +# tested against versions that didn't exist at the time of release. In future +# if it seems like new Flint releases do not break the build of python-flint +# every time, then we can consider not using a speculative upper version cap +# here. # -# ../meson.build:10:12: -# ERROR: Dependency lookup for flint with method 'pkgconfig' failed: -# Invalid version, need 'flint' ['<3.2'] found '3.2.0'. +# For the source release, we should by default fail for newer versions of Flint +# that are untested with a nice error message. # # We need an option to disable this though so that we can test newer versions # of Flint. Also good to have an escape hatch for users since we don't know @@ -28,26 +31,25 @@ if get_option('flint_version_check') if flint_dep.version().version_compare('>=' + flint_ver_upper) error(''' - Invalid Flint version: - Version needed is: @0@ <= flint < @1@ - Version found is: flint == @2@ + Invalid Flint version: + Version needed is: @0@ <= flint < @1@ + Version found is: flint == @2@ - By default, python-flint will only build against Flint versions that have - been tested. If you are sure you want to use this version of Flint, you - can disable this check with -Dflint_version_check=false. + By default, python-flint will only build against Flint versions that have + been tested. If you are sure you want to use this version of Flint, you can + disable this check with -Dflint_version_check=false. - If building from the source directory using meson directly, you can do - this with: + If building from the source directory using meson directly, you can do this + with: - meson setup build -Dflint_version_check=false + meson setup build -Dflint_version_check=false - If you are installing with pip, you can do this with: + If you are installing with pip, you can do this with: - pip install --config-settings=setup-args="-Dflint_version_check=false" python-flint + pip install --config-settings=setup-args="-Dflint_version_check=false" python-flint - Other build frontends have similar options for passing this to meson. - '''.format(flint_ver_lower, flint_ver_upper, flint_dep.version()) - ) + Other build frontends have similar options for passing this to meson. + '''.format(flint_ver_lower, flint_ver_upper, flint_dep.version())) endif endif