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

loader: implement FrozenImporter source loading from .py files #5697

Merged
merged 1 commit into from Apr 6, 2021

Conversation

rokm
Copy link
Member

@rokm rokm commented Apr 4, 2021

Provide basic FrozenImporter.get_source() implementation that allows loading of source from .py files that have been collected by hooks as data files.

This is, for example, required by PyTorch's JIT compilation mechanism.

The issue of missing source code inside frozen application, which is required by some packages, is tracked under #4764. However, it seems the primary solution discussed there is collecting .py files into PYZ archive. This PR instead adds support only for loading source from on-filesystem .py files that have been collected via collect_data_files() with include_py_files=True, which was also suggested by #4764 (comment). But in the end, the two approaches are complementary, and even if we really wanted to have .py files primarily collected into PYZ, we would still need an on-filesystem fallback (for noarchive option).

Provide basic FrozenImporter.get_source() implementation that allows
loading of source from .py files that have been collected by hooks
as data files.
@rokm rokm marked this pull request as ready for review April 5, 2021 17:10
@bwoodsend bwoodsend merged commit bab86a0 into pyinstaller:develop Apr 6, 2021
@rokm rokm deleted the importer_get_source branch May 5, 2021 09:42
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants