From 66199b94fc3f9caf2b9cc74a8d6a9caa418700de Mon Sep 17 00:00:00 2001 From: Jade Abraham Date: Fri, 24 Jan 2025 13:25:23 -0800 Subject: [PATCH] skip docs tests with python <3.12 Signed-off-by: Jade Abraham --- test/library/packages/Python/doc-examples/SKIPIF | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 test/library/packages/Python/doc-examples/SKIPIF diff --git a/test/library/packages/Python/doc-examples/SKIPIF b/test/library/packages/Python/doc-examples/SKIPIF new file mode 100755 index 000000000000..33ec676140d5 --- /dev/null +++ b/test/library/packages/Python/doc-examples/SKIPIF @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# requires python 3.12+ + +# respect CHPL_TEST_VENV_DIR if it is set and not none +if [ -n "$CHPL_TEST_VENV_DIR" ] && [ "$CHPL_TEST_VENV_DIR" != "none" ]; then + chpl_python=$CHPL_TEST_VENV_DIR/bin/python3 +else + chpl_python=$($CHPL_HOME/util/config/find-python.sh) +fi + +minor_version=$($chpl_python -c "import sys; print(sys.version_info.minor)") +if [ $minor_version -ge 12 ]; then + echo "False" +else + echo "True" +fi