Add a pyinstaller hook and simple test #387
Merged
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.
closes #384
This adds a pyinstaller hook and a simple test to the testsuite which tries to do a pyinstaller build of a miniscule (two line) app.
The pyinstaller hook is quite simple -- it just ensures that non-python files are included in the SDK package. The hook itself needs a setuptools entry point which identifies the hook location (one of the only bits of setuptools config pyinstaller respects).
In order for the testing to work, a few steps are needed:
Skipping in the right contexts is the trickiest part. It seems that pyinstaller needs a shared-library python build. That's the default for a lot of system packaging, but it's not guaranteed. Furthermore, pyenv builds won't include shared libraries by default, but will use static linking instead. Precisely because this is so finicky, we want to allow tests without it. That way, developer laptop testing can work even if the python env isn't "just so".
GitHub Actions should build pythons appropriately to run the pyinstaller test, so we have a good guarantee of things working.
We don't test the pyinstaller hook for py2 -- if it doesn't work for that version, that's fine (wontfix).
The one thing I wasn't sure about was where to put internal doc on this subject. Basically, I've imitated the sample repo from pyinstaller ( https://github.com/pyinstaller/hooksample ) and tried not to think too hard about this. But if we need more internal doc, maybe I could add
globus_sdk/_pyinstaller/README
? I'm just not certain it's necessary.