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

Linter issue: mypy<1.14 pulls in incompatible dependencies due to pydandic release #439

Closed
courtneypacheco opened this issue Dec 10, 2024 · 0 comments · Fixed by #434
Closed

Comments

@courtneypacheco
Copy link
Contributor

Background / Context

Breaking Changes

We use Mypy to perform lint checks during PR builds (see this line in tox.ini). However, one of mypy's dependencies, pydantic, was recently updated and mypy is no longer fully compatible with pydantic's latest code. This compatibility issue is problematic because mypy<1.14 seems to pull in the latest pydantic release by default through a dependency chain, which means mypy<1.14 no longer works in certain situations.

Screenshot Example

I unfortunately forgot to grab a screenshot of the issue in this particular repo, but here is a screenshot of a nearly identical mypy error in the instructlab/instructlab repo caused by the same mypy issue:

Screenshot 2024-12-09 at 5 05 51 PM

Relevant Issues Filed

I have found two relevant issues filed for both mypy and pydantic, but there may be more as time marches on:

Proposed Solution

Pin mypy<1.14 for now and force it to use pydantic<=2.9.2 by specifying pydantic<=2.9.2 as a dependency in the affected tox.ini file:

sdg/tox.ini

Line 77 in c220b5f

mypy>=1.10.0,<2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants