Support Python 3.12+ and address pydantic v2 compatibility issues #41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was prompted by the observation of the following error when running pytest with Python 3.12 on the shrub.py project:
As well as the following warning by pydantic in downstream projects with pydantic 2.0+:
This prompted an investigation that uncovered a terrible mess of package compatibility issues and conflicting design philosophies across related packages which I will deliberately avoid summarizing here. Instead, I will simply reference the errors that were encountered and avoided by the proposed changes in this PR. These changes were tested against Python 3.8 through Python 3.13 using Astral uv.
Invoking flake8 via pytest-flake8
Appears to be a conflict between
flake8>=5.0
andpytest-flake8
. Resolved by removing thepytest-flake8
package in favor of invokingflake8
directly in a newlint
Evergreen task.Note
Compatibility of Flake8 and pytest via
pytest-flake8
seems unresolvable at the moment. This PR opts to workaround the problem by directly invokingflake8
instead.Invoking flake8 with Python 3.12+
Appears to be a false positive with
pycodestyle<2.11
(dependency offlake8==5.0
). Resolved by upgradingflake8
to 7.0+.pydantic 2.0 compatibility warning
Resolved by renaming the field accordingly.
Important
This resolution is not backward-compatible with pydantic 1.0.
pydantic 2.0 deprecation warning
Resolved by using the recommended interfaces instead.
Important
This resolution is not backward-compatible with pydantic 1.0.
Python 3.14 deprecation warning
Resolved by updating
pytest
to 7.0+.pytest 7.0+ deprecation warning (black >= 24.0)
Unresolved. Compatibility between black and pytest 7.0+ is not yet supported.
Note
These are the only warnings currently present when running pytest.