Add a hook to change how utilities files are read.#3273
Merged
scoder merged 5 commits intocython:masterfrom Jan 11, 2020
Merged
Add a hook to change how utilities files are read.#3273scoder merged 5 commits intocython:masterfrom
utilities files are read.#3273scoder merged 5 commits intocython:masterfrom
Conversation
Contributor
Author
scoder
reviewed
Dec 21, 2019
Contributor
|
May I ask what "tinypar" is? |
scoder
reviewed
Dec 23, 2019
Contributor
|
I created a PR to remove the whole utility code searching machinery in #3280. It's really unnecessary and adds useless complexity. I'll wait for travis-CI to be happy and then merge it. Could you please create a new PR based on that, in case it's still necessary? |
Contributor
Author
|
I first saw it at work, and assumed it was a well known bundler. Looks like
I am not alone. :)
As far as I know tinypar is a way to package python applications into a
single binary. The implication is package resources are no longer on disk,
thus cannot be searched with listdir or opened as regular files. It still
provides an API to open a resource file-like object from a path.
I think this constraint probably applies to other python application
bundlers that do not unzip the bundle to a temporary file system location
-- there can be speed gains avoiding unzipping.
With this PR, the bundle maintainer can override the read_all_lines
function to redirect the file access to the bundlers API. It's the bare
minimum promise that cython needs from the resource file system.
…On Sun, Dec 22, 2019, 11:17 PM Stefan Behnel ***@***.***> wrote:
May I ask what "tinypar" is?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3273?email_source=notifications&email_token=AABBWTHOXQAIKC5MB45KAMLQ2BQ2DA5CNFSM4J3TKX52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHQNKVA#issuecomment-568382804>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABBWTCZHUCAOOETXPM6QTLQ2BQ2DANCNFSM4J3TKX5Q>
.
|
Contributor
Author
|
Sure. Thanks for the patch. I will give this a go tomorrow. |
utilities files are read.
Add set_read_utitlities_hook() to override how utilities files are accessed. This change simplifies how Cython can be packaged into a single file binary executable, where utility files are stored inside the binary executable as package resource.
Contributor
Author
|
How about this version? |
Contributor
|
This looks fine to me. @scoder any further comments? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add read_utitlities_hook to override how utilities files are accessed.
This change simplifies how Cython can be packaged into a single
file binary executable, where utility files are stored inside the
binary executable as package resource.