# PicoStream - Justfile set windows-shell := ["C:\\Program Files\\Git\\bin\\sh.exe", "-c"] # Default: show available commands default: @just --list # Run the picostream GUI application gui: PYTHONPATH=. uv run picostream/main.py # Run with MOCK device (no hardware needed) mock: PYTHONPATH=. uv run python -c "import os; os.environ['MOCK_PICO'] = '1'; from picostream.main import main; main()" # Format all code fmt: uv run ruff format picostream/ # Check code formatting without fixing fmt-check: uv run ruff format --check picostream/ # Lint code lint: uv run ruff check picostream/ # Fix linting issues lint-fix: uv run ruff check --fix picostream/. # Type check code type-check: uv run pyright picostream/ # Run all checks (format check, lint, type-check) check: fmt-check lint type-check @echo "✓ All checks passed" # Run all checks and fix what can be fixed fix: lint-fix fmt @echo "✓ Code fixed" # Run all dev tools (tests run even if type-check fails) devtools: fix fmt-check lint test type-check # Run all tests test: PYTHONPATH=. uv run pytest picostream -v # Run tests with coverage test-cov: PYTHONPATH=. uv run pytest picostream --cov=picostream --cov-report=term-missing -v # Run tests and generate HTML coverage report test-cov-html: PYTHONPATH=. uv run pytest picostream --cov=picostream --cov-report=html -v @echo "Coverage report: file://$(pwd)/htmlcov/index.html" # Profile the PicoStream GUI (outputs to profile.stats) profile: PYTHONPATH=. uv run python -m cProfile -o profile.stats picostream/main.py # View profile results in browser (snakeviz) profile-view: uv run snakeviz profile.stats # Print top 20 functions by cumulative time (quick CLI view) profile-text: uv run python -c "import pstats; p = pstats.Stats('profile.stats'); p.sort_stats('cumulative').print_stats(20)" # Build the picostream GUI executable with PyInstaller build: uv pip install pyinstaller pyinstaller-hooks-contrib uv run pyinstaller \ --name PicoStream \ --onefile \ --windowed \ --collect-all vispy \ --icon assets/icons/app.ico \ picostream/main.py # Sync dependencies (install/update) sync: uv sync # Update all dependencies update: uv lock --upgrade # Clean build artifacts and caches clean: rm -rf build/ dist/ picostream/*.spec __pycache__ .pytest_cache .ruff_cache find picostream -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true find picostream -type f -name "*.pyc" -delete 2>/dev/null || true