Skip to content
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

CI fails due to incompatible update of mpmath #6475

Closed
kenya-sk opened this issue Feb 26, 2024 · 3 comments
Closed

CI fails due to incompatible update of mpmath #6475

kenya-sk opened this issue Feb 26, 2024 · 3 comments
Labels
kind/bug-report Something doesn't seem to work.

Comments

@kenya-sk
Copy link
Contributor

kenya-sk commented Feb 26, 2024

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
@kenya-sk kenya-sk added the kind/bug-report Something doesn't seem to work. label Feb 26, 2024
@kenya-sk
Copy link
Contributor Author

Version 1.4.0 of mpmath is pre-release, so I will fix it to mpmath~=1.3.0 once in the manual.

@kenya-sk
Copy link
Contributor Author

The error location is Dockerfile in line 26. This one downloads the package from PyPI, but my permission do not allow me to update the package. Therefore, I have changed the version of mpmath in my local environment, and I am hoping that the test will pass.

Can I use test account to download the package from PyPI and make sure it works fine?

@NoureldinYosri
Copy link
Collaborator

@pavoljuhas as per offline discussions. I temporarily supressed the failing test to unblock development.

pavoljuhas added a commit to pavoljuhas/Cirq that referenced this issue Feb 28, 2024
pavoljuhas added a commit to pavoljuhas/Cirq that referenced this issue Feb 28, 2024
The `1.3.*` pattern is invalid in `install_requires` context.
The `mpmath<1.4` spec prohibits pre-releases of 1.4 such as 1.4.0a0.

Related to quantumlib#6475
pavoljuhas added a commit that referenced this issue Feb 28, 2024
The `1.3.*` pattern is invalid in `install_requires` context.
The `mpmath<1.4` spec prohibits pre-releases of 1.4 such as 1.4.0a0.

Related to #6475
pavoljuhas added a commit to pavoljuhas/Cirq that referenced this issue Mar 29, 2024
…quantumlib#6477)"

Not needed after quantumlib#6534 as cirq pre-releases are installed
with stable dependencies.

This reverts commit e11132e.

Related to quantumlib#6475
pavoljuhas added a commit that referenced this issue Mar 29, 2024
Version limit on mpmath is unnecessary after #6534 because
cirq pre-releases are now installed with stable dependencies.

This reverts commit e11132e (#6477).

Related to #6475
jselig-rigetti pushed a commit to jselig-rigetti/Cirq that referenced this issue May 28, 2024
Version limit on mpmath is unnecessary after quantumlib#6534 because
cirq pre-releases are now installed with stable dependencies.

This reverts commit e11132e (quantumlib#6477).

Related to quantumlib#6475
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this issue Oct 31, 2024
The `1.3.*` pattern is invalid in `install_requires` context.
The `mpmath<1.4` spec prohibits pre-releases of 1.4 such as 1.4.0a0.

Related to quantumlib#6475
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this issue Oct 31, 2024
Version limit on mpmath is unnecessary after quantumlib#6534 because
cirq pre-releases are now installed with stable dependencies.

This reverts commit e11132e (quantumlib#6477).

Related to quantumlib#6475
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-report Something doesn't seem to work.
Projects
None yet
Development

No branches or pull requests

2 participants