From 3d8d031c650a4bf9b111173e15c228989523262c Mon Sep 17 00:00:00 2001 From: Andrey Talman Date: Thu, 23 Feb 2023 17:38:09 -0500 Subject: [PATCH] Fix validation workflow for test channel (#2071) * Validate test binaries test * Fix validate binaries for py3.11 * fix lint * remove temp change --- .github/scripts/validate_binaries.sh | 7 ++++++- test/smoke_tests/smoke_tests.py | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/scripts/validate_binaries.sh b/.github/scripts/validate_binaries.sh index 3233b6d462..cf0f966eea 100755 --- a/.github/scripts/validate_binaries.sh +++ b/.github/scripts/validate_binaries.sh @@ -1,6 +1,11 @@ if [[ ${MATRIX_PACKAGE_TYPE} = "conda" ]]; then - conda install -y torchtext -c ${PYTORCH_CONDA_CHANNEL} + #special case for Python 3.11 + if [[ ${MATRIX_PYTHON_VERSION} == '3.11' ]]; then + conda install -y torchtext -c malfet -c ${PYTORCH_CONDA_CHANNEL} + else + conda install -y torchtext -c ${PYTORCH_CONDA_CHANNEL} + fi else pip install ${PYTORCH_PIP_PREFIX} torchtext --extra-index-url ${PYTORCH_PIP_DOWNLOAD_URL} fi diff --git a/test/smoke_tests/smoke_tests.py b/test/smoke_tests/smoke_tests.py index 14c963250f..2fbaeec5ec 100644 --- a/test/smoke_tests/smoke_tests.py +++ b/test/smoke_tests/smoke_tests.py @@ -1,5 +1,6 @@ """Run smoke tests""" +import os import re import torchdata @@ -7,6 +8,7 @@ import torchtext.version # noqa: F401 NIGHTLY_ALLOWED_DELTA = 3 +channel = os.getenv("MATRIX_CHANNEL") def validateTorchdataVersion(): @@ -19,5 +21,8 @@ def validateTorchdataVersion(): raise RuntimeError(f"torchdata binary {torchdata.__version__} is more than {NIGHTLY_ALLOWED_DELTA} days old!") -validateTorchdataVersion() +if channel == "nightly": + validateTorchdataVersion() + print("torchtext version is ", torchtext.__version__) +print("torchdata version is ", torchdata.__version__)