-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
112 lines (91 loc) · 3.44 KB
/
Copy pathMakefile
File metadata and controls
112 lines (91 loc) · 3.44 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Makefile for vql — Visual Query Language monorepo
# Core: src/vql/ | Control layer: packages/*2vql/
PYTHON ?= .venv/bin/python
PIP ?= .venv/bin/pip
PORT ?= 8216
PACKAGES := uri2vql nlp2vql img2vql img2svg uri2img2svg dsl2img2svg dsl2vql cli2vql rest2vql mcp2vql
PYTEST := $(PYTHON) -m pytest tests/ packages/dsl2vql/tests -q --tb=short
.PHONY: help venv install install-dev proto test test-cov test-all \
validate-schema serve compile clean build publish publish-confirm version goal
help:
@echo "VQL Development Commands"
@echo "========================"
@echo ""
@echo "Setup:"
@echo " venv Create .venv (if missing)"
@echo " install Install core vql (editable)"
@echo " install-dev Install full *2vql dev stack"
@echo ""
@echo "Development:"
@echo " test Run core + dsl2vql tests"
@echo " test-cov Run tests with coverage"
@echo " test-all Run all package tests"
@echo " proto Regenerate dsl2vql protobuf"
@echo " validate-schema Check dsl2vql JSON Schema registry"
@echo " compile Smoke: COMPILE NL → VQLProgram"
@echo " serve Start rest2vql on port $(PORT)"
@echo " clean Remove build artifacts and caches"
@echo ""
@echo "Release:"
@echo " build Build wheel/sdist"
@echo " publish Build + twine check (dry-run)"
@echo " publish-confirm Upload to PyPI"
@echo " version Show VERSION file + installed package"
@echo " goal Run goal -a (test + commit + publish workflow)"
@echo ""
venv:
@test -d .venv || python3 -m venv .venv
@echo "venv ready: .venv/"
install: venv
$(PIP) install -e .
install-dev: venv
$(PIP) install -e .
$(PIP) install -e packages/uri2vql
$(PIP) install -e packages/nlp2vql
$(PIP) install -e packages/dsl2vql
$(PIP) install -e packages/cli2vql
$(PIP) install -e packages/rest2vql
-$(PIP) install -e packages/mcp2vql
$(PIP) install -e ".[dev,png]" jsonschema protobuf fastapi uvicorn httpx
@echo "dev stack installed"
proto: venv
$(PIP) install -q grpcio-tools
bash packages/dsl2vql/scripts/generate-proto.sh
test: venv install-dev
@echo "Running tests..."
$(PYTEST)
test-cov: venv install-dev
$(PYTHON) -m pytest tests/ packages/dsl2vql/tests -v \
--cov=vql --cov=dsl2vql --cov-report=term-missing
test-all: venv install-dev
$(PYTHON) -m pytest tests/ packages/ -q --tb=short
test-roundtrip: venv install-dev
$(PYTHON) -m pytest tests/test_photo_roundtrip.py -q --tb=short
$(PYTHON) examples/photo-roundtrip-test.py --out /tmp/vql-roundtrip
validate-schema: venv install-dev
dsl2vql validate-schema
compile: venv install-dev
dsl2vql -c 'COMPILE "narysuj czerwone koło"' --json
serve: venv install-dev
rest2vql serve --port $(PORT) --host 127.0.0.1
clean:
find . -type f -name '*.pyc' -delete
find . -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null || true
find . -type d -name '*.egg-info' -exec rm -rf {} + 2>/dev/null || true
rm -rf build/ dist/ .coverage htmlcov/ .pytest_cache .goal_test_report.xml
@echo "clean done"
build: venv
$(PIP) install -q build
rm -rf dist/ build/
$(PYTHON) -m build
publish: build
$(PIP) install -q twine
$(PYTHON) -m twine check dist/*
publish-confirm: publish
$(PYTHON) -m twine upload dist/*
version:
@echo -n "VERSION file: "
@cat VERSION
@$(PYTHON) -c "from importlib.metadata import version; print('installed:', version('vql'))" 2>/dev/null || echo "installed: (not installed)"
goal:
goal -a