-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
53 lines (35 loc) · 1.77 KB
/
Makefile
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
export FLASK_APP = csvbase.web.app:init_app()
export FLASK_ENV = development
version :=$(file < csvbase/VERSION)
.PHONY: tox serve serve-gunicorn release default static-deps
default: tox
static-deps: csvbase/web/static/codehilite.css csvbase/web/static/codehilite-dark.css csvbase/web/static/bootstrap.min.css csvbase/web/static/bootstrap.bundle.js tests/test-data/sitemap.xsd
.venv: .venv/touchfile
.venv/touchfile: pyproject.toml requirements.txt
test -d .venv || python3 -m venv .venv
. .venv/bin/activate; python -m pip install .
touch $@
csvbase/web/static/codehilite.css: .venv/touchfile
. .venv/bin/activate; pygmentize -S default -f html -a .highlight > $@
csvbase/web/static/codehilite-dark.css: .venv/touchfile
. .venv/bin/activate; pygmentize -S lightbulb -f html -a .highlight > $@
serve: .venv static-deps
. .venv/bin/activate; flask run -p 6001
serve-gunicorn: .venv static-deps
. .venv/bin/activate; gunicorn -w 1 '$FLASK_APP' --access-logfile=- -t 30 -b :6001
tox: static-deps
tox -e py39
bootstrap-5.3.1-dist.zip:
curl -O -L https://github.com/twbs/bootstrap/releases/download/v5.3.1/bootstrap-5.3.1-dist.zip
csvbase/web/static/bootstrap.min.css: bootstrap-5.3.1-dist.zip
unzip -p bootstrap-5.3.1-dist.zip bootstrap-5.3.1-dist/css/bootstrap.min.css > $@
csvbase/web/static/bootstrap.bundle.js: bootstrap-5.3.1-dist.zip
unzip -p bootstrap-5.3.1-dist.zip bootstrap-5.3.1-dist/js/bootstrap.bundle.js > $@
tests/test-data/sitemap.xsd:
curl -s -L https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd > $@
dump-schema:
pg_dump -d csvbase --schema-only --schema=metadata
release: dist/csvbase-$VERSION-py3-none-any.whl
dist/csvbase-$VERSION-py3-none-any.whl: static-deps
. .venv/bin/activate; python -m pip install build==1.2.1
. .venv/bin/activate; python -m build