forked from dholendar-27/aw-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (41 loc) · 1.43 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
.PHONY: aw-webui build install test typecheck package clean
build: aw-webui
poetry install
aw-webui:
mkdir -p aw_server/static/
ifeq ($(SKIP_WEBUI),true) # Skip building webui if SKIP_WEBUI is true
@echo "Skipping building webui"
else
make --directory=aw-webui build DEV=$(DEV)
cp -r aw-webui/dist/* aw_server/static/
# Needed for https://github.com/ActivityWatch/activitywatch/pull/274, works around https://github.com/pypa/pip/issues/6279
# https://github.com/ActivityWatch/activitywatch/pull/367 Other solutions have been tried but did not actually work.
# If you aren't sure windows long paths are working, don't remove this
rm -rf aw-webui/node_modules/.cache
endif
install:
cp misc/aw-server.service /usr/lib/systemd/user/aw-server.service
test:
@# Note that extensive integration tests are also run in the bundle repo,
@# for both aw-server and aw-server-rust, but without code coverage.
python -c 'import aw_server'
python -m pytest tests/test_server.py
typecheck:
python -m mypy aw_server tests --ignore-missing-imports
package:
python -m aw_server.__about__
pyinstaller aw-server.spec --clean --noconfirm
PYFILES=$(shell find . -name '*.py')
lint:
ruff check .
lint-fix:
poetry run pyupgrade --py38-plus --exit-zero-even-if-changed $(PYFILES)
ruff check --fix .
format:
black .
clean:
rm -rf build dist
rm -rf aw_server/__pycache__
rm -rf aw_server/static/*
pip3 uninstall -y aw_server
make --directory=aw-webui clean