1313# limitations under the License.
1414
1515# TODO(fchern): automate version string alignment with setup.py
16- VERSION = "0.6.0 "
16+ VERSION = "0.7.3 "
1717
1818module (
1919 name = "array_record" ,
@@ -32,21 +32,52 @@ bazel_dep(name = "eigen", version = "3.4.0.bcr.3")
3232bazel_dep (name = "riegeli" , version = "0.0.0-20241218-3385e3c" )
3333bazel_dep (name = "pybind11_bazel" , version = "2.12.0" )
3434
35- PYTHON_VERSION = "3.10"
35+ http_archive = use_repo_rule ( "@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
3636
37- python = use_extension ("@rules_python//python/extensions:python.bzl" , "python" )
38- python .toolchain (
39- ignore_root_user_error = True , # Required for our containerized CI environments.
40- python_version = PYTHON_VERSION ,
37+ http_archive (
38+ name = "pybind11" ,
39+ build_file = "@pybind11_bazel//:pybind11.BUILD" ,
40+ sha256 = "201966a61dc826f1b1879a24a3317a1ec9214a918c8eb035be2f30c3e9cfbdcb" ,
41+ strip_prefix = "pybind11-2.10.3" ,
42+ urls = ["https://github.com/pybind/pybind11/archive/refs/tags/v2.10.3.zip" ],
4143)
4244
45+ SUPPORTED_PYTHON_VERSIONS = [
46+ "3.10" ,
47+ "3.11" ,
48+ "3.12" ,
49+ "3.13" ,
50+ ]
51+
52+ DEFAULT_PYTHON_VERSION = "3.10"
53+
54+ python_configure = use_extension ("@pybind11_bazel//:python_configure.bzl" , "extension" )
55+ use_repo (python_configure , "local_config_python" )
56+
57+ python = use_extension ("@rules_python//python/extensions:python.bzl" , "python" )
58+
59+ [
60+ python .toolchain (
61+ ignore_root_user_error = True ,
62+ is_default = python_version == DEFAULT_PYTHON_VERSION ,
63+ python_version = python_version ,
64+ )
65+ for python_version in SUPPORTED_PYTHON_VERSIONS
66+ ]
67+
68+ use_repo (python , python = "python_versions" )
69+
4370pip = use_extension ("@rules_python//python/extensions:pip.bzl" , "pip" )
4471
4572# requirements_lock.txt is generated by
4673# bazel run //:requirements.update
47- pip .parse (
48- hub_name = "pypi" ,
49- python_version = PYTHON_VERSION ,
50- requirements_lock = "//:requirements_lock.txt" ,
51- )
74+ [
75+ pip .parse (
76+ hub_name = "pypi" ,
77+ python_version = version ,
78+ requirements_lock = "test_requirements_lock_" + version .replace ("." , "_" ) + ".txt" ,
79+ )
80+ for version in SUPPORTED_PYTHON_VERSIONS
81+ ]
82+
5283use_repo (pip , "pypi" )
0 commit comments