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-25 09:48:35 +02:00
|
|
|
.venv/bin/pip install -e .[develop]
|
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
|
|
|
|
2021-04-24 23:09:13 +02:00
|
|
|
# We can't force the develop to have all the versions locally, so
|
|
|
|
# the local tests only include python3.6
|
2021-04-24 19:38:03 +02:00
|
|
|
test: venv tox.ini
|
2021-04-24 23:09:13 +02:00
|
|
|
@ .venv/bin/tox -e py36
|
2021-04-24 19:38:03 +02:00
|
|
|
.PHONY: test
|
2021-04-24 22:22:12 +02:00
|
|
|
|
|
|
|
lint: venv
|
|
|
|
@ .venv/bin/tox -e lint
|
|
|
|
.PHONY: lint
|