-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add PyInstaller CI binaries and Streamlit web UI #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
537fe67
1567a99
59d14b1
9f2b734
efa4e17
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,95 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Build Native Binaries | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tags: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - "v*" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Build (${{ matrix.os }}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ${{ matrix.os }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| include: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - os: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| artifact_name: passifypdf-linux-x86_64 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| binary_path: dist/passifypdf | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - os: macos-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| artifact_name: passifypdf-macos-arm64 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| binary_path: dist/passifypdf | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - os: windows-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| artifact_name: passifypdf-windows-x86_64 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| binary_path: dist/passifypdf.exe | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout repository | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-python@v5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python-version: "3.11" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install uv | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: astral-sh/setup-uv@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: uv sync | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install PyInstaller | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: uv pip install pyinstaller | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Build binary | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uv run pyinstaller \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+36
to
+47
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Install PyInstaller | |
| run: uv pip install pyinstaller | |
| - name: Build binary | |
| run: | | |
| uv run pyinstaller \ | |
| - name: Install Poetry | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install poetry | |
| - name: Install dependencies | |
| run: | | |
| poetry install --no-interaction --no-ansi | |
| - name: Install PyInstaller | |
| run: | | |
| poetry run python -m pip install pyinstaller | |
| - name: Build binary | |
| run: | | |
| poetry run pyinstaller \ |
Copilot
AI
Feb 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PyInstaller is being pointed at passifypdf/encryptpdf.py, but that file uses a relative import (from .cli import get_arg_parser). When executed as a script (which is how the frozen app runs the entry module), that relative import will fail. Use an entry point that imports the package module (e.g., a small top-level main.py that calls passifypdf.encryptpdf.main, or a passifypdf/__main__.py) and build from that instead.
| passifypdf/encryptpdf.py | |
| -m passifypdf.encryptpdf |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| Use the following CLI commands to launch the UI. | ||
| - UI allows you to drag-drop PDF file, encrypt it(password protect it) and then, download it. | ||
|
|
||
| Commands to run: | ||
| ```shell | ||
| uv sync --all-groups | ||
| uv pip install -r requirements-webui.txt | ||
| uv pip install -e . <---------- Important, otherwise it gives import error. | ||
| uv run streamlit run app/streamlit_app.py | ||
| ``` | ||
| Then, | ||
| Open: | ||
| http://localhost:8501/ | ||
|
|
||
| Screenshot: | ||
| <img width="1112" height="839" alt="image" src="https://github.com/user-attachments/assets/a5fdbe30-052e-4176-8abc-21a8c589f557" /> |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,118 @@ | ||||
| """Streamlit web UI wrapper for passifypdf. | ||||
|
|
||||
| Run locally with: | ||||
| streamlit run app/streamlit_app.py | ||||
| """ | ||||
|
|
||||
| import io | ||||
|
||||
| import io |
Copilot
AI
Feb 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tmp_in_path / tmp_out_path are created inside the try, but the finally always calls tmp_in_path.unlink(...) / tmp_out_path.unlink(...). If an exception occurs before either variable is assigned (e.g., temp file creation fails), the finally will raise UnboundLocalError and mask the original error. Initialize these paths to None before the try and guard the cleanup accordingly.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Requirements for the optional Streamlit web UI (app/streamlit_app.py) | ||
| # Install with: pip install -r requirements-webui.txt | ||
| streamlit>=1.35.0 | ||
|
nirmalchandra marked this conversation as resolved.
|
||
| passifypdf | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The matrix labels the macOS artifact as
arm64, butmacos-latestisn't guaranteed to stay on Apple Silicon. Pin the runner to an explicit version/arch (e.g.,macos-14for arm64) or rename the artifact to avoid claiming a specific architecture when it's not enforced.