mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-12-27 17:20:35 +08:00
[misc] fix ci with uv (#9676)
This commit is contained in:
22
Makefile
22
Makefile
@@ -2,23 +2,27 @@
|
||||
|
||||
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:
|
||||
uv build
|
||||
$(BUILD)
|
||||
|
||||
commit:
|
||||
uv run pre-commit install
|
||||
uv run pre-commit run --all-files
|
||||
$(TOOL) pre-commit install
|
||||
$(TOOL) 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)
|
||||
$(TOOL) ruff check $(check_dirs)
|
||||
$(TOOL) ruff format --check $(check_dirs)
|
||||
|
||||
style:
|
||||
uv run ruff check $(check_dirs) --fix
|
||||
uv run ruff format $(check_dirs)
|
||||
$(TOOL) ruff check $(check_dirs) --fix
|
||||
$(TOOL) 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/
|
||||
|
||||
Reference in New Issue
Block a user