-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.dev
More file actions
80 lines (59 loc) · 2.16 KB
/
Makefile.dev
File metadata and controls
80 lines (59 loc) · 2.16 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Developer tooling, testing, and CI helpers
.PHONY: install dev-venv ci test-pg-batch unittest utest utest-duckdb fmt lint fix type pre-commit act-commit
UV ?= uv
install:
$(UV) pip install --upgrade pip
$(UV) pip install --editable .
# Optional: local virtual environment bootstrap
dev-venv:
$(UV) venv .venv
$(UV) pip install --python .venv/bin/python --upgrade pip
$(UV) pip install --python .venv/bin/python --editable .
test-pg-batch:
FFT_SQL_DEBUG=1 $(UV) run pytest -q tests/test_smoke_postgres.py::test_pg_batch_tests_green
unittest:
FFT_SQL_DEBUG=1 $(UV) run pytest -q tests
cover:
FFT_SQL_DEBUG=1 $(UV) run pytest -q tests --cov=fastflowtransform --cov-report=term-missing --cov-report=html
utest:
fft utest "$(FF_PROJECT)" --env "$(FF_ENV)"
utest-duckdb:
fft utest "$(FF_PROJECT)" --env "$(FF_ENV)" --model users_enriched
# Lint & format helpers
fmt:
$(UV) run ruff format
lint:
$(UV) run ruff check src tests --no-cache
fix:
$(UV) run ruff check src tests --fix
$(UV) run ruff format src tests
type:
$(UV) run mypy --config-file=pyproject.toml
pre-commit-install:
(UV) run pre-commit install
pre-commit:
$(UV) run pre-commit run --all-files
act-commit:
act pull_request \
-W .github/workflows/CI.yml -j checks \
--bind --container-architecture linux/arm64 \
-P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-22.04 \
--env UV_PROJECT_ENVIRONMENT=/tmp/uv-venv \
--env VIRTUAL_ENV=
concat-docs:
$(UV) run python _scripts/concat_docs.py -o _exports/Combined_Docs.md --exclude "examples/**"
export-demo:
$(UV) python _scripts/export_subdir_md.py examples/incremental_demo -o _exports/incremental_demo_export.md --exclude-ext html css
show-structure:
tree -a -I '.git|.venv|__pycache__|.pytest_cache|.mypy_cache|.ruff_cache|node_modules|dist|build|htmlcov|site|.fastflowtransform|.DS_Store|.idea|.vscode|.local|metastore_db|.uv-cache|_exports|_scripts|articles|examples_article|tickets'
spinup-pg:
docker rm -f ff_pg
docker volume rm pgdata
docker volume create pgdata
docker run -d --name ff_pg \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=ffdb \
-p 5432:5432 \
-v pgdata:/var/lib/postgresql/data \
postgres:17