@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / e0853b6508
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 16, 07:00 UTC

[Misc] format.sh: Simplify tool_version_check (#10305)

Signed-off-by: Russell Bryant <rbryant@redhat.com>

Russell Bryant committed Nov 13, 2024 at 22:12 UTC e0853b65089b94c9bab9f480970dc73e1e8a0c0d
1 file changed +9 -8
format.sh
+9 -8
@@ -44,18 +44,19 @@ CLANGFORMAT_VERSION=$(clang-format --version | awk '{print $3}')
44
45 # # params: tool name, tool version, required version
46 tool_version_check() {
47 - if [[ "$2" != "$3" ]]; then
48 - echo "❓❓Wrong $1 version installed: $3 is required, not $2."
47 + expected=$(grep "$1" requirements-lint.txt | cut -d'=' -f3)
48 + if [[ "$2" != "$expected" ]]; then
49 + echo "❓❓Wrong $1 version installed: $expected is required, not $2."
50 exit 1
51 fi
52 }
53
53 -tool_version_check "yapf" "$YAPF_VERSION" "$(grep yapf requirements-lint.txt | cut -d'=' -f3)"
54 -tool_version_check "ruff" "$RUFF_VERSION" "$(grep "ruff==" requirements-lint.txt | cut -d'=' -f3)"
55 -tool_version_check "mypy" "$MYPY_VERSION" "$(grep mypy requirements-lint.txt | cut -d'=' -f3)"
56 -tool_version_check "isort" "$ISORT_VERSION" "$(grep isort requirements-lint.txt | cut -d'=' -f3)"
57 -tool_version_check "codespell" "$CODESPELL_VERSION" "$(grep codespell requirements-lint.txt | cut -d'=' -f3)"
58 -tool_version_check "clang-format" "$CLANGFORMAT_VERSION" "$(grep clang-format requirements-lint.txt | cut -d'=' -f3)"
54 +tool_version_check "yapf" "$YAPF_VERSION"
55 +tool_version_check "ruff" "$RUFF_VERSION"
56 +tool_version_check "mypy" "$MYPY_VERSION"
57 +tool_version_check "isort" "$ISORT_VERSION"
58 +tool_version_check "codespell" "$CODESPELL_VERSION"
59 +tool_version_check "clang-format" "$CLANGFORMAT_VERSION"
60
61 YAPF_FLAGS=(
62 '--recursive'