-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (39 loc) · 906 Bytes
/
Makefile
File metadata and controls
50 lines (39 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Variables
PYTHON = python3.12
VENV = .venv
PIP = $(VENV)/bin/pip
PYTHON_BIN = $(VENV)/bin/python
ISORT = $(VENV)/bin/isort
BLACK = $(VENV)/bin/black
MYPY = $(VENV)/bin/mypy
PYTEST = $(VENV)/bin/pytest
# Directories
SRC_DIR = genserver
TESTS_DIR = tests
# Default target
all: install lint test
# Create virtual environment
$(VENV):
$(PYTHON) -m venv $(VENV)
# Install dependencies
install: $(VENV)
$(PIP) install -r requirements-dev.txt
$(PIP) install -e .
# Linting with isort
lint-isort:
$(ISORT) $(SRC_DIR) $(TESTS_DIR)
# Formatting with black
format-black:
$(BLACK) $(SRC_DIR) $(TESTS_DIR)
# Type checking with mypy
type-check:
$(MYPY) $(SRC_DIR)
# Run tests with pytest
test:
$(PYTEST)
# Combined linting, formatting, and type checking
lint: lint-isort format-black type-check
# Clean up
clean:
rm -rf $(VENV)
.PHONY: all install lint lint-isort format-black type-check test clean