# htag-sdk (PyPI) maintainer targets. Run from sdk/htag_developer_portal/python-sdk.
#
#   make test     run the test suite (includes the README-examples test)
#   make build    clean dist/, build sdist + wheel, twine check --strict
#   make check    test + build
#   make publish  check, then upload dist/* to PyPI
#
# `publish` depends on `check`, so a red suite or a failing metadata check stops
# the upload: the Python counterpart of the TypeScript `prepublishOnly` gate.
# Credentials come from the environment and are never echoed:
#   TWINE_USERNAME=__token__  TWINE_PASSWORD=<PyPI API token>

UV ?= uv
UVX ?= uvx
# Tool pins live here, not in pyproject/uv.lock, so the runtime lock stays untouched.
PYTEST ?= pytest>=8
TWINE ?= twine>=6

.PHONY: test build check publish

test:
	$(UV) run --with "$(PYTEST)" pytest -q

build:
	rm -rf dist
	$(UV) build
	$(UVX) --from "$(TWINE)" twine check --strict dist/*

check: test build

publish: check
	$(UVX) --from "$(TWINE)" twine upload dist/*
