dosisod / refurb

A tool for refurbishing and modernizing Python codebases
GNU General Public License v3.0
2.48k stars 54 forks source link

[Bug]: crash with `litellm==1.40.12` and `mypy==1.11.0` #347

Closed jamesbraza closed 1 month ago

jamesbraza commented 1 month ago

Has your issue already been fixed?

The Bug

The following Python code with litellm==1.40.12 will run fine with mypy==1.11.0, but is a crash with refurb:

import litellm

Here is the internal mypy crash:

/path/to/venv/lib/python3.12/site-packages/litellm/types/llms/vertex_ai.py: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
If this issue continues with mypy master, please report a bug at https://github.com/python/mypy/issues
version: 1.11.0
/path/to/venv/lib/python3.12/site-packages/litellm/types/llms/vertex_ai.py: : note: please use --show-traceback to print a traceback when reporting a bug

Note that only mypy==1.11.0 has this issue, older versions of mypy do not.

Version Info

Refurb: v2.0.0
Mypy: v1.11.0

Python Version

Python 3.12.4

Config File

# N/A

Extra Info

None

jamesbraza commented 1 month ago

This seems to have been fixed by mypy==1.11.1. So this can be worked around by pinning mypy!=1.11.0

In case anyone is curious what might have changed: https://github.com/python/mypy/compare/v1.11.0...v1.11.1