summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authoryctct <yctct@yctct.com>2026-11-25 17:56:21 +0100
committeryctct <yctct@yctct.com>2026-11-25 17:56:21 +0100
commit489b223db74f468032c1eeb6ca18ee6a4da3bc33 (patch)
treea360664813443859ebfc0dcce79dec7fddf93c9f /Makefile
Add files, first commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile44
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