Skip to content

Add build scripts for release installers#2

Merged
jaredhowland merged 1 commit into
masterfrom
add-build-scripts-20260504202208
May 5, 2026
Merged

Add build scripts for release installers#2
jaredhowland merged 1 commit into
masterfrom
add-build-scripts-20260504202208

Conversation

@jaredhowland
Copy link
Copy Markdown
Collaborator

Adds build scripts (build_linux.sh, build_macos.sh, build_windows.ps1) required by release workflows.

Copilot AI review requested due to automatic review settings May 5, 2026 02:22
@jaredhowland jaredhowland merged commit d70a481 into master May 5, 2026
1 of 4 checks passed
@jaredhowland jaredhowland deleted the add-build-scripts-20260504202208 branch May 5, 2026 02:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a large set of new utility scripts under scripts/, including OS-specific build scripts intended for producing release installer artifacts.

Changes:

  • Add Linux/macOS/Windows build scripts for generating dist/ artifacts.
  • Add assorted developer utilities (queue worker/enqueue helpers, mock health server, monitoring launcher, e2e runner, extractor/LLM validation scripts).
  • Add dataset generation/evaluation scripts and a SQLite migration script.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 25 comments.

Show a summary per file
File Description
scripts/worker.py Adds a long-running queue worker CLI wrapper (currently references missing src.queue package).
scripts/validate_llm.py Adds a small LLM backend validation script (currently references missing ui.backend package).
scripts/start-monitoring.sh Adds a docker-compose-based monitoring launcher (references missing compose file).
scripts/run_extractor_tests.py Adds an extractor smoke-test script that generates sample inputs (references missing src/ + extractor).
scripts/run_e2e.sh Adds a Playwright/pytest e2e runner (references missing tests/ tree).
scripts/queue_worker.sh Adds a wrapper to run a queue worker module (references missing src.queue.worker).
scripts/queue_enqueue.sh Adds a helper to enqueue a file into the queue (references missing src.queue).
scripts/prepare_finetune_openai.sh Adds a converter to OpenAI fine-tune JSONL format.
scripts/mock_health_server.py Adds a simple HTTP mock server for health endpoints.
scripts/migrate_add_email_settings.sql Adds a SQLite migration for email settings/logs tables.
scripts/llm_test_cli.py Adds a CLI for testing LLM generation (currently references missing ui.backend package).
scripts/install_playwright.sh Adds a helper to install Playwright browsers (currently masks failures).
scripts/generate_sample_dataset.py Adds a ReportLab-based generator for sample agreement PDFs + JSON summaries.
scripts/generate_sample_dataset_nopdf.py Adds a “no external deps” PDF generator variant (currently writes malformed PDFs via incorrect xref offsets).
scripts/generate_dataset.py Adds synthetic JSONL dataset generation for LLM training splits.
scripts/finetune_local.sh Adds a local fine-tuning guidance script (mostly informational).
scripts/export.sh Adds an exporter runner wrapper (references missing src/ + exporter module).
scripts/evaluate.py Adds a simple evaluation script that writes metrics to data/llm-training/eval.json.
scripts/enqueue_sample.py Adds a script to enqueue sample files as jobs (references missing src.queue).
scripts/dev-run.sh Adds a dev runner for backend+frontend (references missing src/ tree; trap is set too late to reliably clean up).
scripts/build_windows.sh Adds a Bash-based Windows PyInstaller build script (references missing src/exporter/exporter.py).
scripts/build_windows.ps1 Adds a PowerShell Windows build script (uses invalid -ErrorAction with pip; references missing build config).
scripts/build_macos.sh Adds a macOS PyInstaller build script (references missing src/exporter/exporter.py; PATH reliability issue).
scripts/build_linux.sh Adds a Linux PyInstaller build script (references missing src/exporter/exporter.py; PATH reliability issue).
scripts/init.py Declares scripts as a Python package.
Comments suppressed due to low confidence (1)

scripts/dev-run.sh:20

  • The cleanup trap is installed after npm run dev completes, but npm run dev typically runs indefinitely; if the user interrupts (Ctrl+C) the trap won’t be set and the backend process will be left running. Move the trap "kill $BACKEND_PID" EXIT immediately after capturing BACKEND_PID (and consider also handling INT/TERM) so the backend is always cleaned up.
python3 -m uvicorn src.ui.backend.main:app --reload --port 8000 &
BACKEND_PID=$!

# Start frontend
echo "Starting frontend (Vite)"
cd "$ROOT_DIR/src/ui/frontend"
# Install dependencies if node_modules missing
if [ ! -d node_modules ]; then
  npm install --no-audit --no-fund
fi
npm run dev

# On exit, kill backend
trap "kill $BACKEND_PID" EXIT


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/build_linux.sh
Comment on lines +1 to +3
#!/usr/bin/env bash
set -euo pipefail
# Build script for Linux using PyInstaller. Run from project root: ./scripts/build_linux.sh
Comment thread scripts/build_linux.sh
Comment on lines +5 to +12
ENTRY_PY="$PROJECT_ROOT/src/exporter/exporter.py"
DIST_DIR="$PROJECT_ROOT/dist"
mkdir -p "$DIST_DIR"

echo "Installing PyInstaller..."
python3 -m pip install --upgrade pyinstaller --user || true

echo "Running PyInstaller (Linux)..."
Comment thread scripts/build_macos.sh
Comment on lines +5 to +8
ENTRY_PY="$PROJECT_ROOT/src/exporter/exporter.py"
DIST_DIR="$PROJECT_ROOT/dist"
mkdir -p "$DIST_DIR"

Comment thread scripts/build_windows.sh
Comment on lines +6 to +7
ENTRY_PY="$PROJECT_ROOT/src/exporter/exporter.py"
DIST_DIR="$PROJECT_ROOT/dist"
Comment thread scripts/build_linux.sh
python3 -m pip install --upgrade pyinstaller --user || true

echo "Running PyInstaller (Linux)..."
pyinstaller --onefile --name library-installer "$ENTRY_PY" --distpath "$DIST_DIR" || {
Comment on lines +6 to +10
uv run playwright install --with-deps || true
fi
python3 -m playwright install --with-deps || true

echo "Playwright browsers install attempted. Check output above for errors." No newline at end of file
Comment on lines +6 to +10
python3 - <<'PY'
import json
from pathlib import Path
inpath = Path('data/llm-training/train.jsonl')
outpath = Path('data/llm-training/openai_finetune.jsonl')
Comment on lines +2 to +15
import json
import random
from pathlib import Path

OUT_DIR = Path('data/llm-training')
OUT_DIR.mkdir(parents=True, exist_ok=True)

TOTAL = 900
TRAIN = 700
VAL = 100
TEST = TOTAL - TRAIN - VAL

critical_keywords = ['liability', 'data-sharing', 'termination', 'confidentiality', 'indemnify']

Comment thread scripts/evaluate.py
#!/usr/bin/env python3
import json
from pathlib import Path
from collections import Counter
@@ -0,0 +1,34 @@
import json
from http.server import BaseHTTPRequestHandler, HTTPServer
import threading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants