Added Makefile & first requirements (#2)
This commit is contained in:
parent
ea713afd65
commit
c32c9035d8
3 changed files with 54 additions and 0 deletions
41
Makefile
Normal file
41
Makefile
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# =====CONFIG=====
|
||||
PYTHON := python3.9
|
||||
# This can't contain spaces (I think)
|
||||
VENV := venv
|
||||
|
||||
|
||||
# By default, just create the venv when needed
|
||||
all: venv
|
||||
|
||||
|
||||
# Create the venv
|
||||
$(VENV)/bin/activate: requirements.txt requirements-dev.txt
|
||||
@ '$(PYTHON)' -m venv '$(VENV)'
|
||||
@ '$(VENV)'/bin/pip install -r requirements.txt -r requirements-dev.txt
|
||||
|
||||
# Convenient alias for the venv
|
||||
venv: $(VENV)/bin/activate
|
||||
.PHONY: venv
|
||||
|
||||
|
||||
# Remove the venv
|
||||
clean:
|
||||
@ rm -rf '$(VENV)'
|
||||
|
||||
|
||||
# Run the Flask server
|
||||
# TODO
|
||||
run: venv
|
||||
|
||||
|
||||
# Format the codebase using black
|
||||
format: venv
|
||||
@ '$(VENV)/bin/python' -m black src
|
||||
|
||||
# Lint the codebase using flake8
|
||||
lint: venv
|
||||
@ '$(VENV)/bin/python' -m flake8 src
|
||||
|
||||
# Run rests using pytest
|
||||
# TODO
|
||||
test: venv
|
||||
Reference in a new issue