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

PydanticImportError: BaseSettings has been moved to the pydantic-settings #768

Closed
janosh opened this issue Jul 1, 2023 · 9 comments
Closed
Labels

Comments

@janosh
Copy link
Member

janosh commented Jul 1, 2023

pymatgen CI is failing with:

E pydantic.errors.PydanticImportError: BaseSettings has been moved to the pydantic-settings package.
See https://docs.pydantic.dev/2.0/migration/#basesettings-has-moved-to-pydantic-settings for more details.

Came up in materialsproject/pymatgen#3122.

@janosh janosh added the bug label Jul 1, 2023
@peikai
Copy link

peikai commented Jul 2, 2023

Encountering the same issue.

pydantic.errors.PydanticImportError: BaseSettings has been moved to the pydantic-settings package.
See https://docs.pydantic.dev/2.0/migration/#basesettings-has-moved-to-pydantic-settings for more details.

Besides, PyObject class (used in emmet/core/settings.py) has been deprecated from the pydantic v2.

@janosh
Copy link
Member Author

janosh commented Jul 2, 2023

See materialsproject/pymatgen@1e90254 for tmp fix

@peikai
Copy link

peikai commented Jul 3, 2023

Thanks!

@munrojm
Copy link
Member

munrojm commented Jul 3, 2023

I added pydantic < 2.0 to the emmet-core dependencies in #770.

@janosh
Copy link
Member Author

janosh commented Jul 3, 2023

Thanks @munrojm.

Other MP repos might make the transition to pydantic v2 soonish (how about atomate2 @utf?). Might require some coordination to minimize the time of clashing deps.

@Andrew-S-Rosen
Copy link
Member

I am strongly in favor of this! 😄

@mkhorton
Copy link
Member

mkhorton commented Jul 20, 2023

Agreed. Also linking the jobflow dependabot:

materialsproject/jobflow#370

It would be good to have a strategy. I'd like to migrate myself, although I've been using another third-party library recently that's also pinned on pydantic<2.0.0 so anticipating a little pain (although looks like they're merging in support soon).

@mkhorton
Copy link
Member

They are offering a bump-pydantic tool which might help https://docs.pydantic.dev/2.0/migration/#code-transformation-tool

@Andrew-S-Rosen
Copy link
Member

@munrojm looks like this can be closed?

@munrojm munrojm closed this as completed Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants