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