Distribute PyInstaller hook

This uses a feature introduced in PyInstaller 4.0 to register hooks as
entry points and automatically discover them whenever a module is used.
This commit is contained in:
Tobias Gruetzmacher 2020-10-01 15:51:09 +02:00
parent d0162cfb32
commit d93fed567c
3 changed files with 9 additions and 3 deletions

View file

@ -0,0 +1,6 @@
# SPDX-License-Identifier: MIT
# Copyright (C) 2020 Tobias Gruetzmacher
import os
def get_hook_dirs():
return [os.path.dirname(__file__)]

View file

@ -1,7 +1,5 @@
# SPDX-License-Identifier: MIT
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2017 Tobias Gruetzmacher
# Copyright (C) 2016-2020 Tobias Gruetzmacher
from PyInstaller.utils.hooks import collect_submodules, copy_metadata
hiddenimports = collect_submodules('dosagelib.plugins')

View file

@ -46,6 +46,8 @@ setup_requires =
[options.entry_points]
console_scripts =
dosage = dosagelib.cmd:main
pyinstaller40 =
hook-dirs = dosagelib.__pyinstaller:get_hook_dirs
[options.extras_require]
bash =