From c95789b761fb28b31ecdb4c957f4f09ca8f327bd Mon Sep 17 00:00:00 2001 From: Alexander Smolyakov Date: Tue, 7 Nov 2023 14:19:52 +0400 Subject: [PATCH] [anaconda] Update tests - Rework test for checking the `tornado` package version; - Rework `checkPythonPackageVersion` function to use `importlib.metadata` library; --- src/anaconda/test-project/test-utils.sh | 2 +- src/anaconda/test-project/test.sh | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/anaconda/test-project/test-utils.sh b/src/anaconda/test-project/test-utils.sh index 048a71c44..6d47d2bb8 100644 --- a/src/anaconda/test-project/test-utils.sh +++ b/src/anaconda/test-project/test-utils.sh @@ -168,7 +168,7 @@ checkPythonPackageVersion() PACKAGE=$1 REQUIRED_VERSION=$2 - current_version=$(python -c "import ${PACKAGE}; print(${PACKAGE}.__version__)") + current_version=$(python -c "import importlib.metadata; print(importlib.metadata.version('${PACKAGE}'))") check-version-ge "${PACKAGE}-requirement" "${current_version}" "${REQUIRED_VERSION}" } diff --git a/src/anaconda/test-project/test.sh b/src/anaconda/test-project/test.sh index 1869febda..baf951019 100755 --- a/src/anaconda/test-project/test.sh +++ b/src/anaconda/test-project/test.sh @@ -45,10 +45,7 @@ checkPythonPackageVersion "transformers" "4.30.0" checkPythonPackageVersion "mpmath" "1.3.0" checkPythonPackageVersion "aiohttp" "3.8.5" checkPythonPackageVersion "jupyter_server" "2.7.2" - -# The `tornado` package doesn't have the `__version__` attribute so we can use the `version` attribute. -tornado_version=$(python -c "import tornado; print(tornado.version)") -check-version-ge "tornado-requirement" "${tornado_version}" "6.3.3" +checkPythonPackageVersion "tornado" "6.3.3" checkCondaPackageVersion "pyopenssl" "23.2.0" checkCondaPackageVersion "cryptography" "41.0.3"