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

fix moved ValidationError import #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jchorl
Copy link

@jchorl jchorl commented Oct 14, 2024

Seeing warning:

/usr/local/lib/python3.12/site-packages/fastapi_cloudauth/__init__.py:1: in <module>
    from .auth0 import Auth0, Auth0CurrentUser
/usr/local/lib/python3.12/site-packages/fastapi_cloudauth/auth0.py:10: in <module>
    from .base import ScopedAuth, UserInfoAuth
/usr/local/lib/python3.12/site-packages/fastapi_cloudauth/base.py:9: in <module>
    from pydantic.error_wrappers import ValidationError
/usr/local/lib/python3.12/site-packages/pydantic/_migration.py:283: in wrapper
    warnings.warn(f'`{import_path}` has been moved to `{new_location}`.')
E   UserWarning: `pydantic.error_wrappers:ValidationError` has been moved to `pydantic:ValidationError`.

The warning comes from here, where we can see the error was migrated: https://github.com/pydantic/pydantic/blob/60f704721a096dced3b19dd465a1e31495fcd802/pydantic/_migration.py#L8

Tested by importing directly in a repl:

root@a593d9b66d24:/goliath/backend/app# python3
Python 3.12.6 (main, Sep 27 2024, 06:10:24) [GCC 12.2.0] on linux
>>> from pydantic import ValidationError

The only part I'm unsure about - do we need to pin pydantic to >2 in this repo?

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