From fa4614636bc81c84b0cf2724b914fbdcd21eed5e Mon Sep 17 00:00:00 2001 From: Sean Morgan Date: Tue, 17 Oct 2023 22:14:32 -0700 Subject: [PATCH] Build against tf2.14 bazel strategy --- .github/workflows/release.yml | 2 ++ WORKSPACE | 58 +++++++++++++++++++++++++++++++++-- 2 files changed, 57 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1c2a118518..6d9049d9a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,6 +29,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: + TF_PYTHON_VERSION: ${{ env.MIN_PY_VERSION }} python-version: ${{ env.MIN_PY_VERSION }} - name: Build wheels run: | @@ -87,6 +88,7 @@ jobs: env: OS: ${{ runner.os }} PY_VERSION: ${{ matrix.py-version }} + TF_PYTHON_VERSION: ${{ matrix.py-version }} TF_VERSION: ${{ matrix.tf-version }} NIGHTLY_TIME: ${{ steps.author-date.outputs.result }} CPU: ${{ matrix.cpu }} diff --git a/WORKSPACE b/WORKSPACE index 2f440470b6..52b01b4dc2 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -8,13 +8,65 @@ tf_configure( http_archive( name = "org_tensorflow", - sha256 = "c030cb1905bff1d2446615992aad8d8d85cbe90c4fb625cee458c63bf466bc8e", - strip_prefix = "tensorflow-2.12.0", + sha256 = "ce357fd0728f0d1b0831d1653f475591662ec5bca736a94ff789e6b1944df19f", + strip_prefix = "tensorflow-2.14.0", urls = [ - "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.12.0.tar.gz", + "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.14.0.tar.gz", ], ) +http_archive( + name = "rules_python", + sha256 = "9d04041ac92a0985e344235f5d946f71ac543f1b1565f2cdbc9a2aaee8adf55b", + strip_prefix = "rules_python-0.26.0", + url = "https://github.com/bazelbuild/rules_python/releases/download/0.26.0/rules_python-0.26.0.tar.gz", +) + +load("@rules_python//python:repositories.bzl", "py_repositories") + +py_repositories() + +load("@rules_python//python:repositories.bzl", "python_register_toolchains") +load( + "@org_tensorflow//tensorflow/tools/toolchains/python:python_repo.bzl", + "python_repository", +) + +python_repository(name = "python_version_repo") + +load("@python_version_repo//:py_version.bzl", "HERMETIC_PYTHON_VERSION") + +python_register_toolchains( + name = "python", + ignore_root_user_error = True, + python_version = HERMETIC_PYTHON_VERSION, +) + +load("@python//:defs.bzl", "interpreter") +load("@rules_python//python:pip.bzl", "package_annotation", "pip_parse") + +pip_parse( + name = "pypi", + python_interpreter_target = interpreter, + requirements = "//:requirements.txt", +) + +pip_parse( + name = "pypi", + python_interpreter_target = interpreter, + requirements = "//:tools/install_deps/tensorflow-cpu.txt", +) + +pip_parse( + name = "pypi", + python_interpreter_target = interpreter, + requirements = "//:tools/install_deps/pytest.txt", +) + +load("@pypi//:requirements.bzl", "install_deps") + +install_deps() + load("@org_tensorflow//tensorflow:workspace3.bzl", "tf_workspace3") tf_workspace3()