-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (43 loc) · 1.69 KB
/
Copy pathMakefile
File metadata and controls
53 lines (43 loc) · 1.69 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
.PHONY: all help newpost openlatest update \
install_uv test deploy \
clean clean_coverage
all: ## Build the site, generate all pages from *.md files
uv run gg.py ./
help: ## Show this help
@grep -Eh '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
newpost: ## Create a new post .md file with current time
uv run gg.py --newpost
openlatest: ## Open the latest .md file in vim
@ls -1t `find . -type f -name '*.md'` | head -n 1 | xargs -o vim
update: ## Update ggpy
wget -q https://raw.githubusercontent.com/ooz/ggpy/master/gg.py -O gg.py
@echo "Unfortunately the Makefile cannot be updated automatically!"
@echo "Run the following command to update:"
@echo "wget -q https://raw.githubusercontent.com/ooz/ggpy/master/Makefile -O Makefile"
# Setup / dependencies / CI/CD
install_uv: ## Install uv for initial setup or CI
brew install uv
test: clean_coverage ## Run ggpy tests, coverage and lint (only typecheck for now)
uv sync
uv run coverage run --source=. -m pytest -vv
uv run coverage html --omit="test/*"
uv run coverage report --omit="test/*"
uv run mypy --install-types --non-interactive ./
deploy: all ## Build and publish by CI
git add .
git commit -m "Build by CI `date` [skip ci]" || true
git push
# Cleanup
clean: ## Cleanup python artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +
find . -name '.mypy_cache' -exec rm -rf {} +
find . -name '.pytest_cache' -exec rm -rf {} +
rm -rf .cache
rm -rf dist
rm -f *.egg-info
clean_coverage: ## Cleanup python test coverage artifacts
rm -rf htmlcov/
rm -f .coverage