.PHONY: install dev test lint format clean build publish docs

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

dev: install
	pre-commit install

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

lint:
	ruff check src/ecom_foundation_core tests/
	mypy src/ecom_foundation_core

format:
	ruff format src/ecom_foundation_core tests/

clean:
	rm -rf build/
	rm -rf dist/
	rm -rf *.egg-info
	find . -type f -name "*.pyc" -delete
	find . -type d -name __pycache__ -delete

build: clean
	python3 -m build

publish-test:
	python3 -m twine upload --repository testpypi dist/*

publish:
	python3 -m twine upload dist/*

docs:
	cd docs && make html

check-stability:
	docker compose -f docker-compose.test.yml run --rm test_suite pytest tests/ -vv
