-
Notifications
You must be signed in to change notification settings - Fork 177
Expand file tree
/
Copy pathMakefile
More file actions
111 lines (93 loc) · 2.94 KB
/
Makefile
File metadata and controls
111 lines (93 loc) · 2.94 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
.PHONY: install
install:
uv sync
uv sync --extra all --extra aifs
.PHONY: install-docker
install-docker:
uv pip install --system --break-system-packages .
uv pip install --system --break-system-packages .[all] --group dev
.PHONY: setup-ci
setup-ci:
uv venv --python=3.13
uv sync
uv run pre-commit install --install-hooks
uv tool install tox --with tox-uv
uv sync --extra all
.PHONY: format
format:
uv run pre-commit run black -a --show-diff-on-failure
.PHONY: black
black:
uv run pre-commit run black -a --show-diff-on-failure
.PHONY: interrogate
interrogate:
uv run pre-commit run interrogate -a
.PHONY: lint
lint:
uv run pre-commit run check-added-large-files -a
uv run pre-commit run trailing-whitespace -a
uv run pre-commit run end-of-file-fixer -a
uv run pre-commit run debug-statements -a
uv run pre-commit run markdownlint -a
uv run pre-commit run name-tests-test -a
uv run pre-commit run pyupgrade -a --show-diff-on-failure
uv run pre-commit run ruff -a
uv run pre-commit run mypy -a
.PHONY: license
license:
uv run python test/_license/header_check.py
.PHONY: pytest
pytest:
@test -n "$(TOX_ENV)" || (echo "TOX_ENV is required! Usage: make pytest TOX_ENV=<env>" && exit 1)
uvx tox -c tox.ini run -e $(TOX_ENV)
.PHONY: pytest-full
pytest-full:
uvx tox -c tox.ini run -- --cov --cov-append --slow --package --testmon-noselect
# Select which pytest target to run in CI based on environment
ifneq (,$(filter 1 true TRUE True yes YES on ON,$(CI_PYTEST_ALL)))
PYTEST_CI_TARGET := pytest-full
else
PYTEST_CI_TARGET := pytest TOX_ENV=$(TOX_ENV)
endif
.PHONY: pytest-ci
pytest-ci:
uv run python test/_ci/check_gpu.py || exit $?
$(MAKE) $(PYTEST_CI_TARGET)
.PHONY: coverage
coverage:
uv run coverage combine || true
uv run coverage report --fail-under=90 || true
.PHONY: docs
docs:
uv sync --group docs
uv run $(MAKE) -C docs clean
uv run $(MAKE) -C docs html
.PHONY: docs-full
docs-full:
uv sync --extra all --group docs
$(MAKE) docs-build-examples
.PHONY: docs-build-examples
docs-build-examples:
rm -rf docs/examples
rm -rf docs/modules/generated
rm -rf docs/modules/backreferences
uv run $(MAKE) -C docs clean
rm -rf examples/outputs
uv run $(MAKE) -C docs html
PLOT_GALLERY=True RUN_STALE_EXAMPLES=True uv run $(MAKE) -j 8 -C docs html
.PHONY: docs-dev
docs-dev:
@echo "Make sure you synced your uv environment with needed extras and --group docs..."
PLOT_GALLERY=True RUN_STALE_EXAMPLES=True FILENAME_PATTERN=$(FILENAME) uv run $(MAKE) -j 4 -C docs html
PORT ?= 8001
.PHONY: serve
docs-serve:
uv run python -m http.server $(PORT) --cgi --directory docs/_build/html
.PHONY: container-service
# Example DOCKER_REPO?=nvcr.io/dycvht5ows21
E2S_RELEASE_TAG?=0.12.0
E2S_IMAGE_NAME=$(DOCKER_REPO)/earth2studio-scicomp
E2S_IMAGE_TAG=v$(E2S_RELEASE_TAG).20260313.1
container-service:
@test -n "$(DOCKER_REPO)" || (echo "DOCKER_REPO is not set!" && exit 1)
DOCKER_BUILDKIT=1 docker build -t $(E2S_IMAGE_NAME):$(E2S_IMAGE_TAG) -f serve/Dockerfile .