-
-
Notifications
You must be signed in to change notification settings - Fork 528
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
Explicitly set MPMATH_SAGE env variable #32799
Comments
Author: Antonio Rojas |
New commits:
|
This comment has been minimized.
This comment has been minimized.
Commit: |
comment:3
See also
|
comment:4
This is the minimum to do vanilla sage. I have already endorsed the approach in principle months ago. I am not sure I would check I would like more opinion on that one because not providing a way to override is contentious. |
comment:5
We should probably set this environment variable in the Sage Python library, not in the |
comment:6
Replying to @mkoeppe:
I agree with that. If I knew how to do it, there would already be a ticket for it ready to review. The stuff I tried didn't work, the only things I can think of require cooperation from mpmath devs. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:8
Replying to @kiwifb:
Does this not work for you? |
comment:9
No, because it is too late to set an environment variable. You are already in the application and it is run with the variables it was launched with. You would need a python variable to tell |
comment:10
It would work if you started a new application like what happens in |
comment:11
Replying to @kiwifb:
Can you give more details on how exactly it is failing for you? Because everything seems to work fine for me (both doctests and running stuff from a sage session) |
Reviewer: François Bissey |
comment:12
OK, it surprisingly works. I must have had a messed up environment when I tried it. |
Changed branch from u/arojas/explicitly_set_mpmath_sage_env_variable to |
Since mpmath 1.2.1, specifically since commit [1], mpmath checks for the SAGE_ROOT or MPMATH_SAGE env variables in order to enable sage types instead of relying on whether sage.all can be imported.
This breaks distro packages where SAGE_ROOT is undefined. I reported this upstream a while ago [2] with not much luck. Here we explicitly define MPMATH_SAGE in sage-env so mpmath uses Sage types in a Sage session even if SAGE_ROOT is not defined.
This is still broken when using sage as a python library (in which case sage-env is not read at all), but fixing that use case is beyond the scope of this ticket.
[1] mpmath/mpmath@84ca137
[2] mpmath/mpmath#574
CC: @mkoeppe @kiwifb @dimpase @isuruf
Component: packages: standard
Author: Antonio Rojas
Branch/Commit:
d4b1b60
Reviewer: François Bissey
Issue created by migration from https://trac.sagemath.org/ticket/32799
The text was updated successfully, but these errors were encountered: