Skip to content

Conversation

@tobiasdiez
Copy link
Contributor

@tobiasdiez tobiasdiez commented Nov 15, 2025

Following https://scientific-python.org/specs/spec-0000/.

Fixes the test CI and wheel building (which are currently broken see eg #34). Also remove a few old/outdated files.

@tobiasdiez tobiasdiez force-pushed the python-314 branch 10 times, most recently from d4a082f to c99b4d9 Compare November 15, 2025 15:57
@tobiasdiez
Copy link
Contributor Author

tobiasdiez commented Nov 15, 2025

@dimpase wheel building on macos still fails due to an issue with boost (coming from upstream sage, which is used to install a couple of dependencies):

checking for boostlib >= 1.66.0 (106600)... real_configure: We could not detect the boost libraries (version 1.66.0 or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.
  real_configure: error: could not find boost library installation.  https://doc.sagemath.org/html/en/reference/spkg/_prereq.html

It is however installed using homebrew. Any idea how to fix this?

@tobiasdiez tobiasdiez changed the title Update Python version requirements to >= 3.12, include Python 3.13 and 3.14 in CI and wheel building Update Python version requirements to >= 3.12, include Python 3.13 and 3.14 in CI and wheel building, fix CI Nov 15, 2025
@dimpase
Copy link
Member

dimpase commented Nov 15, 2025

What " coming from upstream sage" does mean?

EDIT - oops, I see what you mean.

@dimpase
Copy link
Member

dimpase commented Nov 15, 2025

let me try this locally

@tobiasdiez
Copy link
Contributor Author

Same issue also on Linux Alpine (boost not found, but installed).

@tobiasdiez
Copy link
Contributor Author

Is the boost check really necessary in the configure script of sage? If boost is not installed, then meson will just disable the one module that actually relies on it. So I would say it would be fine to just print a warning message, and not exit forcefully with an error.

@dimpase
Copy link
Member

dimpase commented Nov 15, 2025

I tried building/testing (python3 -m pip install . --user, and testing with pytest) this in Homebrew, with Homebrew Python3.14, with PATH etc set as if we do to build sage-distro (after running source .homebrew-build-env) and it all works.

@dimpase
Copy link
Member

dimpase commented Nov 15, 2025

Why do you even need upstream Sage here?

@dimpase
Copy link
Member

dimpase commented Nov 15, 2025

This package does not depend upon Sage, there is absolutely no need to involve Sage in anything related to building its wheel etc. It's just like cysignals and cypari in this sense.

@dimpase
Copy link
Member

dimpase commented Nov 15, 2025 via email

@tobiasdiez
Copy link
Contributor Author

I tried building/testing (python3 -m pip install . --user, and testing with pytest) this in Homebrew, with Homebrew Python3.14, with PATH etc set as if we do to build sage-distro (after running source .homebrew-build-env) and it all works.

Thanks for testing. I have no idea what then really triggers this issue. Strangely, it also works on macos-15-intel.

This package does not depend upon Sage, there is absolutely no need to involve Sage in anything related to building its wheel etc. It's just like cysignals and cypari in this sense.

Sage-the-distro is used to build gmp, mpfr and mpc, which are needed for building the package/wheel.

I would say this PR is then good to go; will try to remove the dependency on sage-the-distro in #34 (using meson's subprojects).

@dimpase
Copy link
Member

dimpase commented Nov 16, 2025

Same issue also on Linux Alpine (boost not found, but installed).

we don't really test Sage on Alpine. I gather it might be fixed by the following Sage patch (I'll do a PR to add it)

--- a/build/pkgs/_prereq/distros/alpine.txt
+++ b/build/pkgs/_prereq/distros/alpine.txt
@@ -23,3 +23,4 @@ bzip2
 pkgconf
 zlib-dev
 boost
+boost-dev

@dimpase
Copy link
Member

dimpase commented Nov 16, 2025

On macOS, the problems must be due to the need for source .homebrew-build-env before ./boostrap && ./configure for using Homebrew. On Intel, Homebrew installs stuff in /usr/local, which is, by accident, good enough for ./configure to detect boost (it's done by a custom upstream m4 macro). On arm64, Homebrew is in /opt/homebrew (this, and /usr/local as you might know, are generically $(brew --prefix)), and the custom m4 macro fails, as it doesn't know where the headers are.
Perhaps

./configure --with-boost=$(brew --prefix) ...

would suffice - but I don't know how to incorporate this.
Sourcing .homebrew-build-env - which sets

export LIBRARY_PATH
export CPATH

would be better, as it would take care of all the package paths/configs.

@dimpase
Copy link
Member

dimpase commented Nov 16, 2025

I'd try re-factoring the CIBW_BEFORE_ALL stuff in the way done in
https://github.com/dimpase/primecountpy/blob/master/.github/workflows/wheels.yml
There you can add commands per arch in a sane way.

@dimpase dimpase merged commit 55cf3c1 into sagemath:master Nov 17, 2025
6 of 10 checks passed
@dimpase
Copy link
Member

dimpase commented Nov 17, 2025

OK, please use notes I made here in #34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants