Cleaned up Makefile [CI SKIP]

pull/18/head
Jef Roosens 2021-04-28 16:19:53 +02:00
parent 1453de9346
commit d39faee995
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
1 changed files with 15 additions and 13 deletions

View File

@ -1,27 +1,28 @@
# =====CONFIG===== # =====CONFIG=====
# Devop environment runs in 3.8 PYTHON := python3.6
# TODO switch this to python3.6 VENV := .venv
PYTHON=python3.6
# =====RECIPES===== # =====RECIPES=====
.venv/bin/activate: setup.py # Create the virtual environment
'$(PYTHON)' -m venv .venv $(VENV)/bin/activate: setup.py
.venv/bin/pip install -e .[develop] '$(PYTHON)' -m venv '$(VENV)'
'$(VENV)/bin/pip' install -e .[develop]
venv: .venv/bin/activate venv: $(VENV)/bin/activate
.PHONY: venv .PHONY: venv
# Format the codebase using Black
format: venv format: venv
@ .venv/bin/black setup.py app/*.py app/**/*.py @ '$(VENV)/bin/black' setup.py app/*.py app/**/*.py
.PHONY: format .PHONY: format
# Remove any temporary files
clean: clean:
rm -rf .venv @ rm -rf '$(VENV)' .tox backup_tool
rm -rf .tox
rm backup_tool
.PHONY: clean .PHONY: clean
# Pack the package into a zipfile
backup_tool: backup_tool:
@ cd app && \ @ cd app && \
zip -r ../app.zip * \ zip -r ../app.zip * \
@ -33,6 +34,7 @@ backup_tool:
app: backup_tool app: backup_tool
.PHONY: app .PHONY: app
# Install the app
install: app install: app
cp backup_tool /usr/local/bin cp backup_tool /usr/local/bin
.PHONY: install .PHONY: install
@ -40,9 +42,9 @@ install: app
# We can't force the develop to have all the versions locally, so # We can't force the develop to have all the versions locally, so
# the local tests only include python3.6 # the local tests only include python3.6
test: venv tox.ini test: venv tox.ini
@ .venv/bin/tox -e py36 @ '$(VENV)/bin/tox' -e py36
.PHONY: test .PHONY: test
lint: venv lint: venv
@ .venv/bin/tox -e lint @ '$(VENV)/bin/tox' -e lint
.PHONY: lint .PHONY: lint