Support installation with pyinstaller
sirosen opened this issue · 0 comments
User Story / Use-case
If you want to build a cross-platform application which bundles python, pyinstaller is one of the ways, if not the de-facto standard way, to do it.
In order to do so, pyinstaller has to bundle all of the dependency packages for the application, including the SDK, requests, six, etc.
Problem
Right now, an installation with pyinstaller fails because pyinstaller doesn't respect normal python package metadata. It doesn't use setuptools and it won't read setup.py
, setup.cfg
or MANIFEST.in
.
Instead, pyinstaller has hooks and pre-defines a whole host of them for "common" python packages. We're obviously not in that list, so globus_sdk/globus.cfg
is not loaded by pyinstaller and you get a borked install.
We've had this come up in user support, but we also have run into it internally where we use pyinstaller.
Given that we provide a very boring (metadata-wise) package by the most standard of means, it's kind of absurd that we're not supported out of the box. But whining about it won't fix things, and pyinstaller has drawn a clear line in the sand that they are not going to add support for any python build tools. (Given the pyproject.toml and "pluggable build system" changes, I'm not even sure I blame them...)
Implementation Options
-
For completeness: we could get rid of
globus.cfg
and have no non-python package data. I don't like this option at all for a whole host of reasons. Let's not. -
Get a hook built into pyinstaller. (Won't happen; they'd be sure to reject it.)
-
pyinstaller has a contrib package for adding hooks: https://github.com/pyinstaller/pyinstaller-hooks-contrib
We could try to get a hook added there. -
We could write and add a hook to
globus_sdk
.
I think 3 and 4 are the only viable ones in this list, and I like 4 best because it works with pyinstaller out of the box and we're not beholden to anyone else who works on that contrib repo. The contrib hooks are really for cases like boto3
where a hook is needed and someone who is not affiliated with the project wants to add it.
My inclination right now is to write and add a hook, add a CI job which builds and runs a very minimal application with pyinstaller, and call it a day.