Fix randomly opened windows in PyInstaller app (#38)

This commit is contained in:
Chidi Williams 2022-10-09 23:24:38 +01:00 committed by GitHub
commit b168ba8313
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 9 deletions

View file

@ -35,13 +35,13 @@ jobs:
- os: macos-latest
CMD_BUILD: |
brew install create-dmg
poetry run make bundle_mac version=$GITHUB_REF_NAME
poetry run make bundle_mac
- os: ubuntu-latest
CMD_BUILD: |
poetry run make bundle_linux version=$GITHUB_REF_NAME
poetry run make bundle_linux
- os: windows-latest
CMD_BUILD: |
poetry run make bundle_windows version=$env:GITHUB_REF_NAME
poetry run make bundle_windows
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
@ -63,6 +63,8 @@ jobs:
- run: poetry install
- run: ${{ matrix.CMD_BUILD }}
env:
BUZZ_VERSION: ${{ github.ref_name }}
- uses: actions/upload-artifact@v3
with:
name: Buzz

View file

@ -1,3 +1,11 @@
mac_app_path := ./dist/Buzz.app
mac_zip_path := ./dist/Buzz-$$BUZZ_VERSION-mac.zip
mac_dmg_path := ./dist/Buzz-$$BUZZ_VERSION-mac.dmg
unix_zip_path := ./dist/Buzz-$$BUZZ_VERSION-unix.tar.gz
windows_zip_path := ./dist/Buzz-$$BUZZ_VERSION-windows.tar.gz
buzz:
make clean
pyinstaller --noconfirm Buzz.spec
@ -13,23 +21,19 @@ version:
bundle_linux:
make buzz
tar -czf dist/buzz-${version}-unix.tar.gz dist/Buzz
tar -czf ${unix_zip_path} dist/Buzz
bundle_windows:
make buzz
tar -czf dist/buzz-${version}-windows.tar.gz dist/Buzz
tar -czf ${windows_zip_path} dist/Buzz
# MAC
mac_app_path := ./dist/Buzz.app
mac_zip_path := ./dist/Buzz-$$BUZZ_VERSION-mac.zip
mac_dmg_path := ./dist/Buzz-$$BUZZ_VERSION-mac.dmg
bundle_mac:
make buzz
bundle_mac_local:
source .env
make buzz
make codesign_all_mac
make zip_mac

View file

@ -1,8 +1,12 @@
import logging
import multiprocessing
from gui import Application
if __name__ == "__main__":
# Stop PyInstaller from randomly opening multiple windows: https://stackoverflow.com/a/32677108/9830227
multiprocessing.freeze_support()
logging.basicConfig(
level=logging.DEBUG,
format="[%(asctime)s] %(module)s.%(funcName)s:%(lineno)d %(levelname)s -> %(message)s")