diff options
| author | Sam Scholten | 2026-03-30 11:42:22 +1000 |
|---|---|---|
| committer | Sam Scholten | 2026-03-30 11:42:22 +1000 |
| commit | 637ddc52f4dc23ba3aa7cccef014aa85cab36b49 (patch) | |
| tree | d9116fb184f32741bf1c8571ab6160be0b08acb3 /justfile | |
| parent | 5a7c47d626ff3fc1352b2036001e853ae211d1af (diff) | |
| download | picostream-c6fc92917d325b1cb4f1ce2720b2365aabc15a7b.tar.gz picostream-c6fc92917d325b1cb4f1ce2720b2365aabc15a7b.zip | |
Release v1.0.0v1.0
Diffstat (limited to 'justfile')
| -rw-r--r-- | justfile | 92 |
1 files changed, 88 insertions, 4 deletions
@@ -1,12 +1,96 @@ -set windows-shell := ["C:\\Program Files\\Git\\bin\\sh.exe","-c"] +# 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 -# Build the picostream GUI executable -build-gui: +# 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 --clean PicoStream.spec --noconfirm + 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 |
