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

Pydantic 1.8.2 tests fail in Fedora due to mypy incompatibility #3562

Closed
susilehtola opened this issue Dec 22, 2021 · 2 comments
Closed

Pydantic 1.8.2 tests fail in Fedora due to mypy incompatibility #3562

susilehtola opened this issue Dec 22, 2021 · 2 comments
Labels
bug V1 Bug related to Pydantic V1.X

Comments

@susilehtola
Copy link

I'm trying to update the Fedora package of Pydantic to version 1.8.2.

Unfortunately, the tests fail because of

running build_ext
mypy (unittest.loader._FailedTest) ... ERROR
======================================================================
ERROR: mypy (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: mypy
Traceback (most recent call last):
  File "/usr/lib/python3.10/unittest/loader.py", line 154, in loadTestsFromName
    module = __import__(module_name)
  File "/builddir/build/BUILD/pydantic-1.8.2/pydantic/mypy.py", line 41, in <module>
    from mypy.types import (
ImportError: cannot import name 'TypeVarDef' from 'mypy.types' (/usr/lib/python3.10/site-packages/mypy/types.py)
----------------------------------------------------------------------
Ran 1 test in 0.000s
FAILED (errors=1)

This is quite odd, since mypy is the newest version

DEBUG util.py:446:   python3-mypy                  noarch     0.921-1.fc36          build     2.5 M

Is there a version of pydantic which is compatible with mypy 0.921?

@susilehtola susilehtola added the bug V1 Bug related to Pydantic V1.X label Dec 22, 2021
@bbugyi200
Copy link

bbugyi200 commented Dec 22, 2021

See the comments left on PR:pydantic#3175. tl;dr; Looks like we are going to have to wait for v1.9.0 of pydantic to drop.

With that said, replacing mypy in my project's requirements.txt file with the following line is an acceptable workaround for now:

mypy != 0.920, != 0.921, != 0.930  # workaround for https://github.com/samuelcolvin/pydantic/pull/3175

@christianbundy
Copy link
Contributor

Yep, this is a know bug in 1.8.2.

Options:

  • Pin mypy==0.910
  • Use pydantic@master (warning: has bugs)
  • Wait for Pydantic 1.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug V1 Bug related to Pydantic V1.X
Projects
None yet
Development

No branches or pull requests

4 participants