-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (46 loc) · 1.47 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
VERSION := $(shell grep -m 1 version pyproject.toml | tr -s ' ' | tr -d '"' | tr -d "'" | cut -d' ' -f3)
define SCRIPT
if ! type pip &> /dev/null; then
if ! type opkg &> /dev/null; then
echo "Opkg not found, please install toltec"
exit 1
fi
opkg update
opkg install python3-pip
fi
pip install --force-reinstall /tmp/liboxide-${VERSION}-py3-none-any.whl
endef
export SCRIPT
ifeq ($(VENV_BIN_ACTIVATE),)
VENV_BIN_ACTIVATE := .venv/bin/activate
endif
dist/liboxide-${VERSION}.tar.gz: $(shell find liboxide -type f)
python -m build --sdist
dist/liboxide-${VERSION}-py3-none-any.whl: $(shell find liboxide -type f)
python -m build --wheel
clean:
git clean --force -dX
deploy: dist/liboxide-${VERSION}-py3-none-any.whl
rsync dist/liboxide-${VERSION}-py3-none-any.whl [email protected]:/tmp
install: deploy
echo -e "$$SCRIPT" | ssh [email protected] bash -le
test: install
cat test.py | ssh [email protected] /opt/bin/python -u
$(VENV_BIN_ACTIVATE):
@echo "Setting up development virtual env in .venv"
python -m venv .venv
. $(VENV_BIN_ACTIVATE); \
python -m pip install ruff
lint: $(VENV_BIN_ACTIVATE)
. $(VENV_BIN_ACTIVATE); \
python -m ruff check
lint-fix: $(VENV_BIN_ACTIVATE)
. $(VENV_BIN_ACTIVATE); \
python -m ruff check
format: $(VENV_BIN_ACTIVATE)
. $(VENV_BIN_ACTIVATE); \
python -m ruff format --diff
format-fix: $(VENV_BIN_ACTIVATE)
. $(VENV_BIN_ACTIVATE); \
python -m ruff format
.PHONY: clean install test deploy lint lint-fix format format-fix