diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1c42ac7 --- /dev/null +++ b/Makefile @@ -0,0 +1,44 @@ +.PHONY: install run debug clean lint lint-strict + +MAIN = src/main.py +VENV_DIR = .venv +PYTHON = python3 +VENV_PYTHON = $(VENV_DIR)/bin/python3 +VENV_PIP = $(VENV_DIR)/bin/pip + +install: env + $(VENV_PYTHON) -m pip install -r requirements.txt + +env: + $(PYTHON) -m venv $(VENV_DIR) + +run: + @if [ ! -d "$(VENV_DIR)" ]; then \ + echo "Error: Virtual environment not found. Run 'make install' first." >&2; \ + exit 1; \ + fi + $(VENV_PYTHON) $(MAIN) $(MAP) + +debug: + $(PYTHON) -m pdb $(MAIN) $(MAP) + +clean: + rm -fr $(VENV_DIR) + rm -fr .mypy_cache + rm -fr __pycache__ + +lint: + flake8 . + mypy . \ + --warn-return-any \ + --warn-unused-ignores \ + --ignore-missing-imports \ + --disallow-untyped-defs \ + --check-untyped-defs + +lint-strict: + flake8 . + mypy . --strict + +tags: + ctags src/*py |
