.PHONY : all clean build upload

all: install clean

clean:
	@rm -rf `find ./ -type d -name "*__pycache__"`
	@rm -rf ./build/ ./dist/ ./coercer.egg-info/

docs:
	@python3 -m pip install pdoc --break-system-packages
	@echo "[$(shell date)] Generating docs ..."
	@PDOC_ALLOW_EXEC=1 python3 -m pdoc -d markdown -o ./documentation/ ./coercer/
	@echo "[$(shell date)] Done!"

install: build
	pip install . --break-system-packages

build:
	python3 -m pip uninstall coercer --yes --break-system-packages
	pip install .[build] --break-system-packages
	python3 -m build --wheel

upload: build
	pip install .[twine] --break-system-packages
	twine upload dist/*
