From 2fbf3f474d84976cbbb336467eb0ba38309cf7f6 Mon Sep 17 00:00:00 2001 From: Sean Morgan Date: Sat, 14 Oct 2023 09:05:45 -0700 Subject: [PATCH] Install deps to hermetic python --- .github/workflows/release.yml | 3 +-- WORKSPACE | 37 +++++++++++------------------------ 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1c2a118518..f52cde47bc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,10 +29,9 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: ${{ env.MIN_PY_VERSION }} + TF_PYTHON_VERSION: ${{ env.MIN_PY_VERSION }} - name: Build wheels run: | - pip install --default-timeout=1000 -r tools/install_deps/pytest.txt -r tools/install_deps/tensorflow-cpu.txt -r requirements.txt bash tools/install_deps/install_bazelisk.sh ./ python configure.py bazel test -k --test_timeout 300,450,1200,3600 --test_output=errors //tensorflow_addons/... diff --git a/WORKSPACE b/WORKSPACE index 72b305e0b0..a890b765d7 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -15,17 +15,6 @@ http_archive( ], ) -# TODO: please double check what it is really required or not in this section -# ############################################################### -http_archive( - name = "bazel_skylib", - sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506", - urls = [ - "https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz", - ], -) - http_archive( name = "rules_python", sha256 = "9d04041ac92a0985e344235f5d946f71ac543f1b1565f2cdbc9a2aaee8adf55b", @@ -56,29 +45,25 @@ python_register_toolchains( load("@python//:defs.bzl", "interpreter") load("@rules_python//python:pip.bzl", "package_annotation", "pip_parse") -NUMPY_ANNOTATIONS = { - "numpy": package_annotation( - additive_build_content = """\ -filegroup( - name = "includes", - srcs = glob(["site-packages/numpy/core/include/**/*.h"]), +pip_parse( + name = "pypi", + python_interpreter_target = interpreter, + requirements = "//:requirements.txt", ) -cc_library( - name = "numpy_headers", - hdrs = [":includes"], - strip_include_prefix="site-packages/numpy/core/include/", + +pip_parse( + name = "pypi", + python_interpreter_target = interpreter, + requirements = "//:tools/install_deps/tensorflow-cpu.txt", ) -""", - ), -} pip_parse( name = "pypi", - annotations = NUMPY_ANNOTATIONS, python_interpreter_target = interpreter, - requirements = "//:requirements.txt", + requirements = "//:tools/install_deps/pytest.txt", ) + load("@pypi//:requirements.bzl", "install_deps") install_deps()