-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (57 loc) · 1.87 KB
/
Copy pathMakefile
File metadata and controls
76 lines (57 loc) · 1.87 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
.PHONY: setup sync clean test lint lint-fix format format-check hooks update-lock local-dev first-time-setup dev-setup sync-all first-time-local-setup
# Environment variable for local SDK path (optional)
SOCKET_SDK_PATH ?= ../socketdev
# Environment variable to control local development mode
USE_LOCAL_SDK ?= false
# === High-level workflow targets ===
# First-time repo setup after cloning (using PyPI packages)
first-time-setup: clean setup
# First-time setup for local development (using local SDK)
first-time-local-setup:
$(MAKE) clean
$(MAKE) USE_LOCAL_SDK=true dev-setup
# Update lock file after changing pyproject.toml
update-lock:
uv lock
# Setup for local development
dev-setup: clean local-dev setup
# Sync all dependencies after pulling changes
sync-all: sync
# === Implementation targets ===
# Installs dependencies needed for local development
# Currently: socketdev from test PyPI or local path
local-dev:
ifeq ($(USE_LOCAL_SDK),true)
uv add --editable $(SOCKET_SDK_PATH)
endif
# Creates virtual environment and installs dependencies from uv.lock
setup: update-lock
uv sync --all-extras
ifeq ($(USE_LOCAL_SDK),true)
uv add --editable $(SOCKET_SDK_PATH)
endif
# Installs exact versions from uv.lock into your virtual environment
sync:
uv sync --all-extras
ifeq ($(USE_LOCAL_SDK),true)
uv add --editable $(SOCKET_SDK_PATH)
endif
# Removes virtual environment and cache files
clean:
rm -rf .venv
find . -type d -name "__pycache__" -exec rm -rf {} +
test:
uv run pytest
# Installs the git pre-commit hooks (ruff + version sync).
hooks:
uv run --extra dev pre-commit install
# Exactly what the Lint workflow runs, so a green `make lint` means a green CI.
lint:
uv run --extra dev ruff check
uv run --extra dev ruff format --check
lint-fix:
uv run --extra dev ruff check --fix
format:
uv run --extra dev ruff format
format-check:
uv run --extra dev ruff format --check