On Fri, 2 Feb 2024 at 22:36, Aaron Meurer <[email protected]> wrote:
>
> On Fri, Feb 2, 2024 at 3:28 PM Oscar Benjamin
> <[email protected]> wrote:
> >
> > 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 don't know about pip, but conda does let you specify version pins
> for optional dependencies (it won't install the dependency but if it
> is installed it will make sure that version is satisfied). But I would
> be careful with this because it would make it impossible for people to
> upgrade python-flint in their environment. We used to pin the
> antlr-python-runtime like this, but then it made it difficult for
> other packages using antlr, so we removed it (see
> https://github.com/conda-forge/sympy-feedstock/issues/46).

It is not possible to do this in the PyPI package metadata. Either
python-flint is a hard dependency or there is no version constraint.

> Generally speaking, aggressive version pins can end up biting you.
> There's a long blog post about this here if you are interested
> https://iscinumpy.dev/post/bound-version-constraints/. My suggestion
> at this point would be to not pin in the package metadata. If you're
> really worried about it, you can add soft checks in the code, which
> are either just warnings or can be overridden somehow like you
> suggested.

To be clear I am just talking about a runtime check for the version here:
https://github.com/sympy/sympy/blob/0b25b279a5f089885cfd1b5e7685515338695f58/sympy/external/gmpy.py#L90-L147

Basically if the environment variable is not set then check if
python-flint is installed with version 0.6.x and if so then use it. In
future the same logic can apply but perhaps with a looser version
check.

--
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxTm5nHETvmYzWrfFmXt91WtmMrXJyn-M8v3MHUSdJA0mA%40mail.gmail.com.

Reply via email to