@@ -8,6 +8,13 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
88# On Mac, run curl -L https://github.com/<...>.tar.gz | shasum -a 256
99# and update the sha256 with the result.
1010
11+ ################################################################################
12+ #
13+ # WORKSPACE is being deprecated in favor of the new Bazelmod dependency system
14+ # It will be removed at some point in the future.
15+ #
16+ ################################################################################
17+
1118## `bazel_skylib` (PINNED)
1219http_archive (
1320 name = "bazel_skylib" , # 2023-05-31T19:24:07Z
@@ -27,6 +34,61 @@ http_archive(
2734 ],
2835)
2936
37+ http_archive (
38+ name = "rules_python" ,
39+ sha256 = "c68bdc4fbec25de5b5493b8819cfc877c4ea299c0dcb15c244c5a00208cde311" ,
40+ strip_prefix = "rules_python-0.31.0" ,
41+ url = "https://github.com/bazelbuild/rules_python/releases/download/0.31.0/rules_python-0.31.0.tar.gz" ,
42+ )
43+
44+ load ("@rules_python//python:repositories.bzl" , "py_repositories" , "python_register_multi_toolchains" )
45+
46+ py_repositories ()
47+
48+ load ("@rules_python//python/pip_install:repositories.bzl" , "pip_install_dependencies" )
49+
50+ pip_install_dependencies ()
51+
52+ DEFAULT_PYTHON = "3.11"
53+
54+ python_register_multi_toolchains (
55+ name = "python" ,
56+ default_version = DEFAULT_PYTHON ,
57+ python_versions = [
58+ "3.12" ,
59+ "3.11" ,
60+ "3.10" ,
61+ "3.9" ,
62+ "3.8"
63+ ],
64+ )
65+
66+ load ("@python//:pip.bzl" , "multi_pip_parse" )
67+
68+ multi_pip_parse (
69+ name = "pypi" ,
70+ default_version = DEFAULT_PYTHON ,
71+ python_interpreter_target = {
72+ "3.12" : "@python_3_12_host//:python" ,
73+ "3.11" : "@python_3_11_host//:python" ,
74+ "3.10" : "@python_3_10_host//:python" ,
75+ "3.9" : "@python_3_9_host//:python" ,
76+ "3.8" : "@python_3_8_host//:python" ,
77+ },
78+ requirements_lock = {
79+ "3.12" : "//pybind11_abseil/requirements:requirements_lock_3_12.txt" ,
80+ "3.11" : "//pybind11_abseil/requirements:requirements_lock_3_11.txt" ,
81+ "3.10" : "//pybind11_abseil/requirements:requirements_lock_3_10.txt" ,
82+ "3.9" : "//pybind11_abseil/requirements:requirements_lock_3_9.txt" ,
83+ "3.8" : "//pybind11_abseil/requirements:requirements_lock_3_8.txt" ,
84+ },
85+ )
86+
87+ load ("@pypi//:requirements.bzl" , "install_deps" )
88+
89+ install_deps ()
90+
91+
3092## `pybind11_bazel` (FLOATING)
3193# https://github.com/pybind/pybind11_bazel
3294http_archive (
@@ -52,6 +114,3 @@ http_archive(
52114 # sha256 = "832e2f309c57da9c1e6d4542dedd34b24e4192ecb4d62f6f4866a737454c9970",
53115 # urls = ["https://github.com/pybind/pybind11/archive/refs/tags/v2.10.4.tar.gz"],
54116)
55-
56- load ("@pybind11_bazel//:python_configure.bzl" , "python_configure" )
57- python_configure (name = "local_config_python" )
0 commit comments