From c32c9035d81b47447ada4aa92edccc556a024b70 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Fri, 2 Apr 2021 13:49:40 +0200 Subject: [PATCH] Added Makefile & first requirements (#2) --- Makefile | 41 +++++++++++++++++++++++++++++++++++++++++ requirements-dev.txt | 11 +++++++++++ requirements.txt | 2 ++ 3 files changed, 54 insertions(+) create mode 100644 Makefile create mode 100644 requirements-dev.txt create mode 100644 requirements.txt diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..da1e6ec --- /dev/null +++ b/Makefile @@ -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 diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..d4647f1 --- /dev/null +++ b/requirements-dev.txt @@ -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 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..dc4b804 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +# Web framework +Flask~=1.1.2