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

Migrate to Pydantic V2 API #732

Open
veenstrajelmer opened this issue Jan 22, 2025 · 0 comments
Open

Migrate to Pydantic V2 API #732

veenstrajelmer opened this issue Jan 22, 2025 · 0 comments

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Jan 22, 2025

Is your feature request related to a problem? Please describe.
Dependency moved to Pydantic V2 in this PR: #588. However, this was done by keeping the V1 API calls. Pydantic V3 will be released this year. There will be no breaking changes this time, except for the fact that V1 API will be dropped (I think): pydantic/pydantic#10033. Either way, it seems to make sense to update to the V2 API asap. This will probably also make the HYDROLIB-core package more future proof.

Describe the solution you'd like
Update HYDROLIB-core to Pydantic V2 API.

Describe alternatives you've considered
None

Additional context
The V1 API now also shows a DeprecationWarning. It could well be this will break all code in the future, since it seems to happen on an import already, copied from the ubuntu Python 3.12 ci action:

=============================== warnings summary ===============================
.venv/lib/python3.12/site-packages/pydantic/v1/fields.py:437
  /home/runner/work/HYDROLIB-core/HYDROLIB-core/.venv/lib/python3.12/site-packages/pydantic/v1/fields.py:437: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    return smart_deepcopy(self.default) if self.default_factory is None else self.default_factory()
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

No branches or pull requests

1 participant