-
Notifications
You must be signed in to change notification settings - Fork 23
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
Detect missing pydantic dependency (e.g. pydantic-settings or extra types) #104
Comments
Hmmm... I think it makes sense to log a message telling the user to install it. 👍 |
PR welcome to add a TODO above the |
Actually, a message on stdout would be better. |
@Kludex Hi Marcelo, I am a huge fan of the pydantic and I have always wanted to contribute to things related to it. I have made an attempt to add a message on stdout! Thanks again for the great work you guys put into pydantic and bump-pydantic! |
Hey team,
I wasn't sure if you would be comfortable with this, but what's your opinion on telling the user when they are missing a pydantic dependency, such as
pydantic-settings
is usingBaseSettings
in Pydantic V1?This could spit out a warning (whether that's stdout, stderr, log.txt, or somewhere else) or a
# TODO
comment if thepydantic-settings
package isn't installed.This will help users more quickly identify when their application requires packages that are not currently installed.
To detect if a package is installed without importing it (for safety reasons),
importlib.util
can be used:Documentation on
find_spec
:https://docs.python.org/3/library/importlib.html#importlib.util.find_spec
The text was updated successfully, but these errors were encountered: