Skip to content

CI fails due to incompatible update of mpmath #6475

@kenya-sk

Description

@kenya-sk

Description of the issue
CI pipeline fails due to an incompatible update in the mpmath library used by the Sympy library.
The cirq_pre_release installs the pre-release version of mpmath=="1.4.0a0".
mpmath.rational is deorecated due to the update from v1.3.

How to reproduce the issue


docker build --target cirq_pre_release -t cirq_image_pre .
docker run cirq_image_pre python -c "import cirq; assert cirq.__version__ is not None"

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/cirq/__init__.py", line 19, in <module>
    from cirq._compat import __cirq_debug__, with_debug
  File "/usr/local/lib/python3.9/site-packages/cirq/_compat.py", line 32, in <module>
    import sympy
  File "/usr/local/lib/python3.9/site-packages/sympy/__init__.py", line 30, in <module>
    from sympy.core.cache import lazy_function
  File "/usr/local/lib/python3.9/site-packages/sympy/core/__init__.py", line 9, in <module>
    from .expr import Expr, AtomicExpr, UnevaluatedExpr
  File "/usr/local/lib/python3.9/site-packages/sympy/core/expr.py", line 4159, in <module>
    from .mul import Mul
  File "/usr/local/lib/python3.9/site-packages/sympy/core/mul.py", line 2193, in <module>
    from .numbers import Rational
  File "/usr/local/lib/python3.9/site-packages/sympy/core/numbers.py", line 4567, in <module>
    _sympy_converter[type(mpmath.rational.mpq(1, 2))] = sympify_mpmath_mpq
AttributeError: module 'mpmath' has no attribute 'rational'

Information on the mpmath library installed with the cirq_pre_release image is as flollows.

Name: mpmath
Version: 1.4.0a0
Summary: Python library for arbitrary-precision floating-point arithmetic
Home-page:
Author:
Author-email: Fredrik Johansson <fredrik.johansson@gmail.com>
License: BSD
Location: /usr/local/lib/python3.9/site-packages
Requires:
Required-by: sympy

Cirq version

1.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug-reportSomething doesn't seem to work.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions