-
-
Notifications
You must be signed in to change notification settings - Fork 688
Update for mpmath-1.4 while remaining backwards-compatible #41014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
I will give that branch a spin with a sage-on-gentoo ebuild later today. |
|
Needs rebasing. |
Tweak some expected output to work with both versions of mpmath. Certain types that used to be implemented in sage are now a part of mpmath itself, so the class names have changed. Fortunately it looks like we can match both with enough "..."
This file needs an update to support mpmath-1.4.x, and the changes can't easily be conditionalized (cimports are involved). Instead we make a copy, with the intention of using meson to conditionally compile one or the other based on the value of mpmath.__version__ at build-time.
To support both versions of mpmath, we create an internal copy of the existing py_scalar_parent() function, and update the original to support mpmath-1.4.x. If mpmath.__version__ indicates that v1.3 is in use, we punt to the old copy of the function. The copy/paste is ugly, but considering that it's only temporary, emphasis is placed on how easy it will be to undo eventually.
mpmath v1.3 and v1.4 build very differently. Rather than try to support both simultaneously with the same set of files, we conditionalize the build to check mpmath.__version__ via python, and respond accordingly.
To support mpmath v1.3 and v1.4 simultaneously, we have some sage library files that are only used mpmath-1.3.x is installed. The tests in these files will fail with mpmath-1.4, however, so we add a new feature to detect mpmath-1.3.x.
Most of these files are only used (and can only be tested) under mpmath-1.3.x. We now have a "feature" for that version, and just need to add the appropriate file-level tags.
Now that we have a feature for "mpmath13", the doctests for the mpmath-1.3.x copy of py_scalar_parent() are put back in place.
It isn't smart enough to handle an if/else statement that doesn't apply.
|
I force-pushed an update, sorry for the delay, it's been chaos. The first few CI failures are because mpmath isn't being installed before sage, but I don't see any obvious reason for that because it was always a dependency. |
|
I'll try to give it a spin again in the next 12hours. |
|
Build and install in sage-on-gentoo. |
That's the easy part :) I was hoping to use the CI to test it with mpmath-1.3, but it's failing for reasons I don't understand. I doubt I'll get time, but I may just resurrect the last mpmath-1.3 ebuild and see what happens. Though we would need to fix the CI before merging anyway. |
A third attempt at supporting mpmath 1.4.x. Previous PRs:
build/pkgs/mpmath1.4 #38565mpmath 1.4.x is still in alpha, so we can't require it yet, but we can try to support it. This isn't too difficult given that
mpmath.__version__is available to python, but there are some major cython changes that are better hidden behind a conditional compile.The new PR makes things compatible where possible, copy/pastes an entire function in one case, and even uses a separate file
utils13.pyxin another. A new feature is added to hide the 1.3.x doctests on 1.4.