Skip to content

Commit 3e367f2

Browse files
authored
Merge pull request #838 from strictdoc-project/docs
tasks: adapt PyInstaller to support "strictdoc server" command
2 parents c0a0ed4 + 3082712 commit 3e367f2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tasks.py

+9
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,14 @@ def release_pyinstaller(context):
496496
# """
497497
# Solution found here:
498498
# https://stackoverflow.com/a/64473931/598057
499+
#
500+
# The --hidden-import strictdoc.server.app flag is needed because without
501+
# it, the following is produced:
502+
# ERROR: Error loading ASGI app. Could not import
503+
# module "strictdoc.server.app".
504+
# Solution found here: https://stackoverflow.com/a/71340437/598057
505+
# This behavior is not surprising because that's how the uvicorn loads the
506+
# application separately from the parent process.
499507
command = f"""
500508
pip install pyinstaller &&
501509
pyinstaller
@@ -504,6 +512,7 @@ def release_pyinstaller(context):
504512
--noconfirm
505513
--additional-hooks-dir developer/pyinstaller_hooks
506514
--distpath {path_to_pyi_dist}
515+
--hidden-import strictdoc.server.app
507516
--add-data strictdoc/export/html/templates:templates/html
508517
--add-data strictdoc/export/rst/templates:templates/rst
509518
--add-data strictdoc/export/html/_static:_static

0 commit comments

Comments
 (0)