Skip to content

Commit

Permalink
Build against tf2.14 bazel strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
seanpmorgan committed Oct 18, 2023
1 parent ab850ee commit fa46146
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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 }}
Expand Down
58 changes: 55 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit fa46146

Please sign in to comment.