Skip to content

Commit e297a61

Browse files
authored
Merge pull request #4 from dubu-alt/fix/pyinstaller-entry
fix: PyInstaller 앱이 시작 즉시 종료되는 문제 수정
2 parents a738f8d + 8cb822d commit e297a61

4 files changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
--clean
3737
--paths src
3838
--collect-all tkinterdnd2
39-
src/spass_csv_converter/__main__.py
39+
scripts/pyinstaller_entry.py
4040
4141
- name: Package release file (macOS)
4242
if: runner.os == 'macOS'

scripts/build_macos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ python3 -m PyInstaller \
1010
--clean \
1111
--paths src \
1212
--collect-all tkinterdnd2 \
13-
src/spass_csv_converter/__main__.py
13+
scripts/pyinstaller_entry.py
1414

1515
echo "macOS app created in dist/"

scripts/build_windows.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ py -m PyInstaller `
99
--clean `
1010
--paths src `
1111
--collect-all tkinterdnd2 `
12-
src/spass_csv_converter/__main__.py
12+
scripts/pyinstaller_entry.py
1313

1414
Write-Host "Windows app created in dist/"

scripts/pyinstaller_entry.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""PyInstaller entry point.
2+
3+
PyInstaller executes the target file as a top-level script, so the package's
4+
``__main__.py`` (which uses relative imports) fails with
5+
"attempted relative import with no known parent package" when used directly.
6+
This wrapper imports the package absolutely and delegates to its main().
7+
"""
8+
import sys
9+
10+
from spass_csv_converter.__main__ import main
11+
12+
if __name__ == "__main__":
13+
sys.exit(main())

0 commit comments

Comments
 (0)