.PHONY: install dev test lint format clean build publish

install:
	pip install -e .

dev:
	pip install -e ".[dev]"

test:
	pytest tests/ -v --cov=browser_hybrid --cov-report=term-missing

test-integration:
	pytest tests/ -v -m integration

lint:
	ruff check src/
	mypy src/browser_hybrid

format:
	ruff format src/

clean:
	rm -rf dist/ build/ *.egg-info
	rm -rf src/browser_hybrid/__pycache__ tests/__pycache__
	find . -type d -name __pycache__ -exec rm -rf {} +
	find . -type f -name "*.pyc" -delete

build: clean
	python -m build

publish: build
	twine upload dist/*

check: build
	twine check dist/*

# Run with Chrome debug mode
debug-chrome:
	/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
		--remote-debugging-port=9222 \
		--user-data-dir=/tmp/chrome-debug &

# Quick test
quick:
	python -c "from browser_hybrid import Browser; b = Browser(); print(b.get_version().browser)"