-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
86 lines (67 loc) · 2.17 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
SHELL=/bin/bash
PYTHON=python3.11
PYTHON_ENV=env
DOC_ROOT=doc
.PHONY: milan build clean fullclean shell \
dist _release \
test ci-test frontend demos browser \
doc _doc-release \
playwright-install playwright-browser
all: browser
# docker ######################################################################
milan:
docker compose run --service-ports milan $(args)
build:
docker compose build --no-cache
# python ######################################################################
clean:
rm -rf $(PYTHON_ENV)
fullclean:
rm -rf env
$(PYTHON_ENV): pyproject.toml
rm -rf $(PYTHON_ENV) && \
$(PYTHON) -m venv $(PYTHON_ENV) && \
. $(PYTHON_ENV)/bin/activate && \
pip install pip --upgrade && \
pip install -e .[dev]
shell: | $(PYTHON_ENV)
. $(PYTHON_ENV)/bin/activate && \
rlpython $(args)
# packaging ###################################################################
dist: | $(PYTHON_ENV)
. $(PYTHON_ENV)/bin/activate && \
rm -rf dist *.egg-info && \
$(PYTHON) -m build
_release: dist
. $(PYTHON_ENV)/bin/activate && \
twine upload --config-file ~/.pypirc.fscherf dist/*
# tests #######################################################################
test:
docker compose run milan tox $(args)
ci-test:
docker compose run milan MILAN_CI_TEST=1 tox -e py38,py39,py310,py311 $(args)
browser:
docker compose run milan milan run shell --user-data-dir=user-data $(args)
demos:
$(MAKE) test args="-- -k demos"
frontend: | $(PYTHON_ENV)
. $(PYTHON_ENV)/bin/activate && \
python -m milan.frontend.server --port=8080 $(args)
# documentation ###############################################################
doc: | $(PYTHON_ENV)
. $(PYTHON_ENV)/bin/activate && \
cd doc && \
mkdocs serve $(args)
_doc-release: | $(PYTHON_ENV)
. $(PYTHON_ENV)/bin/activate && \
cd doc && \
mkdocs build && \
rsync -avh --recursive --delete \
site/* pages.fscherf.de:/var/www/virtual/fscherf/pages.fscherf.de/milan
# playwright ##################################################################
playwright-install: | $(PYTHON_ENV)
. $(PYTHON_ENV)/bin/activate && \
playwright install $(args)
playwright-browser: | $(PYTHON_ENV)
. $(PYTHON_ENV)/bin/activate && \
$(PYTHON) scripts/run-playwright.py