-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (61 loc) · 2.46 KB
/
Makefile
File metadata and controls
68 lines (61 loc) · 2.46 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
.PHONY: setup prebuild test lint format clean help
# Default target
help:
@echo "Available targets:"
@echo " setup - Complete setup (install dependencies and run prebuild)"
@echo " prebuild - Run prebuild for all packages"
@echo " test - Run all tests"
@echo " lint - Run linting checks"
@echo " format - Format code with black"
@echo " clean - Clean generated files"
# Complete setup process
setup:
@echo "Setting up Cypherock SDK..."
@echo "1. Installing dependencies..."
poetry install
@echo "2. Running prebuild..."
$(MAKE) prebuild
@echo "Setup complete!"
# Run prebuild for all packages
prebuild:
@echo "Running prebuild for all packages..."
@echo "Core package..."
poetry run packages/core/scripts/prebuild.sh
@echo "App Manager package..."
poetry run packages/app_manager/scripts/prebuild.sh
@echo "BTC App package..."
poetry run packages/app_btc/scripts/prebuild.sh
@echo "Prebuild complete!"
# Run all tests (runs each package individually)
test: prebuild
@echo "Running all tests..."
@echo "Running core package tests..."
poetry run pytest packages/core/tests/ -v
@echo "Running app_manager package tests..."
poetry run pytest packages/app_manager/tests/ -v
@echo "Running app_btc package tests..."
poetry run pytest packages/app_btc/tests/ -v
@echo "Running util package tests..."
poetry run pytest packages/util/tests/ -v
# Run linting
lint:
@echo "Running linting checks..."
poetry run ruff check .
# Format code
format:
@echo "Formatting code..."
poetry run black .
# Clean generated files
clean:
@echo "Cleaning generated files..."
@echo "Cleaning Python cache files..."
find . -name "*.pyc" -not -path "./.git/*" -not -path "./*/.git/*" -not -path "./submodules/*" -delete
find . -name "__pycache__" -type d -not -path "./.git/*" -not -path "./*/.git/*" -not -path "./submodules/*" -exec rm -rf {} +
@echo "Cleaning build artifacts..."
find . -name "*.egg-info" -type d -not -path "./.git/*" -not -path "./*/.git/*" -not -path "./submodules/*" -exec rm -rf {} +
find . -name "dist" -type d -not -path "./.git/*" -not -path "./*/.git/*" -not -path "./submodules/*" -exec rm -rf {} +
find . -name "build" -type d -not -path "./.git/*" -not -path "./*/.git/*" -not -path "./submodules/*" -exec rm -rf {} +
@echo "Cleaning generated proto files..."
find packages -path "*/src/*/proto/generated" -type d -exec rm -rf {} +
find packages -path "*/src/*/encoders/proto/generated" -type d -exec rm -rf {} +
@echo "Clean complete!"