-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathMakefile
More file actions
100 lines (84 loc) · 3.31 KB
/
Makefile
File metadata and controls
100 lines (84 loc) · 3.31 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
.DEFAULT_GOAL := help
TESTNET_VARIANT ?= conway_fast
.PHONY: install
install: ## Install cardano_node_tests and its dependencies into a virtual environment
./scripts/setup_dev_venv.sh
.PHONY: check-dev-env
check-dev-env: ## Check if development environment is set up correctly
@./scripts/check_dev_env.sh
.PHONY: update-node-bins
update-node-bins: ## Update cardano-node binaries from a given git repository (usage: make update-node-bins repo=/path/to/cardano-node-repo)
@if [ -z "$(repo)" ]; then \
echo "Usage: make update-node-bins repo=/path/to/cardano-node-repo" >&2; \
exit 1; \
fi
@./scripts/update_node_bins.sh "$(repo)"
.PHONY: reinstall-editable
reinstall-editable: ## Reinstall python package in editable mode from a given git repository (usage: make reinstall-editable repo=/path/to/package_root)
@if [ -z "$(repo)" ]; then \
echo "Usage: make reinstall-editable repo=/path/to/package_root" >&2; \
exit 1; \
fi
@./scripts/reinstall_editable.sh "$(repo)"
.PHONY: test-env
test-env: ## Set up test environment (variant: TESTNET_VARIANT=conway_fast)
@./scripts/setup_test_env.sh $(TESTNET_VARIANT:%_fast=%)
# update flake.lock
.PHONY: update-flake-lock
update-flake-lock: ## Update flake.lock
nix flake update --accept-flake-config
.PHONY: update-uv-lock
update-uv-lock: ## Update uv lockfile
@exit_code=0; \
./scripts/uv_update_lock.sh || exit_code=$$?; \
if [ $$exit_code -ne 0 ] && [ $$exit_code -ne 10 ]; then \
echo "uv lockfile update failed. Retrying without cache..." >&2; \
./scripts/uv_update_lock.sh --refresh; \
else \
exit $$exit_code; \
fi
.PHONY: init-lint
init-lint: ## Initialize linters
pre-commit clean
pre-commit gc
find . -path '*/.mypy_cache/*' -delete
pre-commit uninstall
pre-commit install --install-hooks
.PHONY: lint
lint: ## Run linters
pre-commit run -a --show-diff-on-failure --color=always
.PHONY: build-doc
build-doc: ## Build sphinx documentation
mkdir -p src_docs/build
$(MAKE) -C src_docs clean
$(MAKE) -C src_docs html
.PHONY: doc
doc: ## Build and deploy sphinx documentation
./scripts/deploy_doc.sh
# prepare cluster scripts for the given variant
.PHONY: cluster-scripts
cluster-scripts: ## Prepare local testnet cluster scripts (variant: TESTNET_VARIANT=conway_fast)
prepare-cluster-scripts -c -d dev_workdir/$(TESTNET_VARIANT) -t $(TESTNET_VARIANT)
# start the local testnet cluster
.PHONY: start-cluster
start-cluster: ## Start local testnet cluster (variant: TESTNET_VARIANT=conway_fast)
@if [ ! -x "dev_workdir/$(TESTNET_VARIANT)/start-cluster" ]; then \
echo "Error: dev_workdir/$(TESTNET_VARIANT)/start-cluster not found." >&2; \
echo "Run 'make cluster-scripts' first." >&2; \
exit 1; \
fi
./dev_workdir/$(TESTNET_VARIANT)/start-cluster
# stop the local testnet cluster
.PHONY: stop-cluster
stop-cluster: ## Stop local testnet cluster (variant: TESTNET_VARIANT=conway_fast)
@if [ ! -x "dev_workdir/$(TESTNET_VARIANT)/stop-cluster" ]; then \
echo "Error: dev_workdir/$(TESTNET_VARIANT)/stop-cluster not found." >&2; \
echo "Run 'make cluster-scripts' first." >&2; \
exit 1; \
fi
./dev_workdir/$(TESTNET_VARIANT)/stop-cluster
.PHONY: help
help: ## Show this help message
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} \
/^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-22s\033[0m %s\n", $$1, $$2 }' \
$(MAKEFILE_LIST)