-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (49 loc) · 1.7 KB
/
Makefile
File metadata and controls
57 lines (49 loc) · 1.7 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.PHONY: help
help:
@echo "COMMANDS:"
@echo " dist-build Build the distribution package"
@echo " dist-test Test the built distribution package"
@echo " docs-ci Build docs for COMPONENT's CI"
@echo " docs-linkcheck: Check for broken documentation links"
@echo " test Run the test suite"
@echo " lint Run pre-commit hooks on all files"
@echo " clean Remove build artifacts and temporary files"
@echo " help Show this help message"
.PHONY: dist-build
dist-build:
python -m build
.PHONY: dist-test
dist-test:
python -m venv venv-dist
venv-dist/bin/pip install dist/pulp_docs*.whl twine
venv-dist/bin/pulp-docs --version
# test mkdocs.yml is accessible via installed package
venv-dist/bin/python -c "from pulp_docs.cli import get_default_mkdocs; assert get_default_mkdocs()"
venv-dist/bin/twine check --strict dist/pulp_docs-*.whl
@echo "Build is fine!"
.PHONY: test
test:
uv run --with-requirements test_requirements.txt pytest
.PHONY: lint
lint:
pre-commit run -a
.PHONY: docs-linkcheck
docs-linkcheck:
@uv run pulp-linkchecker \
$$(git ls-files | grep '^docs/**/.*md$$') \
&& echo "No broken links found"
.PHONY: docs-ci
docs-ci: clean
ifndef COMPONENT
@echo "Error: COMPONENT is required"
@echo "Usage: make docs-ci COMPONENT=<component-name>"
@exit 1
endif
$(eval DOCS_PATH := "pulp-docs@..:$(COMPONENT)@..")
$(eval DOCS_TMPDIR := "/tmp/pulp-docs-tmp")
pulp-docs fetch --path-exclude "$(DOCS_PATH)" --dest "$(DOCS_TMPDIR)"
pulp-docs build --path "$(DOCS_PATH):$(DOCS_TMPDIR)"
@ls site || (echo "ERROR: something wen't wrong, 'site/' dir doesn't exist"; exit 1)
.PHONY: clean
clean:
rm -rf dist build venv-dist site