Makefile 741 Bytes
Newer Older
chenych's avatar
chenych committed
1
.PHONY: build commit license quality style test
Rayyyyy's avatar
V0.6.3  
Rayyyyy committed
2

shihm's avatar
uodata  
shihm committed
3
4
5
6
7
check_dirs := scripts src tests tests_v1

RUN := $(shell command -v uv >/dev/null 2>&1 && echo "uv run" || echo "")
BUILD := $(shell command -v uv >/dev/null 2>&1 && echo "uv build" || echo "python -m build")
TOOL := $(shell command -v uv >/dev/null 2>&1 && echo "uvx" || echo "")
Rayyyyy's avatar
V0.6.3  
Rayyyyy committed
8

luopl's avatar
luopl committed
9
build:
shihm's avatar
uodata  
shihm committed
10
	$(BUILD)
luopl's avatar
luopl committed
11
12

commit:
shihm's avatar
uodata  
shihm committed
13
14
	$(TOOL) pre-commit install
	$(TOOL) pre-commit run --all-files
luopl's avatar
luopl committed
15

chenych's avatar
chenych committed
16
license:
shihm's avatar
uodata  
shihm committed
17
	$(RUN) python3 tests/check_license.py $(check_dirs)
chenych's avatar
chenych committed
18

Rayyyyy's avatar
V0.6.3  
Rayyyyy committed
19
quality:
shihm's avatar
uodata  
shihm committed
20
21
	$(TOOL) ruff check $(check_dirs)
	$(TOOL) ruff format --check $(check_dirs)
Rayyyyy's avatar
V0.6.3  
Rayyyyy committed
22
23

style:
shihm's avatar
uodata  
shihm committed
24
25
	$(TOOL) ruff check $(check_dirs) --fix
	$(TOOL) ruff format $(check_dirs)
chenych's avatar
chenych committed
26
27

test:
shihm's avatar
uodata  
shihm committed
28
	WANDB_DISABLED=true $(RUN) pytest -vv --import-mode=importlib tests/ tests_v1/