Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
40
Makefile
Normal file
40
Makefile
Normal file
@ -0,0 +1,40 @@
|
||||
SCRIPTS = $(patsubst scripts/%.py,ups-%,$(wildcard scripts/*.py))
|
||||
SCRIPTS += $(patsubst scripts/%.sh,ups-%,$(wildcard scripts/*.sh))
|
||||
|
||||
PY_SRCS = $(wildcard lib/*.py)
|
||||
VERSION = $(shell grep 'version' pyproject.toml | cut -d' ' -f3 | sed 's/"//g')
|
||||
WHEEL = dist/ups-$(VERSION)-py3-none-any.whl
|
||||
|
||||
PYTHON = python3
|
||||
DESTDIR = ~/.local/bin
|
||||
|
||||
all: $(WHEEL)
|
||||
|
||||
$(WHEEL): $(PY_SRCS) pyproject.toml
|
||||
python3 -m build
|
||||
|
||||
install: $(SCRIPTS)
|
||||
$(PYTHON) -m pip install --force-reinstall \
|
||||
--break-system-packages $(WHEEL)
|
||||
|
||||
ups-%: scripts/%.py
|
||||
install -Dm755 $< $(DESTDIR)/$@
|
||||
|
||||
ups-%: scripts/%.sh
|
||||
install -Dm755 $< $(DESTDIR)/$@
|
||||
|
||||
uninstall:
|
||||
for script in $(TARGETS); do \
|
||||
rm -f $(DESTDIR)/$$script; \
|
||||
done
|
||||
|
||||
format:
|
||||
black -l 80 */*.py
|
||||
|
||||
check:
|
||||
black --check -l 80 */*.py
|
||||
|
||||
clean:
|
||||
rm -rf dist
|
||||
|
||||
.PHONY: install uninstall format check clean
|
Reference in New Issue
Block a user