.PHONY: all
all: build test

.PHONY: build
build:
	uv build

.PHONY: test
test:
	uv run pytest

# uv publish uploads every file in dist/, including builds of old
# versions; publish only the artifacts of the current version.
VERSION := $(shell sed -n 's/^version = "\(.*\)"/\1/p' pyproject.toml)

.PHONY: publish
publish: build test
	uv publish dist/strikethrough_ocr-$(VERSION)-py3-none-any.whl dist/strikethrough_ocr-$(VERSION).tar.gz
