.PHONY: clean help

help:
	clear;
	@echo "================= Usage =================";
	@echo "clean                  : Remove autogenerated folders and artifacts.";
	@echo "clean-pyc              : Remove python artifacts."
	@echo "clean-build            : Remove build artifacts."
	@echo "test                   : Run tests and generate coverage report.";

# Clean the folder from build/test related folders
clean: clean-build clean-pyc
	rm -rf .mypy_cache/ .pytest_cache/
	rm -f .coverage

clean-pyc:
	find . \( -name '*.pyc' -o -name '*.pyo' \) -exec rm -rf {} +

clean-build:
	rm -rf build/ dist/ *.egg-info

# Install requirements for testing and run tests
test:
	python3 -m poetry install --with test
	python3 -m poetry run pytest