Skip to content

Commit

Permalink
[anaconda] Update tests
Browse files Browse the repository at this point in the history
- Rework test for checking the `tornado` package version;
- Rework `checkPythonPackageVersion` function to use `importlib.metadata` library;
  • Loading branch information
alexander-smolyakov committed Nov 7, 2023
1 parent a9e71e6 commit c95789b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/anaconda/test-project/test-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}

Expand Down
5 changes: 1 addition & 4 deletions src/anaconda/test-project/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c95789b

Please sign in to comment.