Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (77 loc) · 2.42 KB
/
Copy pathMakefile
File metadata and controls
95 lines (77 loc) · 2.42 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# pyo3's build script runs with cwd inside the cargo registry, where the mise
# shims resolve python from the global config rather than this project's pin.
# hand it the pinned interpreter directly so it cannot pick up a python newer
# than pyo3 supports. left empty when mise is absent, so cargo falls back to
# its own interpreter discovery.
PYO3_PYTHON := $(shell mise which python 2>/dev/null)
ifneq ($(PYO3_PYTHON),)
export PYO3_PYTHON
endif
# the venv holding the python user nodes' packages. mise activates it already;
# exported here as well so a make-driven run or test finds it from a shell where
# mise is not active. a path that does not exist is ignored at runtime.
VENV := $(if $(VIRTUAL_ENV),$(VIRTUAL_ENV),$(CURDIR)/.venv)
export VIRTUAL_ENV := $(VENV)
build: build-ui build-api
.PHONY: build
precommit: update-gitignore lint test
.PHONY: precommit
test: test-api-e2e test-ui-e2e test-cli-e2e test-e2e test-release
.PHONY: test
test-release:
python3 tests/test_release_version.py
.PHONY: test-release
test-e2e: build-api
./tests/run_workflow_e2e.sh
.PHONY: test-e2e
test-api-e2e:
./tests/run_e2e.sh
.PHONY: test-api-e2e
test-cli-e2e:
./tests/run_cli_tests.sh
.PHONY: test-cli-e2e
test-ui-e2e: build-ui
./tests/run_ui_e2e.sh
.PHONY: test-ui-e2e
build-api:
cargo build --workspace
.PHONY: build-api
build-ui:
cd ui && npm run build
.PHONY: build-ui
deps: deps-python
cd ui && npm ci
cd ui && npx playwright install chromium
cargo fetch --locked
.PHONY: deps
# the packages the shipped python user nodes import. mise creates and activates
# .venv (see .mise.toml); without mise, uv creates it here. skipped when uv is
# absent -- the nodes that need no package still work, and the ones that do say
# what is missing when they run.
deps-python:
@if ! command -v uv >/dev/null 2>&1; then \
echo "SKIP: uv not found, python node packages not installed"; \
echo " see requirements-nodes.txt"; \
else \
uv venv --allow-existing "$(VENV)" $(if $(PYO3_PYTHON),--python "$(PYO3_PYTHON)",); \
uv pip install --python "$(VENV)/bin/python" -r requirements-nodes.txt; \
fi
.PHONY: deps-python
start: build-ui
cargo run --bin flow-server
.PHONY: start
lint:
cd ui && npm run lint
cargo clippy
.PHONY: lint
update-gitignore:
./scripts/update-gitignore-assets.sh
.PHONY: update-gitignore
bundle:
./scripts/bundle-release.sh $(BUNDLE_ARGS)
.PHONY: bundle
format:
cd ui && npm run format
cargo fmt
black user_nodes/
.PHONY: format