Streamline including hooks in a package #5535
bwoodsend
started this conversation in
Features & Development
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, including a binary or data file in a setuptools package requires a disproportionate amount of work to get PyInstaller to pick it up.
collect_data_files("package")
or something similar.hook-package.py
.All this is just to tell PyInstaller that no I didn't include that shared library in my package for fun.
In doing this, unless you pedantically structure your package to prevent it, the package has now been loaded twice in the master process: Once to evaluate the entry point to get the package-defined
get_hooks_dir()
then again to evaluate it. So ourexec_statement()
isolation is not only circumvented but is wasted processing time.I'd like to add either some shortcuts or some sane defaults. We can keep the original totally flexible model but only use it if it's really needed. The ability to define multiple hooks is not generally useful and the ability to define hooks for other packages is even less so.
entry_points={"pyinstaller40": ["hooks-in=package"]}
?entry_points={"pyinstaller40": ["hook-package=collect_data_files('package')"]}
?Beta Was this translation helpful? Give feedback.
All reactions