34 lines
839 B
Makefile
34 lines
839 B
Makefile
|
|
VENV ?= .venv
|
||
|
|
PYTHON ?= $(VENV)/bin/python
|
||
|
|
PIP ?= $(PYTHON) -m pip
|
||
|
|
PYTEST ?= $(PYTHON) -m pytest
|
||
|
|
RUFF ?= $(VENV)/bin/ruff
|
||
|
|
|
||
|
|
.PHONY: help install-dev test lint run
|
||
|
|
|
||
|
|
help:
|
||
|
|
@echo "make install-dev Create .venv and install runtime + dev dependencies"
|
||
|
|
@echo "make test Run the test suite"
|
||
|
|
@echo "make lint Run syntax and static checks"
|
||
|
|
@echo "make run Start the local API on 127.0.0.1:8090"
|
||
|
|
|
||
|
|
$(VENV)/bin/python:
|
||
|
|
python3 -m venv $(VENV)
|
||
|
|
|
||
|
|
$(VENV)/.dev-installed: pyproject.toml $(VENV)/bin/python
|
||
|
|
$(PIP) install --upgrade pip
|
||
|
|
$(PIP) install -e ".[dev]"
|
||
|
|
@touch $(VENV)/.dev-installed
|
||
|
|
|
||
|
|
install-dev: $(VENV)/.dev-installed
|
||
|
|
|
||
|
|
test: $(VENV)/.dev-installed
|
||
|
|
$(PYTEST)
|
||
|
|
|
||
|
|
lint: $(VENV)/.dev-installed
|
||
|
|
$(PYTHON) -m compileall src tests
|
||
|
|
$(RUFF) check src tests
|
||
|
|
|
||
|
|
run: $(VENV)/.dev-installed
|
||
|
|
$(PYTHON) -m tenant_engine.main
|