SHELL := /bin/bash

.PHONY: all test clean format lint publish release

all: sync test

sync:
	uv sync

test:
	uv run pytest tests/ -v

format:
	uv run black src/photompy/*

lint: format
	uv run flake8 --ignore=E114,E116,E117,E231,E266,E303,E501,W293,W291,W503 src/photompy/*

clean:
	@echo "Cleaning directory..."
	@find . -type f -name "*.py[co]" -delete
	@find . -type d -name "__pycache__" -delete
	@find . -type f -name "*~" -delete
	@find . -type f -name "*.kate-swp" -delete
	@echo "Done"

publish:
	rm -rf dist build */*.egg-info *.egg-info
	uv build
	uv publish

release:
	bash scripts/release.sh $(VERSION)
	$(MAKE) publish
