1 Commits

Author SHA1 Message Date
MrUnknownDE fa37935af0 Fix PyInstaller relative import error with standalone entry points 2025-12-30 14:30:38 +01:00
3 changed files with 33 additions and 3 deletions
+3 -3
View File
@@ -25,7 +25,7 @@ jobs:
- name: Build CLI executable
run: |
pyinstaller --onefile --name nvr-export --console src/tplink_nvr_export/cli.py
pyinstaller --onefile --name nvr-export --console --collect-submodules tplink_nvr_export nvr_export_cli.py
- name: Test executable
run: |
@@ -55,7 +55,7 @@ jobs:
- name: Build GUI executable
run: |
pyinstaller --onefile --name nvr-export-gui --windowed --icon=NONE src/tplink_nvr_export/gui.py
pyinstaller --onefile --name nvr-export-gui --windowed --collect-submodules tplink_nvr_export nvr_export_gui.py
- name: Upload artifact
uses: actions/upload-artifact@v4
@@ -81,7 +81,7 @@ jobs:
- name: Build CLI executable
run: |
pyinstaller --onefile --name nvr-export --console src/tplink_nvr_export/cli.py
pyinstaller --onefile --name nvr-export --console --collect-submodules tplink_nvr_export nvr_export_cli.py
- name: Make executable
run: chmod +x dist/nvr-export
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env python3
"""Entry point for CLI executable (PyInstaller compatible)."""
import sys
from pathlib import Path
# Add src to path for PyInstaller
src_path = Path(__file__).parent / "src"
if src_path.exists():
sys.path.insert(0, str(src_path))
from tplink_nvr_export.cli import main
if __name__ == "__main__":
main()
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env python3
"""Entry point for GUI executable (PyInstaller compatible)."""
import sys
from pathlib import Path
# Add src to path for PyInstaller
src_path = Path(__file__).parent / "src"
if src_path.exists():
sys.path.insert(0, str(src_path))
from tplink_nvr_export.gui import main
if __name__ == "__main__":
main()