Added Makefile & first requirements (#2)

master^2
Jef Roosens 2021-04-02 13:49:40 +02:00
parent ea713afd65
commit c32c9035d8
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
3 changed files with 54 additions and 0 deletions

41
Makefile 100644
View 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

View File

@ -0,0 +1,11 @@
# Formatter
black~=20.8b1
# Linter
flake8~=3.9.0
# Testing suite
pytest~=6.2.2
# Language server
jedi~=0.18.0

2
requirements.txt 100644
View File

@ -0,0 +1,2 @@
# Web framework
Flask~=1.1.2