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

Remove an unnecessary dependency and make a function visible to mypy. #8065

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mikolajz
Copy link

Title

Remove dependency on importlib_metadata (even on Python 3.8 stdlib works) and make completion_cost visible to mypy.

Relevant issues

The extra dependency was causing an issue due to another library with lots of strict dependencies. I also had a mypy error in my code.

Type

🐛 Bug Fix
🧹 Refactoring

Changes

[REQUIRED] Testing - Attach a screenshot of any new tests passing locally

For importlib_metadata - even in Python 3.8 this worked:

$ python
Python 3.8.20 (default, Sep  7 2024, 18:35:08) 
[GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from litellm._version import version
/home/mikolajz/.virtualenvs/litellm/lib/python3.8/site-packages/pydantic/_internal/_config.py:345: UserWarning: Valid config keys have changed in V2:
* 'fields' has been removed
  warnings.warn(message, UserWarning)
>>> version
'1.59.9'

For mypy - I no longer had an error reported in my code.

Copy link

vercel bot commented Jan 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 28, 2025 6:42pm

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

Successfully merging this pull request may close these issues.

1 participant