-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (27 loc) · 922 Bytes
/
Makefile
File metadata and controls
36 lines (27 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
SOURCE := $(wildcard src/dpsprep/*.py)
ifneq ($(wildcard .git),)
VERSION := $(shell git describe --tags)
DATE := $(shell git log --max-count 1 --format=%as)
else
VERSION := $(shell uv version --short)
DATE := $(shell grep --only-matching --perl-regexp '(?<=$(VERSION) - ).*' CHANGELOG.md)
endif
.PHONY: lint test build-docs
lint:
uv run ruff check
uv run mypy
test:
uv run pytest
docs:
mkdir docs
docs/dpsprep.1: $(SOURCE) pyproject.toml docs/examples.man | docs
uv run click-man dpsprep \
--target docs \
--man-version $(VERSION) \
--man-date $(DATE)
cat docs/examples.man >> docs/dpsprep.1
# Render the man page as text and indent the entire file so that it is a valid markdown code block
docs/dpsprep.1.md: docs/dpsprep.1
echo -n ' ' > docs/dpsprep.1.md
MANWIDTH=100 man docs/dpsprep.1 | sed --null-data 's/\n/\n /g' | head --lines=-1 >> docs/dpsprep.1.md
build-docs: docs/dpsprep.1.md