Skip to content

Commit e7a3794

Browse files
Migrate package metadata to pyproject.toml.
PiperOrigin-RevId: 829082204
1 parent 55784fc commit e7a3794

File tree

17 files changed

+184
-156
lines changed

17 files changed

+184
-156
lines changed

.bazelversion

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
7.7.0
2+
# TODO: b/390391579 - Upgrade once bazel 8+ works.

BUILD

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ py_library(
33
# This is a dummy rule used as a absl dependency in open-source.
44
# We expect absl to already be installed on the system, e.g. via
55
# `pip install absl`
6+
strict_deps = False,
67
visibility = ["//visibility:public"],
78
deps = [],
89
)
@@ -12,6 +13,7 @@ py_library(
1213
# This is a dummy rule used as a absl dependency in open-source.
1314
# We expect absl to already be installed on the system, e.g. via
1415
# `pip install absl`
16+
strict_deps = False,
1517
visibility = ["//visibility:public"],
1618
deps = [],
1719
)
@@ -21,6 +23,7 @@ py_library(
2123
# This is a dummy rule used as a absl dependency in open-source.
2224
# We expect absl to already be installed on the system, e.g. via
2325
# `pip install absl`
26+
strict_deps = False,
2427
visibility = ["//visibility:public"],
2528
deps = [],
2629
)
@@ -30,6 +33,7 @@ py_library(
3033
# This is a dummy rule used as a numpy dependency in open-source.
3134
# We expect numpy to already be installed on the system, e.g. via
3235
# `pip install numpy`
36+
strict_deps = False,
3337
visibility = ["//visibility:public"],
3438
deps = [],
3539
)
@@ -39,6 +43,7 @@ py_library(
3943
# This is a dummy rule used as a tensorflow dependency in open-source.
4044
# We expect tensorflow to already be installed on the system, e.g. via
4145
# `pip install tensorflow`
46+
strict_deps = False,
4247
visibility = ["//visibility:public"],
4348
deps = [],
4449
)
@@ -48,6 +53,7 @@ py_library(
4853
# This is a dummy rule used as a ai-edge-litert dependency in open-source.
4954
# We expect ai-edge-litert to already be installed on the system, e.g. via
5055
# `pip install ai-edge-litert`
56+
strict_deps = False,
5157
visibility = ["//visibility:public"],
5258
deps = [],
5359
)
@@ -57,6 +63,7 @@ py_library(
5763
# This is a dummy rule used as a tensorflow dependency in open-source.
5864
# We expect tensorflow to already be installed on the system, e.g. via
5965
# `pip install tensorflow`
66+
strict_deps = False,
6067
visibility = ["//visibility:public"],
6168
deps = [],
6269
)
@@ -66,6 +73,7 @@ py_library(
6673
# This is a dummy rule used as a dependency on vizier.service.pyvizier in open-source.
6774
# We expect Vizier to already be installed on the system, e.g. via
6875
# `pip install google-vizier` and extra steps if needed (b/254806045).
76+
strict_deps = False,
6977
visibility = ["//visibility:public"],
7078
deps = [],
7179
)
@@ -75,6 +83,7 @@ py_library(
7583
# This is a dummy rule used as a mock dependency in open-source tests.
7684
# We expect mock to already be installed on the system, e.g. via
7785
# `pip install mock`
86+
strict_deps = False,
7887
visibility = ["//visibility:public"],
7988
deps = [],
8089
)

kokoro/github/ubuntu/cpu/build.sh

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,18 @@ cd "${KOKORO_ARTIFACTS_DIR}/github/gnn/"
3232

3333
PIP_TEST_PREFIX=bazel_pip
3434

35-
python -m venv venv
36-
source venv/bin/activate
35+
python -m venv build_venv
36+
source build_venv/bin/activate
3737

3838
# Check the python version
3939
python --version
40-
python3 --version
4140

4241
# update pip
4342
pip install --upgrade pip
4443

