Skip to content

Commit

Permalink
Install deps to hermetic python
Browse files Browse the repository at this point in the history
  • Loading branch information
seanpmorgan committed Oct 14, 2023
1 parent 9297f60 commit 2fbf3f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 28 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/...
Expand Down
37 changes: 11 additions & 26 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 2fbf3f4

Please sign in to comment.