forked from calkit/calkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (66 loc) · 2.66 KB
/
Copy pathMakefile
File metadata and controls
81 lines (66 loc) · 2.66 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
.PHONY: help
help: ## Show this help.
@uv run python -c "import re; \
[[print(f'\033[36m{m[0]:<20}\033[0m {m[1]}') for m in re.findall(r'^([a-zA-Z_-]+):.*?## (.*)$$', open(makefile).read(), re.M)] for makefile in ('$(MAKEFILE_LIST)').strip().split()]"
.PHONY: install
install: ## Create the project's virtual environment.
@echo "🚀 Creating virtual environment"
@uv sync
.PHONY: dev
dev: ## Start up the hub containers for development.
@$(MAKE) -C hub dev
.PHONY: frontend-client
frontend-client: ## Regenerate the hub frontend's API client.
@$(MAKE) -C hub/frontend client
.PHONY: format
format: sync-docs ## Automatically format files.
@echo "🚀 Linting code with pre-commit"
@uv run pre-commit run -a
.PHONY: check
check: format ## Run code quality tools.
@echo "🚀 Checking lock file consistency with 'pyproject.toml'"
@uv lock --locked
@echo "🚀 Static type checking with mypy"
@uv run --all-packages mypy
@echo "🚀 Checking for obsolete dependencies with deptry"
@uv run deptry .
.PHONY: test
test: ## Test the code with pytest.
@echo "🚀 Testing code with pytest"
@uv run pytest
.PHONY: test-cov
test-cov: ## Test the code coverage with pytest.
@echo "🚀 Testing code coverage with pytest"
@uv run pytest --cov --cov-config=pyproject.toml
.PHONY: test-docs
test-docs: sync-docs ## Test if documentation can be built without warnings or errors.
@uv run mkdocs build -s
.PHONY: sync-docs
sync-docs: ## Sync documentation content from docs/*.md into README.md.
@echo "🚀 Generating docs references"
@uv run python scripts/generate-docs-references.py
@echo "🚀 Syncing documentation"
@uv run python scripts/sync-docs.py
.PHONY: docs
docs: sync-docs ## Build and serve the documentation.
@uv run mkdocs serve --livereload
.PHONY: import-profile
import-profile: ## Profile the import time of the CLI.
uv run python -X importtime -m calkit --help 2> import.log && uvx tuna import.log
.PHONY: jlab-dev
jlab-dev: ## Develop the JupyterLab extension.
cd jupyterlab-ext && uv run jlpm run watch
.PHONY: jlab
jlab: ## Build the JupyterLab extension.
cd jupyterlab-ext && uv run jlpm run build:prod
.PHONY: test-jlab
test-jlab: ## Run JupyterLab extension unit tests with Jest.
@echo "🚀 Running JupyterLab extension unit tests"
@cd jupyterlab-ext && uv run jlpm test
.PHONY: test-jlab-ui
test-jlab-ui: ## Run the JupyterLab UI integration tests.
@echo "🚀 Running JupyterLab UI tests with Playwright"
@cd jupyterlab-ext && uv run jlpm run build:prod
@uv run --directory=jupyterlab-ext/ui-tests jlpm install
@uv run --directory=jupyterlab-ext/ui-tests jlpm playwright install
@uv run --directory=jupyterlab-ext/ui-tests jlpm playwright test -u --reporter=list