aboutsummaryrefslogtreecommitdiffstats
path: root/justfile
diff options
context:
space:
mode:
authorLouis Burda <dev@sinitax.com>2026-02-28 18:54:19 +0100
committerLouis Burda <dev@sinitax.com>2026-02-28 18:54:19 +0100
commitbe1dd21f8e4fbd5361531b4d8727a0d0d243e8ec (patch)
treee7b540012e0510d1304d2dac8e137545ae103f75 /justfile
parentd70a199a72bf9a69eb4a3fcf166b0435918b2e33 (diff)
downloadselectui-main.tar.gz
selectui-main.zip
Add tests and justfileHEADmain
Diffstat (limited to 'justfile')
-rw-r--r--justfile90
1 files changed, 90 insertions, 0 deletions
diff --git a/justfile b/justfile
new file mode 100644
index 0000000..9586090
--- /dev/null
+++ b/justfile
@@ -0,0 +1,90 @@
+# Justfile for selectui development tasks
+
+# Unset VIRTUAL_ENV to avoid conflicts with uv
+export VIRTUAL_ENV := ""
+
+# Default recipe - show available commands
+default:
+ @just --list
+
+# Install dependencies (including dev dependencies)
+install:
+ uv sync --all-groups
+
+# Run all checks (ruff + mypy)
+check: check-ruff check-mypy
+
+# Run ruff linter
+check-ruff:
+ @echo "Running ruff..."
+ uv run ruff check src/ tests/ examples/
+
+# Run mypy type checker
+check-mypy:
+ @echo "Running mypy..."
+ uv run mypy src/ tests/ examples/
+
+# Run all tests with pytest
+test:
+ @echo "Running pytest..."
+ uv run pytest tests/ -v --tb=short
+
+# Run tests with coverage report
+test-cov:
+ @echo "Running pytest with coverage..."
+ uv run pytest tests/ -v --cov=src/selectui --cov-report=term-missing --cov-report=html
+
+# Fix all auto-fixable issues
+fix: fix-ruff
+
+# Run ruff with auto-fix
+fix-ruff:
+ @echo "Running ruff --fix..."
+ uv run ruff check src/ tests/ examples/ --fix
+
+# Format code with ruff
+fmt:
+ @echo "Formatting code with ruff..."
+ uv run ruff format src/ tests/ examples/
+
+# Run all checks and tests
+ci: check test
+ @echo "✅ All checks and tests passed!"
+
+# Clean build artifacts
+clean:
+ @echo "Cleaning build artifacts..."
+ rm -rf build/ dist/ *.egg-info .pytest_cache .mypy_cache .ruff_cache htmlcov/ .coverage
+ find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
+
+# Run the demo (interactive)
+demo:
+ @echo "Running interactive demo..."
+ @echo "This will launch the selectui with sample data"
+ @echo "Press Ctrl+C to exit"
+ @echo ""
+ cat examples/example.json | jq -c '.[]' | uv run selectui
+
+# Run a specific example
+example NUM:
+ @echo "Running example {{NUM}}..."
+ uv run python examples/pydantic_example.py {{NUM}}
+
+# Watch tests (requires entr)
+watch-test:
+ @echo "Watching for changes..."
+ find src tests -name "*.py" | entr -c just test
+
+# Show project info
+info:
+ @echo "Project: selectui"
+ @echo "Python: $(uv run python --version)"
+ @echo "Dependencies:"
+ @uv pip list
+
+# Lint everything (alias for check)
+lint: check
+
+# Run pre-commit checks (check + test)
+pre-commit: check test
+ @echo "✅ Pre-commit checks passed!"