Skip to content

Explicitly set MPMATH_SAGE env variable #32799

@antonio-rojas

Description

@antonio-rojas

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions