Skip to content

Commit 4cae3c5

Browse files
juergwcopybara-github
authored andcommitted
Install all tink_py deps in tink-py examples WORKSPACE.
- Use python_register_toolchains. - Inline tink_py_deps_init and remove 'extra_pip_args = ["--no-deps"]'. PiperOrigin-RevId: 736061470 Change-Id: I29171db5fcc60ebfac69808bde7c0402788f0af9
1 parent 97bf741 commit 4cae3c5

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

examples/WORKSPACE

+27-5
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,37 @@ load("@tink_py//:tink_py_deps.bzl", "tink_py_deps")
2222

2323
tink_py_deps()
2424

25-
load("@rules_python//python:repositories.bzl", "py_repositories")
25+
load("@pybind11_bazel//:python_configure.bzl", "python_configure")
26+
load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")
2627

2728
py_repositories()
2829

29-
load("@tink_py//:tink_py_deps_init.bzl", "tink_py_deps_init")
30+
python_register_toolchains(
31+
name = "python_3_12",
32+
ignore_root_user_error = True,
33+
python_version = "3.12",
34+
)
35+
36+
load("@tink_cc//:tink_cc_deps.bzl", "tink_cc_deps")
37+
tink_cc_deps()
38+
load("@tink_cc//:tink_cc_deps_init.bzl", "tink_cc_deps_init")
39+
tink_cc_deps_init()
40+
41+
load("@rules_python//python:pip.bzl", "pip_parse")
42+
43+
pip_parse(
44+
name = "tink_py_pip_deps",
45+
quiet = False,
46+
requirements_lock = "@tink_py//:requirements_all.txt",
47+
)
3048

31-
tink_py_deps_init("tink_py")
49+
# Use `which python3` by default [1] unless PYTHON_BIN_PATH is specified [2].
50+
#
51+
# [1] https://github.com/pybind/pybind11_bazel/blob/fc56ce8a8b51e3dd941139d329b63ccfea1d304b/python_configure.bzl#L434
52+
# [2] https://github.com/pybind/pybind11_bazel/blob/fc56ce8a8b51e3dd941139d329b63ccfea1d304b/python_configure.bzl#L162
53+
python_configure(name = "local_config_python", python_version = "3")
3254

33-
load("@tink_py_pip_deps//:requirements.bzl", tink_py_install_pypi_deps="install_deps")
55+
load("@tink_py_pip_deps//:requirements.bzl", tink_py_install_pypi_deps = "install_deps")
3456

3557
tink_py_install_pypi_deps()
3658

@@ -43,6 +65,6 @@ pip_parse(
4365
requirements_lock = "@examples_python//:requirements.txt",
4466
)
4567

46-
load("@pip_deps//:requirements.bzl", tink_py_example_install_pypi_deps="install_deps")
68+
load("@pip_deps//:requirements.bzl", tink_py_example_install_pypi_deps = "install_deps")
4769

4870
tink_py_example_install_pypi_deps()

0 commit comments

Comments
 (0)