ruff:
	@echo "Running ruff ..."
	@ruff check

ruff-fix:
	@echo "Running ruff-fix ..."
	@ruff check --fix

# We create a temporary common folder to simulate how it should work in a dedicated environment
copy-common:
	@mkdir common || true
	@cp -r backend common/
	@cp -r llm_assist common/
	@cp -r solutions common/

cleanup-common:
	@echo "Cleaning up ..."
	@rm -r common

mypy:
	@echo "Running mypy ..."
	@make copy-common
	-@mypy -p common --config-file=pyproject.toml
	@make cleanup-common



full-setup-unit-tests:
	@echo "Setting up unit tests ..."
	@python3 -m venv env_commons/;
	@source env_commons/bin/activate;
	@pip install -r requirements.github.txt
	@pip install -r tests/python/unit/requirements.txt
	@make copy-common
	@export PYTHONPATH="$(PYTHONPATH):$(PWD)";

unit-tests:
	@echo "Running unit tests ..."
	@pytest tests/python/unit --cov=backend --cov=solutions --cov=llm_assist