From 023d6d484e9537798dc0c895f2e77f1bee7b3b77 Mon Sep 17 00:00:00 2001 From: Oscar Higgott <29460323+oscarhiggott@users.noreply.github.com> Date: Thu, 3 Apr 2025 08:58:58 +0000 Subject: [PATCH] Switch to bzlmod --- .bazelrc | 1 - BUILD | 4 ++-- MODULE.bazel | 16 ++++++++++++++++ WORKSPACE | 43 ------------------------------------------- 4 files changed, 18 insertions(+), 46 deletions(-) delete mode 100644 .bazelrc create mode 100644 MODULE.bazel delete mode 100644 WORKSPACE diff --git a/.bazelrc b/.bazelrc deleted file mode 100644 index 50e82d933..000000000 --- a/.bazelrc +++ /dev/null @@ -1 +0,0 @@ -common --enable_workspace \ No newline at end of file diff --git a/BUILD b/BUILD index c76555381..da295eb36 100644 --- a/BUILD +++ b/BUILD @@ -57,8 +57,8 @@ cc_test( data = glob(["data/**"]), includes = ["src/"], deps = [ - "@gtest", - "@gtest//:gtest_main", + "@googletest//:gtest", + "@googletest//:gtest_main", "@stim//:stim_lib", ], ) diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 000000000..cf7dc2c09 --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,16 @@ +module(name = "pymatching", version = "2.2.dev2") + +bazel_dep(name = "rules_python", version = "1.3.0") +bazel_dep(name = "pybind11_bazel", version = "2.13.6") + +bazel_dep(name = "googletest", version = "1.16.0") + +git = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") +git( + name = "stim", + commit = "1320ad7eac7de34d2e9c70daa44fbc6d84174450", + remote = "https://github.com/quantumlib/stim.git", +) + +python = use_extension("@rules_python//python/extensions:python.bzl", "python") +python.toolchain(python_version = "3.11") diff --git a/WORKSPACE b/WORKSPACE deleted file mode 100644 index 12916841d..000000000 --- a/WORKSPACE +++ /dev/null @@ -1,43 +0,0 @@ -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") - -git_repository( - name = "stim", - commit = "1320ad7eac7de34d2e9c70daa44fbc6d84174450", - remote = "https://github.com/quantumlib/stim.git", -) - -http_archive( - name = "gtest", - sha256 = "353571c2440176ded91c2de6d6cd88ddd41401d14692ec1f99e35d013feda55a", - strip_prefix = "googletest-release-1.11.0", - urls = ["https://github.com/google/googletest/archive/refs/tags/release-1.11.0.zip"], -) - -http_archive( - name = "pybind11_bazel", - sha256 = "9df284330336958c837fb70dc34c0a6254dac52a5c983b3373a8c2bbb79ac35e", - strip_prefix = "pybind11_bazel-2.13.6", - urls = ["https://github.com/pybind/pybind11_bazel/archive/v2.13.6.zip"], -) - -http_archive( - name = "pybind11", - sha256 = "d0a116e91f64a4a2d8fb7590c34242df92258a61ec644b79127951e821b47be6", - build_file = "@pybind11_bazel//:pybind11-BUILD.bazel", - strip_prefix = "pybind11-2.13.6", - urls = ["https://github.com/pybind/pybind11/archive/v2.13.6.zip"], -) - -http_archive( - name = "rules_python", - sha256 = "2cc26bbd53854ceb76dd42a834b1002cd4ba7f8df35440cf03482e045affc244", - strip_prefix = "rules_python-1.3.0", - url = "https://github.com/bazel-contrib/rules_python/releases/download/1.3.0/rules_python-1.3.0.tar.gz", -) - -load("@rules_python//python:repositories.bzl", "py_repositories") - -py_repositories() - -load("@pybind11_bazel//:build_defs.bzl", "pybind_extension")