This commit is contained in:
hiyouga
2025-12-27 08:46:17 +08:00
parent 5eea54f888
commit 6cdbfa980e
5 changed files with 21 additions and 24 deletions

View File

@@ -4,24 +4,25 @@ 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 "")
build:
$(BUILD)
commit:
$(RUN) pre-commit install
$(RUN) pre-commit run --all-files
$(TOOL) pre-commit install
$(TOOL) pre-commit run --all-files
license:
$(RUN) python3 tests/check_license.py $(check_dirs)
quality:
$(RUN) ruff check $(check_dirs)
$(RUN) ruff format --check $(check_dirs)
$(TOOL) ruff check $(check_dirs)
$(TOOL) ruff format --check $(check_dirs)
style:
$(RUN) ruff check $(check_dirs) --fix
$(RUN) ruff format $(check_dirs)
$(TOOL) ruff check $(check_dirs) --fix
$(TOOL) ruff format $(check_dirs)
test:
WANDB_DISABLED=true $(RUN) pytest -vv --import-mode=importlib tests/ tests_v1/