.PHONY: build test typecheck clean examples

build:
	poetry install

test:
	python -c "import aw_client"
	# test_client.py needs a live server, test_failqueue.py is interactive, and
	# test_auth.py sets XDG_* (ignored by platformdirs on macOS/Windows).
	pytest -s -vv tests --ignore=tests/test_client.py --ignore=tests/test_failqueue.py --ignore=tests/test_auth.py

test-integration:
	pytest -v tests/test_client.py

test-examples:
	cd examples; pytest -v *.py
	cd examples; yes | python3 load_dataframe.py
	cd examples; python3 working_hours.py 'activitywatch|aw-|github.com' fakedata

lint:
	ruff check .

lint-fix:
	ruff check --fix .

typecheck:
	poetry run mypy

format:
	ruff format .

clean:
	rm -rf build dist
	rm -rf aw_client/__pycache__
