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