This commit is contained in:
hiyouga
2025-12-27 07:35:18 +08:00
parent a1b1931b4a
commit 66e6aa8f37
18 changed files with 66 additions and 72 deletions

View File

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