2021-01-15 14:14:13 +01:00
|
|
|
# =====CONFIG=====
|
|
|
|
# Devop environment runs in 3.8
|
2021-04-24 19:27:33 +02:00
|
|
|
# TODO switch this to python3.6
|
2021-04-24 22:56:27 +02:00
|
|
|
PYTHON=python3.6
|
2021-01-15 14:14:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
# =====RECIPES=====
|
2021-04-24 19:27:33 +02:00
|
|
|
.venv/bin/activate: setup.py
|
2021-01-15 14:14:13 +01:00
|
|
|
'$(PYTHON)' -m venv .venv
|
2021-04-24 22:56:27 +02:00
|
|
|
.venv/bin/pip install -e .[dev] -e .[ci]
|
2021-01-15 14:14:13 +01:00
|
|
|
|
2021-01-15 17:58:29 +01:00
|
|
|
venv: .venv/bin/activate
|
2021-01-15 14:14:13 +01:00
|
|
|
.PHONY: venv
|
|
|
|
|
|
|
|
format: venv
|
2021-04-24 19:27:33 +02:00
|
|
|
@ .venv/bin/black setup.py app/*.py app/**/*.py
|
2021-01-15 14:14:13 +01:00
|
|
|
.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
|
2021-04-24 19:27:33 +02:00
|
|
|
.PHONY: install
|
2021-04-24 19:38:03 +02:00
|
|
|
|
|
|
|
test: venv tox.ini
|
|
|
|
@ .venv/bin/tox
|
|
|
|
.PHONY: test
|
2021-04-24 22:22:12 +02:00
|
|
|
|
|
|
|
lint: venv
|
|
|
|
@ .venv/bin/tox -e lint
|
|
|
|
.PHONY: lint
|