-
-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (50 loc) · 1.73 KB
/
Makefile
File metadata and controls
66 lines (50 loc) · 1.73 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
src_dir = aerich
checkfiles = $(src_dir) tests/ conftest.py
py_warn = PYTHONDEVMODE=1
pytest_opts = --cov=$(src_dir) --cov-append --tb=native -q
MYSQL_HOST ?= "127.0.0.1"
MYSQL_PORT ?= 3306
MYSQL_PASS ?= "123456"
POSTGRES_HOST ?= "127.0.0.1"
POSTGRES_PORT ?= 5432
POSTGRES_PASS ?= 123456
up:
@uv lock --upgrade
deps:
@uv sync --all-extras --all-groups --no-extra asyncmy --no-group=vector $(options)
_style:
@ruff format $(checkfiles)
@ruff check --fix $(checkfiles)
style: deps _style
_codeqc:
mypy $(checkfiles)
bandit -c pyproject.toml -r $(checkfiles)
twine check dist/*
codeqc: build _codeqc
_check: _build
@ruff format --check $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
@ruff check $(checkfiles)
$(MAKE) _codeqc
check: deps _check
_lint: _build _style _codeqc
lint: deps _lint
test: deps
$(py_warn) pytest $(pytest_opts)
test_sqlite:
$(py_warn) TEST_DB=sqlite://:memory: pytest $(pytest_opts)
test_mysql:
$(py_warn) TEST_DB="mysql://root:$(MYSQL_PASS)@$(MYSQL_HOST):$(MYSQL_PORT)/test_\{\}" pytest -vv -s $(pytest_opts)
test_postgres:
$(py_warn) TEST_DB="postgres://postgres:$(POSTGRES_PASS)@$(POSTGRES_HOST):$(POSTGRES_PORT)/test_\{\}" pytest -vv -s $(pytest_opts)
test_postgres_vector:
$(py_warn) AERICH_TEST_VECTOR=1 TEST_DB="postgres://postgres:$(POSTGRES_PASS)@$(POSTGRES_HOST):$(POSTGRES_PORT)/test_\{\}" pytest -vv -s tests/test_inspectdb.py::test_inspect_vector $(pytest_opts)
test_psycopg:
$(py_warn) TEST_DB="psycopg://postgres:$(POSTGRES_PASS)@$(POSTGRES_HOST):$(POSTGRES_PORT)/test_\{\}" pytest -vv -s $(pytest_opts)
_testall: test_sqlite test_postgres test_mysql
testall: deps _testall
report:
coverage report -m
_build:
uv build
build: deps _build
ci: build _check _testall