46 lines
788 B
Makefile
46 lines
788 B
Makefile
# =====CONFIG=====
|
|
# Devop environment runs in 3.8
|
|
# TODO switch this to python3.6
|
|
PYTHON=python3.9
|
|
|
|
|
|
# =====RECIPES=====
|
|
.venv/bin/activate: setup.py
|
|
'$(PYTHON)' -m venv .venv
|
|
.venv/bin/pip install -e .[dev]
|
|
|
|
venv: .venv/bin/activate
|
|
.PHONY: venv
|
|
|
|
format: venv
|
|
@ .venv/bin/black setup.py app/*.py app/**/*.py
|
|
.PHONY: format
|
|
|
|
clean:
|
|
rm -rf .venv
|
|
rm backup_tool
|
|
.PHONY: clean
|
|
|
|
backup_tool:
|
|
@ cd app && \
|
|
zip -r ../app.zip * \
|
|
-x "__pycache__/*" "**/__pycache__/*" ".vim/*" "**/.vim/*"
|
|
@ echo "#!/usr/bin/env python3" | cat - app.zip > backup_tool
|
|
@ chmod a+x backup_tool
|
|
@ rm app.zip
|
|
|
|
app: backup_tool
|
|
.PHONY: app
|
|
|
|
install: app
|
|
cp backup_tool /usr/local/bin
|
|
.PHONY: install
|
|
|
|
test: venv tox.ini
|
|
@ .venv/bin/tox
|
|
.PHONY: test
|
|
|
|
lint: venv
|
|
@ .venv/bin/tox -e lint
|
|
.PHONY: lint
|