summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2024-06-11 10:10:20 +0300
committerGitHub <noreply@github.com>2024-06-11 10:10:20 +0300
commit4bfe50f741479c1df1c377260c3ff5702586719e (patch)
tree33845938b46d6c08ac4c32b952c7c5acaa6c8d56
parentbdcb8f42221bc40c411150a009a3d3a30fa74722 (diff)
tests : check the Python version (#7872)
ggml-ci
-rwxr-xr-xtests/test-json-schema-to-grammar.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test-json-schema-to-grammar.cpp b/tests/test-json-schema-to-grammar.cpp
index a33104de..87bc66b6 100755
--- a/tests/test-json-schema-to-grammar.cpp
+++ b/tests/test-json-schema-to-grammar.cpp
@@ -870,7 +870,7 @@ int main() {
}
});
- if (getenv("LLAMA_PYTHON_AVAILABLE") || (std::system("python --version") == 0)) {
+ if (getenv("LLAMA_PYTHON_AVAILABLE") || (std::system("python -c \"import sys; exit(1) if sys.version_info < (3, 8) else print('Python version is sufficient')\"") == 0)) {
test_all("Python", [](const TestCase & tc) {
write("test-json-schema-input.tmp", tc.schema);
tc.verify_status(std::system(
@@ -878,7 +878,7 @@ int main() {
tc.verify(read("test-grammar-output.tmp"));
});
} else {
- fprintf(stderr, "\033[33mWARNING: Python not found, skipping Python JSON schema -> grammar tests.\n\033[0m");
+ fprintf(stderr, "\033[33mWARNING: Python not found (min version required is 3.8), skipping Python JSON schema -> grammar tests.\n\033[0m");
}
if (getenv("LLAMA_NODE_AVAILABLE") || (std::system("node --version") == 0)) {