From 637f1d25628e5c5229f98c5f8dd299032d184461 Mon Sep 17 00:00:00 2001 From: Xi Xu Date: Wed, 4 Jun 2025 21:08:33 +0800 Subject: [PATCH] Update CI workflow and add main entry point Modified the CI workflow to correctly specify the path to the main script for PyInstaller builds. Added a new standalone entry point in src/main.py to serve as the executable script for tzst. --- .github/workflows/ci.yml | 2 +- src/main.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/main.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f804bf3..3c505d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -173,7 +173,7 @@ jobs: - name: Build binary run: | - python -m PyInstaller --onefile --name tzst --console -m tzst + python -m PyInstaller --onefile --name tzst --console src/main.py - name: Verify binary (Linux/macOS) if: matrix.os != 'windows-latest' diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..cffccb4 --- /dev/null +++ b/src/main.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +"""Standalone entry point for tzst - used for PyInstaller builds.""" + +import os +import sys + +# Add the src directory to the Python path +sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src")) + +from tzst.cli import main + +if __name__ == "__main__": + sys.exit(main())