-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (56 loc) · 2.15 KB
/
Copy pathMakefile
File metadata and controls
69 lines (56 loc) · 2.15 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
58
59
60
61
62
63
64
65
66
67
68
69
# Suppress all recipe lines from being printed to the terminal, for cleaner output
.SILENT:
# Suppress "Entering/Leaving directory" messages for cleaner output
MAKEFLAGS += --no-print-directory
.PHONY: help clean clean-build clean-cache clean-sites clean-test docs logo requirements
# Help
help:
@echo "clean - remove all build, test, coverage and Python artifacts"
@echo "clean-build - remove build artifacts"
@echo "clean-cache - remove Python cache files and temp files"
@echo "clean-sites - remove deploy directories from starter sites"
@echo "clean-test - remove test and coverage artifacts"
@echo "docs - generate HTML documentation"
@echo "logo - generate favicons and small logos for docs"
@echo "requirements - update requirements.txt and upgrade packages"
# Clean
clean: clean-build clean-cache clean-sites clean-test
clean-build:
rm -rf build/ dist/ .eggs/ *.egg-info
clean-cache:
find . \( \
-type d \( \
-name '__pycache__' -o \
-name '.mypy_cache' -o \
-name '.pytest_cache' -o \
-name '.ruff_cache' \
\) -prune -exec rm -rf {} + \
-o \
-type f \( \
-name '*.pyc' -o \
-name '*.pyo' -o \
-name '*~' \
\) -exec rm -f {} + \
\)
clean-sites:
find logya/sites/ -type d -name public -exec rm -rf {} +
clean-test:
rm -rf .coverage* htmlcov/ .tox/ .nox/ t/
# Documentation
docs:
hatch run logya gen -d logya/sites/docs
# Logo / favicon generation
logo:
convert images/wordmark.svg -define icon:auto-resize=64,48,32,16 logya/sites/docs/static/favicon.ico
convert images/logo.svg -resize x40 -transparent white logya/sites/docs/static/img/logya-small.png
cp logya/sites/docs/static/favicon.ico logya/sites/base/static/favicon.ico
cp logya/sites/docs/static/favicon.ico logya/sites/i18n/static/favicon.ico
cp logya/sites/docs/static/img/logya-small.png logya/sites/base/static/img/logya-small.png
# Requirements management
requirements:
pip freeze --local > requirements.txt
sed -i 's/==/>=/g' requirements.txt
pip install --upgrade -r requirements.txt
# Keep base requirements only
grep -f requirements-base.txt requirements.txt > requirements.tmp
mv requirements.tmp requirements.txt