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

Add hook for pydantic #78

Merged
merged 4 commits into from
Dec 6, 2020
Merged

Add hook for pydantic #78

merged 4 commits into from
Dec 6, 2020

Conversation

rokm
Copy link
Member

@rokm rokm commented Dec 5, 2020

The PyPi version of pydantic comes with all its modules compiled as cpython extensions. This prevents pyinstaller from properly discovering the dependant modules, both from the pydantic package itself and from the standard library.

Fixes pyinstaller/pyinstaller#5359.

The PyPi version of pydantic comes with all its modules compiled as
cpython extensions. This prevents pyinstaller from properly
discovering the dependant modules, both from the pydantic package
itself and from the standard library.
@rokm rokm requested review from a team and bwoodsend and removed request for a team December 5, 2020 19:53
@rokm
Copy link
Member Author

rokm commented Dec 5, 2020

Here are test matrices for before and after.

I suspect that the versions that were passing even before the changes are not compiled.

Older versions of pydantic on linux seem to be still failing with the same symptoms as before - I've verified that those are extension-compiled versions. And I suspect that this import is to blame. It is gone from pydantic 1.4 and later, so those work fine.

@bwoodsend
Copy link
Member

We already have #57 but this looks a lot less scary so I'd definitely go with this one.

Closes #57.

@bwoodsend
Copy link
Member

I take it then that you wish to drop support for anything below 1.4?

Realistically, I feel that this kind of self-induced mess is for package authors to clear up - not us.

@rokm
Copy link
Member Author

rokm commented Dec 5, 2020

I take it then that you wish to drop support for anything below 1.4?

Realistically, I feel that this kind of self-induced mess is for package authors to clear up - not us.

I don't think there's anything we can actually do about compiled versions below 1.4. If someone absolutely has to use pyinstaller with those old versions, they'll need to install the non-compiled variant.

Copy link
Member

@bwoodsend bwoodsend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok then.

Copy link
Member

@Legorooj Legorooj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I seem to remember there being a discussion about reading the imports from python extension modules somewhere, but can't remember off the top of my head. Will look into it again when I tackle modulegraph in January.

@Legorooj Legorooj merged commit a7776ba into pyinstaller:master Dec 6, 2020
@rokm rokm deleted the hooks-pydantic branch December 7, 2020 20:46
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

Successfully merging this pull request may close these issues.

FastAPI&Pydantic problem
3 participants