.PHONY: clean test lint docker_up docker_down docker_test

clean:
	rm -rf env .coverage .pytest_cache .cache coverage.xml pyunit.xml
	find . | grep -E '__pycache__|\.pyc|\.pyo$\' | xargs rm -rf

test:
	AWS_SECRET_ACCESS_KEY=foobar_secret \
	AWS_ACCESS_KEY_ID=foobar_key \
	AWS_DEFAULT_REGION=us-east-1 env/bin/python3.11 -m pytest tests

lint:
	env/bin/flake8

docker_up:
	docker compose up --build -d function

docker_down:
	docker compose down --remove-orphans

docker_test:
	docker compose up \
			--exit-code-from unit-lint \
			--abort-on-container-exit \
			--build unit-lint
