forked from opendatahub-io/data-processing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (34 loc) · 1.59 KB
/
Makefile
File metadata and controls
44 lines (34 loc) · 1.59 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
.PHONY: format-python format-notebook format-python-check format-notebooks-check test-notebook-parameters test-notebook-execution test-kfp-components test-notebooks test-all
USE_CASES := $(wildcard notebooks/use-cases/*.ipynb)
TUTORIALS := $(wildcard notebooks/tutorials/*.ipynb)
ALL_NOTEBOOKS := $(USE_CASES) $(TUTORIALS)
COMMON := $(wildcard kubeflow-pipelines/common/*.py)
DOCLING_STANDARD_PIPELINE := $(wildcard kubeflow-pipelines/docling-standard/*.py)
DOCLING_VLM_PIPELINE := $(wildcard kubeflow-pipelines/docling-vlm/*.py)
ALL_PYTHON_FILES := $(COMMON) $(DOCLING_STANDARD_PIPELINE) $(DOCLING_VLM_PIPELINE)
format-python:
@echo "Running ruff format..."
ruff format $(ALL_PYTHON_FILES)
format-notebooks:
@echo "Running nbstripout..."
nbstripout --keep-id $(ALL_NOTEBOOKS)
format-notebooks-check:
nbstripout --keep-id --verify $(ALL_NOTEBOOKS)
@echo "nbstripout check passed :)"
format-python-check:
ruff format --check $(ALL_PYTHON_FILES)
@echo "ruff format check passed :)"
test-notebook-parameters:
@echo "Running notebook parameters validation..."
pytest tests/test_notebook_parameters.py -v
@echo "Notebook parameters test passed :)"
test-notebook-execution:
@echo "Running notebook execution tests..."
pytest tests/test_notebook_execution.py -v
@echo "Notebook execution tests passed :)"
test-notebooks: format-notebooks-check test-notebook-parameters test-notebook-execution
@echo "All notebook validations completed successfully (formatting, parameters, execution) :)"
test-all: test-notebooks format-python-check
@echo "Running all tests..."
pytest tests/ -v
@echo "All tests passed :)"