@@ -19,8 +19,10 @@ set -x
1919PYENV_ROOT=" /home/kbuilder/.pyenv"
2020PYTHON_VERSION=${PYTHON_VERSION:- " 3.11" }
2121
22- echo " Installing pyenv.."
23- git clone https://github.com/pyenv/pyenv.git " $PYENV_ROOT "
22+ if [[ ! -d " $PYENV_ROOT " ]]; then
23+ echo " Installing pyenv.."
24+ git clone https://github.com/pyenv/pyenv.git " $PYENV_ROOT "
25+ fi
2426export PATH=" /home/kbuilder/.local/bin:$PYENV_ROOT /bin:$PATH "
2527eval " $( pyenv init --path) "
2628
@@ -32,21 +34,23 @@ cd "${KOKORO_ARTIFACTS_DIR}/github/gnn/"
3234
3335PIP_TEST_PREFIX=bazel_pip
3436
35- python -m venv venv
36- source venv /bin/activate
37+ python -m venv build_venv
38+ source build_venv /bin/activate
3739
3840# Check the python version
3941python --version
40- python3 --version
4142
4243# update pip
4344pip install --upgrade pip
4445
46+ # Install build
47+ pip install build
48+
4549TEST_ROOT=$( pwd) /${PIP_TEST_PREFIX}
4650rm -rf " $TEST_ROOT "
4751mkdir -p " $TEST_ROOT "
4852ln -s " $( pwd) " /tensorflow_gnn " $TEST_ROOT " /tensorflow_gnn
49- tag_filters=" -no_oss,-oss_excluded"
53+ tag_filters=" -no_oss,-oss_excluded${TAG_FILTERS} "
5054
5155# Check that `bazel` does version selection as expected.
5256if [[ -n " ${USE_BAZEL_VERSION} " && $( bazel --version) != * ${USE_BAZEL_VERSION} * ]]; then
@@ -55,25 +59,35 @@ if [[ -n "${USE_BAZEL_VERSION}" && $(bazel --version) != *${USE_BAZEL_VERSION}*
5559fi
5660
5761bazel clean
58- pip install -r requirements-dev.txt --progress-bar off
59- pip install tf-keras-nightly tf-nightly --progress-bar off --upgrade
60- # We need to remove the dependency on tensorflow to test nightly
61- # The dependencies will be provided by tf-nightly
62- perl -i -lpe ' $k+= s/tensorflow>=2\.[0-9]+\.[0-9]+(,<=?[0-9.]+)?;/tf-nightly;/g; END{exit($k != 1)}' setup.py
63- # tf-nightly 2.21 lifted the protobuf version to what google-vizier 0.1.24 wants
64- # but what google-vizier 0.1.21 together with apache-beam does not allow.
65- # TODO: b/482003228 - Replace this patch by a proper dependency cleanup.
66- perl -i -lpe ' $k+= s/google-vizier>=0.0.13,!=0.1.23,!=0.1.24/google-vizier>=0.0.13,!=0.1.23/g; END{exit($k != 1)}' setup.py
67- python3 setup.py bdist_wheel
68- pip uninstall -y tensorflow_gnn
69- pip install dist/tensorflow_gnn-* .whl
62+ pip install --group test-nightly --progress-bar off --upgrade
63+ python3 -m build --wheel
64+ deactivate
65+
66+ # Start the test environment.
67+ python3 -m venv test_venv
68+ source test_venv/bin/activate
69+
70+ # Check the python version
71+ python --version
72+
73+ pip install --upgrade pip
74+ tf_wheel=$( ls dist/tensorflow_gnn-* .whl)
75+ pip install " ${tf_wheel[0]} [vizier]"
76+ pip uninstall -y tensorflow tf-keras ai-edge-litert
77+ pip install --group test-nightly --progress-bar off --upgrade
7078
7179echo " Final packages after all pip commands:"
7280pip list
7381
7482# Check that tf-nightly is installed but tensorflow is not
7583# Also check that tf-keras-nightly is installed.
76- pip freeze | grep -q tf-nightly= && ! pip freeze | grep -q tensorflow=
77- pip freeze | grep -q tf-keras-nightly= && ! pip freeze | grep -q tf-keras=
84+ if [[ $( pip freeze | grep -q tf_nightly=; echo $? ) -eq 0 && $( pip freeze | grep -q tensorflow=; echo $? ) -eq 0 ]]; then
85+ echo " Found tensorflow and tf_nightly in the environment."
86+ exit 1
87+ fi
88+ if [[ $( pip freeze | grep -q tf_keras-nightly=; echo $? ) -eq 0 && $( pip freeze | grep -q tf_keras=; echo $? ) -eq 0 ]]; then
89+ echo " Found tf_keras and tf_keras-nightly in the environment."
90+ exit 1
91+ fi
7892# The env variable is needed to ensure that TF keras still behaves like keras 2
7993bazel test --test_env=" TF_USE_LEGACY_KERAS=1" --build_tag_filters=" ${tag_filters} " --test_tag_filters=" ${tag_filters} " --test_output=errors --verbose_failures=true --build_tests_only --define=no_tfgnn_py_deps=true --keep_going --experimental_repo_remote_exec //bazel_pip/tensorflow_gnn/...
0 commit comments