diff --git a/Jenkinsfile b/Jenkinsfile index b93c312..5155906 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,7 +12,7 @@ pipeline { } stage('Test') { - steps { sh 'make test' } + steps { sh './test.sh' } } } diff --git a/Makefile b/Makefile deleted file mode 100644 index 241709e..0000000 --- a/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -.PHONY: help render validate test check - -INPUT ?= examples/example-report.yaml -OUTPUT ?= build/report.pdf - -help: - @echo 'make render INPUT=report.yaml OUTPUT=report.pdf' - @echo 'make validate INPUT=report.yaml' - @echo 'make test' - -render: - bash tools/render.sh "$(INPUT)" --output "$(OUTPUT)" - -validate: - bash tools/validate.sh "$(INPUT)" - -test: - uv venv --python 3.11 --allow-existing .venv - uv pip sync --python .venv/bin/python requirements.txt - .venv/bin/python -m unittest discover -s tests -p 'test_*.py' -v - -check: test diff --git a/README.md b/README.md index 8140344..1c94161 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,6 @@ and DejaVu Sans Mono. ## Render a report -```bash -make render \ - INPUT=examples/example-report.yaml \ - OUTPUT=output/example-report.pdf -``` - -Or call the renderer directly: - ```bash bash tools/render.sh report.yaml --output report.pdf ``` @@ -45,7 +37,7 @@ command name. ## Validate a report ```bash -make validate INPUT=examples/example-report.yaml +bash tools/validate.sh examples/example-report.yaml ``` The version 1 format supports metadata, branding, summaries, timelines, diff --git a/docs/development.md b/docs/development.md index c7db733..a800e81 100644 --- a/docs/development.md +++ b/docs/development.md @@ -6,11 +6,11 @@ authoring are documented in the main [README](../README.md) and ## Test environment -Tests require uv and Typst. The Makefile creates `.venv`, synchronizes the pinned +Tests require uv and Typst. `test.sh` creates `.venv` and synchronizes the pinned packages from `requirements.txt`, and invokes Python only from that environment. ```bash -make test +./test.sh ``` Poppler's `pdfinfo` and `pdftotext` enable additional pagination and extracted diff --git a/docs/report-contract.md b/docs/report-contract.md index 0f0c0ae..8d5c16c 100644 --- a/docs/report-contract.md +++ b/docs/report-contract.md @@ -9,12 +9,12 @@ PDF rendering are implemented by the standalone component. Typst and Bash are required at runtime. From this component checkout: ```bash -make validate INPUT=examples/example-report.yaml -make validate INPUT=examples/example-report.json -make test +bash tools/validate.sh examples/example-report.yaml +bash tools/validate.sh examples/example-report.json +./test.sh ``` -`make test` creates and synchronizes `.venv` with uv before invoking Python. +`./test.sh` creates and synchronizes `.venv` with uv before invoking Python. Python is not used by validation or rendering. Validation needs no sibling repositories and works from any working directory using explicit paths. It writes no files. Exit codes: 0 valid, 1 invalid/unreadable input or missing dependencies, 2 CLI usage error. @@ -25,7 +25,7 @@ Errors identify the offending JSON path; unsupported file extensions are rejecte After installing Typst: ```bash -make render INPUT=examples/example-report.yaml OUTPUT=output/report.pdf +bash tools/render.sh examples/example-report.yaml --output output/report.pdf ``` Validation always runs before Typst. Relative branding assets resolve from the diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..eff8349 --- /dev/null +++ b/test.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" +uv venv --python 3.11 --allow-existing .venv +uv pip sync --python .venv/bin/python requirements.txt +.venv/bin/python -m unittest discover -s tests -p 'test_*.py' -v