-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (52 loc) · 1.61 KB
/
Makefile
File metadata and controls
66 lines (52 loc) · 1.61 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
# globals
VERSION := $(shell uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version)
GH := $(shell command -v gh 2> /dev/null)
define PRINT_HELP_PYSCRIPT
import re, sys
print("Please use 'make <target>' where <target> is one of\n")
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
print("\nCheck the Makefile for more information")
endef
export PRINT_HELP_PYSCRIPT
define check_gh
@if [ -z $(GH) ]; then echo "gh could not be found. See https://cli.github.com/"; exit 2; fi
endef
.PHONY: help
.DEFAULT_GOAL := help
help:
@python3 -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
install-uv:
@echo "Installing uv package manager..."
curl -LsSf https://astral.sh/uv/install.sh | sh
requirements: ## install dependencies
@echo "Installing project dependencies..."
uv sync --all-extras --dev
apply-style:
@echo "Applying style..."
uv run ruff check --select I --fix --unsafe-fixes
uv run ruff format
style-check:
@echo "Running checks..."
uv run ruff check --fix
type-check:
@echo "Running type checks..."
uv run mypy cubejs
checks: style-check type-check ## run all code checks
test:
@echo "Running tests..."
uv run pytest tests/
.PHONY: version
version: ## package version
@echo '${VERSION}'
.PHONY: release-github
release-github: ## release to github
$(call check_gh)
@echo "Releasing version $$(make version) to github..."
@$(GH) release create v$$(make version) --notes "Release v$$(make version)"
.PHONY: release
release: release-github
@echo "🏷 Release $$(make version) complete!"