On Fri, Feb 8, 2013 at 9:56 PM, Aaron Meurer <notifications@github.com>wrote:

> In sympy/core/compatibility.py:
>
> > +# Minimum version of gmpy changed to 1.13 to allow a single code base to also
> > +# work with gmpy2.
> > +
> > +HAS_GMPY = 0
> > +
> > +try:
> > +    import gmpy2 as gmpy
> > +    if gmpy.version() >= '2.0.0b4':
> > +            HAS_GMPY = 2
> > +except ImportError:
> > +    pass
> > +
> > +try:
> > +    import gmpy
> > +    if gmpy.version() >= '1.13':
> > +        HAS_GMPY = 1
>
>  Should the import logic in mpmath also use import_module?
>
> No, just leave it as it is in the mpmath repo.
>
> Should mpmath also respect the GROUND_TYPE setting? If not, mpmath could be
> using gmpy2, sympy could be using gmpy, and it will be difficult to
> distinguish between the types when debugging.
>
> As far as I know, the gmpy types in mpmath do not leak out of mpmath. But
> I guess it's possible.
>
I found two so far. :) One is in the show() helper function in the doc
string for numbers.Float. The other is in the _as_integer_ratio() function
in numbers.py.

I'm working on a new patch with those fixes, the use of import_modules, and
adding gmpy1 to bin\test and bin\doctest,

>  Maybe the best solution here is to not worry about if both gmpys are
> installed. If we really need to test gmpy 1, we can use virtualenv.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/sympy/sympy/pull/1762/files#r2952676>..
>
>