-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
143 lines (121 loc) · 5.01 KB
/
Copy pathMakefile
File metadata and controls
143 lines (121 loc) · 5.01 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
.PHONY: test examples docs-links quality quality-strict quality-intract quality-redup cinema cinema-open cinema-test cinema-stop cinema-restart cinema-repair ci-cinema-smoke
CINEMA_MODEL ?=
CINEMA_CAPSULE ?= scientific_calc
CINEMA_PATH ?= examples/web_app_calculator/workspace
CINEMA_GOAL ?= wdrożenie kalkulatora naukowego na bazie aktualnego
CINEMA_MODEL_ARG = $(if $(strip $(CINEMA_MODEL)),LLM_MODEL="$(CINEMA_MODEL)",)
test:
pytest -q
examples:
python examples/run_examples.py
docs-links:
python scripts/check-doc-links.py .
quality-intract:
intract check src --format text
intract coverage src
quality-redup:
redup scan src --format toon --min-lines 8
quality: test docs-links quality-intract quality-redup
ruff check \
src/nexu/cinema.py \
src/nexu/cinema_server.py \
src/nexu/cinema_baseline_contracts.py \
src/nexu/cinema_goal_contracts.py \
src/nexu/cinema_html.py \
src/nexu/cinema_html_validate.py \
src/nexu/cinema_llm_contracts.py \
src/nexu/cinema_markpact.py \
src/nexu/cinema_dom_patch.py \
src/nexu/cinema_project_imports.py \
src/nexu/cinema_projects.py \
src/nexu/cinema_scripts.py \
src/nexu/cinema_publish.py \
src/nexu/cinema_offline_options.py \
src/nexu/cinema_options_cache.py \
src/nexu/fast_delivery/__init__.py \
src/nexu/fast_delivery/context.py \
src/nexu/fast_delivery/options.py \
src/nexu/fast_delivery/router.py \
src/nexu/intract.py \
src/nexu/verify.py \
src/nexu/intract_adapter.py \
tests/test_cinema_server.py \
tests/test_cinema_baseline_contracts.py \
tests/test_cinema_goal_contracts.py \
tests/test_cinema_markpact.py \
tests/test_cinema_dom_patch.py \
tests/test_cinema_project_ir.py \
tests/test_cinema_project_imports.py \
tests/test_cinema_projects.py \
tests/test_cinema_scripts.py \
tests/test_cinema_publish.py \
tests/test_cinema_offline_options.py \
tests/test_cinema_options_cache.py \
tests/test_cinema_ui_patch.py \
tests/test_fast_delivery.py
quality-strict:
pytest -q
ruff check src tests --statistics
intract check . --format text
redup scan src --format toon
cinema:
uv sync --quiet
@$(CINEMA_MODEL_ARG) uv run nexu capsule iterate $(CINEMA_CAPSULE) --steps 1 --goal "$(CINEMA_GOAL)" --cinema --path $(CINEMA_PATH)
cinema-open:
@url="$$( uv sync --quiet; $(CINEMA_MODEL_ARG) uv run nexu capsule iterate $(CINEMA_CAPSULE) --steps 1 --goal "$(CINEMA_GOAL)" --cinema --path $(CINEMA_PATH) 2>&1 | tee /tmp/nexu-cinema-open.log | sed -n 's/.*Live HTTP Server started for Nexu: //p' | tail -1)"; \
if [ -z "$$url" ]; then \
echo "Could not detect Nexu URL. See /tmp/nexu-cinema-open.log"; \
exit 1; \
fi; \
echo "Opening $$url"; \
( xdg-open "$$url" >/dev/null 2>&1 || sensible-browser "$$url" >/dev/null 2>&1 || firefox "$$url" >/dev/null 2>&1 || google-chrome "$$url" >/dev/null 2>&1 || true )
cinema-test: cinema
pytest -q
cinema-stop:
@pkill -f '[/]cinema/server.py' >/dev/null 2>&1 || true
@echo 'Stopped cinema server.py process(es) if any were running.'
cinema-restart:
@$(MAKE) cinema-stop
@$(MAKE) cinema
cinema-repair:
@uv run python -c "from pathlib import Path; from nexu.cinema_scripts import repair_cinema_html_files; d=Path('$(CINEMA_PATH)')/'.nexu/capsules/$(CINEMA_CAPSULE)/cinema'; n=repair_cinema_html_files(d); print(f'Repaired {n} HTML file(s) in {d}')"
ci-cinema-smoke:
@./scripts/ci-cinema-smoke.sh
# =============================================================================
# Release
# =============================================================================
publish-test: build
@echo "🚀 Publishing to TestPyPI..."
@bash -c 'if [ -z "$${TWINE_USERNAME}" ] && [ -z "$${TWINE_PASSWORD}" ] && [ -z "$${PYPI_API_TOKEN}" ]; then \
echo "⚠️ No PyPI credentials found. Set TWINE_USERNAME and TWINE_PASSWORD or PYPI_API_TOKEN"; \
echo " Example: TWINE_USERNAME=__token__ TWINE_PASSWORD=pypi-xxx make publish-test"; \
echo " Skipping publish-test."; \
else \
$(PYTHON) -m venv publish-test-env && \
publish-test-env/bin/pip install twine && \
publish-test-env/bin/python -m twine upload --repository testpypi dist/* && \
rm -rf publish-test-env && \
echo "✓ Published to TestPyPI"; \
fi'
bump-patch:
@echo "🔢 Bumping patch version..."
$(PYTHON) scripts/bump_version.py patch 2>/dev/null || echo "Create scripts/bump_version.py or edit pyproject.toml manually"
bump-minor:
@echo "🔢 Bumping minor version..."
$(PYTHON) scripts/bump_version.py minor 2>/dev/null || echo "Create scripts/bump_version.py or edit pyproject.toml manually"
bump-major:
@echo "🔢 Bumping major version..."
$(PYTHON) scripts/bump_version.py major 2>/dev/null || echo "Create scripts/bump_version.py or edit pyproject.toml manually"
publish: build
@echo "🚀 Publishing to PyPI..."
@echo "🔢 Bumping patch version..."
@$(MAKE) bump-patch
@echo "🔨 Rebuilding package with new version..."
@$(MAKE) build
@echo "📦 Publishing to PyPI..."
@$(PYTHON) -m venv publish-env
@publish-env/bin/pip install twine
@publish-env/bin/python -m twine upload dist/*
@rm -rf publish-env
@echo "✓ Published to PyPI"
r