44+
# Install build
45+
pip install build
46+
4547
TEST_ROOT=$(pwd)/${PIP_TEST_PREFIX}
4648
rm -rf "$TEST_ROOT"
4749
mkdir -p "$TEST_ROOT"
@@ -55,25 +57,34 @@ if [[ -n "${USE_BAZEL_VERSION}" && $(bazel --version) != *${USE_BAZEL_VERSION}*
5557
fi
5658

5759
bazel 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
60+
pip install --group test-nightly --progress-bar off --upgrade
61+
python3 -m build --wheel
62+
deactivate
63+
64+
# Start the test environment.
65+
python3 -m venv test_venv
66+
source test_venv/bin/activate
67+
68+
# Check the python version
69+
python --version
70+
71+
pip install --upgrade pip
6972
pip install dist/tensorflow_gnn-*.whl
73+
pip uninstall -y tensorflow tf-keras ai-edge-litert
74+
pip install --group test-nightly --progress-bar off --upgrade
7075

7176
echo "Final packages after all pip commands:"
7277
pip list
7378

7479
# Check that tf-nightly is installed but tensorflow is not
7580
# 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=
81+
if [[ $(pip freeze | grep -q tf_nightly=; echo $?) -eq 0 && $(pip freeze | grep -q tensorflow=; echo $?) -eq 0 ]]; then
82+
echo "Found tensorflow and tf_nightly in the environment."
83+
exit 1
84+
fi
85+
if [[ $(pip freeze | grep -q tf_keras-nightly=; echo $?) -eq 0 && $(pip freeze | grep -q tf_keras=; echo $?) -eq 0 ]]; then
86+
echo "Found tf_keras and tf_keras-nightly in the environment."
87+
exit 1
88+
fi
7889
# The env variable is needed to ensure that TF keras still behaves like keras 2
7990
bazel 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/...

kokoro/github/ubuntu/cpu/build_versioned.sh

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ set -x
1919
PYENV_ROOT="/home/kbuilder/.pyenv"
2020
PYTHON_VERSION=${PYTHON_VERSION:-"3.11"}
2121

22+
function force_tensorflow_version() {
23+
if [[ -z "${TF_VERSION}" ]]; then
24+
echo "TF_VERSION is not set. Not forcing tensorflow version."
25+
return
26+
fi
27+
28+
pip install tensorflow=="${TF_VERSION}" --progress-bar off --upgrade
29+
if [[ "$TF_USE_LEGACY_KERAS" == 1 ]]; then
30+
pip install tf-keras=="${TF_VERSION}" --progress-bar off --upgrade
31+
fi
32+
}
33+
2234
echo "Installing pyenv.."
2335
git clone https://github.com/pyenv/pyenv.git "$PYENV_ROOT"
2436
export PATH="/home/kbuilder/.local/bin:$PYENV_ROOT/bin:$PATH"
@@ -32,16 +44,18 @@ cd "${KOKORO_ARTIFACTS_DIR}/github/gnn/"
3244

3345
PIP_TEST_PREFIX=bazel_pip
3446

35-
python -m venv venv
36-
source venv/bin/activate
47+
python -m venv build_venv
48+
source build_venv/bin/activate
3749

3850
# Debug messages to indicate the python version
3951
python --version
40-
python3 --version
4152

4253
# update pip
4354
pip install --upgrade pip
4455

56+
# Install build
57+
pip install build
58+
4559
TEST_ROOT=$(pwd)/${PIP_TEST_PREFIX}
4660
rm -rf "$TEST_ROOT"
4761
mkdir -p "$TEST_ROOT"
@@ -62,13 +76,27 @@ if [[ -n "${USE_BAZEL_VERSION}" && $(bazel --version) != *${USE_BAZEL_VERSION}*
6276
fi
6377

6478
bazel clean
65-
pip install -r requirements-dev.txt --progress-bar off
66-
pip install tensorflow=="${TF_VERSION}" --progress-bar off --upgrade
79+
force_tensorflow_version
80+
python3 -m build --wheel
81+
deactivate
82+
83+
# Start the test environment.
84+
python3 -m venv test_venv
85+
source test_venv/bin/activate
86+
87+
# Check the python version
88+
python --version
89+
90+
# update pip
91+
pip install --upgrade pip
92+
force_tensorflow_version
93+
6794
if [[ "$TF_USE_LEGACY_KERAS" == 1 ]]; then
68-
pip install tf-keras=="${TF_VERSION}" --progress-bar off --upgrade
95+
pip install --group test-tf216plus --progress-bar off --upgrade
96+
else
97+
pip install --group test-pre-tf216 --progress-bar off --upgrade
6998
fi
70-
python3 setup.py bdist_wheel
71-
pip uninstall -y tensorflow_gnn
99+
72100
pip install dist/tensorflow_gnn-*.whl
73101

74102
echo "Final packages after all pip commands:"

kokoro/github/ubuntu/cpu/continuous.cfg

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
build_file: "gnn/kokoro/github/ubuntu/cpu/build.sh"
22

3-
env_vars: {
4-
key: "USE_BAZEL_VERSION"
5-
value: "7.4.1" # TODO - b/390391579: Unpin once bazel 8 works.
6-
}
73
env_vars: {
84
key: "PYTHON_VERSION"
95
value: "3.11"

kokoro/github/ubuntu/cpu/newest_stable/continuous.cfg

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
build_file: "gnn/kokoro/github/ubuntu/cpu/build_versioned.sh"
22

3-
env_vars: {
4-
key: "USE_BAZEL_VERSION"
5-
value: "7.4.1" # TODO - b/390391579: Unpin once bazel 8 works.
6-
}
73
env_vars: {
84
key: "PYTHON_VERSION"
95
value: "3.11"

kokoro/github/ubuntu/cpu/newest_stable/presubmit.cfg

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
build_file: "gnn/kokoro/github/ubuntu/cpu/build_versioned.sh"
22

3-
env_vars: {
4-
key: "USE_BAZEL_VERSION"
5-
value: "7.4.1" # TODO - b/390391579: Unpin once bazel 8 works.
6-
}
73
env_vars: {
84
key: "PYTHON_VERSION"
95
value: "3.11"

kokoro/github/ubuntu/cpu/oldest/continuous.cfg

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
build_file: "gnn/kokoro/github/ubuntu/cpu/build_versioned.sh"
22

3-
env_vars: {
4-
key: "USE_BAZEL_VERSION"
5-
value: "7.4.1" # TODO - b/390391579: Unpin once bazel 8 works.
6-
}
73
env_vars: {
84
key: "PYTHON_VERSION"
95
value: "3.11"

kokoro/github/ubuntu/cpu/oldest/presubmit.cfg

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
build_file: "gnn/kokoro/github/ubuntu/cpu/build_versioned.sh"
22

3-
env_vars: {
4-
key: "USE_BAZEL_VERSION"
5-
value: "7.4.1" # TODO - b/390391579: Unpin once bazel 8 works.
6-
}
73
env_vars: {
84
key: "PYTHON_VERSION"
95
value: "3.11"

kokoro/github/ubuntu/cpu/presubmit.cfg

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
build_file: "gnn/kokoro/github/ubuntu/cpu/build.sh"
22

3-
env_vars: {
4-
key: "USE_BAZEL_VERSION"
5-
value: "7.4.1" # TODO - b/390391579: Unpin once bazel 8 works.
6-
}
73
env_vars: {
84
key: "PYTHON_VERSION"
95
value: "3.11"

0 commit comments

Comments
 (0)