ups/Makefile
ngn ab580d6a18
Some checks failed
format / build (push) Failing after 6s
initial commit
Signed-off-by: ngn <ngn@ngn.tf>
2025-05-02 18:20:24 +03:00

41 lines
828 B
Makefile

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