File size: 724 Bytes
caf6ee7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95dc457
caf6ee7
 
 
95dc457
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
.PHONY: format lint typecheck test check

format:
	ruff format .

lint:
	ruff check . --fix

typecheck:
	mypy .

test:
	pytest

clean:
	@echo "Cleaning project..."
	# Delete compiled bytecode
	@python3 -Bc "import pathlib; [p.unlink() for p in pathlib.Path('.').rglob('*.py[co]')]"
	# Delete directory-based caches
	@python3 -Bc "import shutil, pathlib; \
		[shutil.rmtree(p) for p in pathlib.Path('.').rglob('__pycache__')]; \
		[shutil.rmtree(p) for p in pathlib.Path('.').rglob('.ipynb_checkpoints')]; \
		[shutil.rmtree(p) for p in pathlib.Path('.').rglob('.monai-cache')];"

# Updated 'check' to clean before running (optional)
# This ensures you are testing from a "blank slate"
check: format lint typecheck test clean