Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[anaconda] Update tests
- 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
commit c95789b761fb28b31ecdb4c957f4f09ca8f327bd
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