-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
50 lines (39 loc) · 1014 Bytes
/
Makefile
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
VENV = .venv
ifeq ($(OS), Windows_NT)
BIN=$(VENV)/Scripts
else
BIN=$(VENV)/bin
endif
.PHONY: help
help:
@echo 'Usage: make <subcommand>'
@echo ''
@echo 'Subcommands:'
@echo ' install Install locally'
@echo ' run-postgres Run postgres locally for tests'
@echo ' rm-postgres Remove local postgres instance that is created for tests'
@echo ' test Run tests locally'
@echo ' lint Run linter locally'
@echo ' mypy Run mypy locally'
.PHONY: run-postgres
run-postgres:
docker run --name postgres-tq-container -e POSTGRES_PASSWORD=password -p 15432:5432 -d postgres
.PHONY: rm-postgres
rm-postgres:
docker kill postgres-tq-container
docker rm postgres-tq-container
.PHONY: install
install:
pdm install
.PHONY: test
test:
pdm install --dev
python -m pytest
.PHONY: lint
lint:
pdm install --dev
python -m flake8 postgrestq
.PHONY: mypy
mypy:
pdm install --dev
python -m mypy --strict --explicit-package-bases postgrestq