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

Allow pydantic v2 using transitional v1 support #12888

Merged

Conversation

adrianeboyd
Copy link
Contributor

Description

Allow pydantic v2 using transitional v1 support.

Types of change

Enhancement?

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.
  • I ran the tests, and all new and existing tests passed.
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

@adrianeboyd adrianeboyd added the third-party Third-party packages and services label Aug 7, 2023
@adrianeboyd
Copy link
Contributor Author

@explosion-bot please test_slow

1 similar comment
@adrianeboyd
Copy link
Contributor Author

@explosion-bot please test_slow

@explosion-bot
Copy link
Collaborator

explosion-bot commented Aug 7, 2023

🪁 Successfully triggered build on Buildkite

URL: https://buildkite.com/explosion-ai/spacy-slow-tests/builds/440

@adrianeboyd
Copy link
Contributor Author

wheelwright build (with some hacks to use pydantic v1 for testing on aarch64) is fine:

https://dev.azure.com/explosion-ai/Public/_build/results?buildId=26594&view=results

@adrianeboyd adrianeboyd linked an issue Aug 7, 2023 that may be closed by this pull request
@adrianeboyd adrianeboyd merged commit 245e2dd into explosion:master Aug 8, 2023
15 checks passed
Harmon758 added a commit to Harmon758/Harmonbot that referenced this pull request Aug 9, 2023
Now that spaCy (and its dependencies, confection and thinc) support pydantic v2
explosion/confection#38
explosion/thinc#891
explosion/spaCy#12611
explosion/spaCy#12888
@meerfrau
Copy link

meerfrau commented Sep 9, 2023

Are there specific instructions for using this?

I'm still getting ImportError: cannot import name 'ModelMetaclass' from 'pydantic.main' (/usr/lib/python3.10/site-packages/pydantic/main.py) with Pydantic 2 (both 2.0.3 or 2.3.0) w/ Py3.10

@adrianeboyd
Copy link
Contributor Author

This is the error you would get if you have pydantic v2 installed with spacy v3.6.0 or earlier. Can you check with python -m pip check if there are any version conflicts for the installed packages?

@meerfrau
Copy link

I've switched back to pydantic v1

@maspotts
Copy link

I also am getting:

ImportError: cannot import name 'ModelMetaclass' from 'pydantic.main' (/Users/mike/.pyenv/versions/3.10.7/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pydantic/main.py)

with pydantic 2.6.1 and spacy 3.7.4. what am I doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
third-party Third-party packages and services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support future pydantic v2
5 participants