On Fri, 2 Feb 2024 at 21:52, Aaron Meurer <asmeu...@gmail.com> wrote: > > On Fri, Feb 2, 2024 at 9:41 AM Oscar Benjamin > <oscar.j.benja...@gmail.com> wrote: > > > > I think that probably the right way to do this is just for SymPy to > > use python-flint by default if it is installed but with an almost > > exact version check like `python-flint == 0.6.x` because `0.6.0` is > > the minimum version needed for the PR above but also the maximum > > version that has been tested before release. It would be good to allow > > the flexibility to have `0.6.1` though in case there is a small bugfix > > release of python-flint. Over time if things seem more stable then we > > could relax that version constraint. The environment variable could > > still be used to override the version check but the default if no > > environment variable is set should just be to use python-flint but > > only the expected 0.6.x versions. > > > > Does anyone have any thoughts on how exactly to do this? > > I think it should just be enabled by default. Almost no one will have > flint installed, so only people who go out of their way to install it > will get the benefits, so requiring an opt-in is just an extra step > for those people. The only way this wouldn't be the case is if we add > flint as a dependency in the conda package like we do for gmpy, but it > sounds like it's a bit early to do that. > > Although I'm wondering about Sage. Does Sage always install both SymPy > and python-flint?
Sage always includes SymPy but not python-flint but it might do now that SymPy adds the optional dependency: https://github.com/sagemath/sage/pull/37224#issuecomment-1924466879 Sage already includes and uses Flint separately with its own wrapper but python-flint would be an additional package whose purpose for now would just be to be used by SymPy inside of Sage. I hope that in future there will be some convergence between python-flint and Sage's Flint wrapper. It isn't possible for SymPy to use Sage's Flint wrapper (outside of Sage) but it could be possible in future for both to use python-flint or for the Sage wrapper to become something separate from Sage. > As for the verison checks, it depends on how likely you expect there > to be breaking changes in python-flint. If that package is going to > have a lot of breaking changes, it will make using it in SymPy a lot > harder. I don't anticipate many breaking changes but python-flint is in a more active development phase than SymPy and I doubt that we will want to test all version combinations (just like we don't with mpmath or numpy etc). Actually that reminds me that some of the changes in SymPy 1.13 are needed for the next release of mpmath (whenever that happens). Now that mpmath is also in a more active development phase than it has been for a long time we should review the version checking there as well. Currently SymPy checks for a 10 year old version of mpmath as the minimum version: https://github.com/sympy/sympy/blob/0b25b279a5f089885cfd1b5e7685515338695f58/setup.py#L37 Without making python-flint a hard dependency there is no way to specify what versions should be acceptable in an install so I think that the safest thing for now is to keep an upper bound that is checked at runtime. We also definitely need a lower bound because so far SymPy (master branch) uses the latest python-flint features as they roll out. I'll add a python-flint == 0.6.x check for now. In future I don't think it will be necessary and in the meantime someone can use the environment variable to force the use of python-flint if they want to but have a different version. -- Oscar -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAHVvXxQUfFTsOyQVdVSL3a33auXZT%3D6u0zCXi8Z33SvHJXk8Fw%40mail.gmail.com.