From aae7c24a3fff59b708869b11b3ebbf3d73f3db3a Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Wed, 20 Nov 2024 07:39:23 -0800 Subject: [PATCH] Revert "example: Add example for pybind11" (#444) Reverts aspect-build/rules_py#375 Broke the `main` branch. As noted earlier we don't have the right branch protections on this repo to prevent merging red PRs. @mattem please fix it or grant me permissions so I can fix it. --- MODULE.bazel | 2 -- examples/pybind11/BUILD.bazel | 19 ------------------- examples/pybind11/basic.cpp | 10 ---------- examples/pybind11/basic_test.py | 14 -------------- 4 files changed, 45 deletions(-) delete mode 100644 examples/pybind11/BUILD.bazel delete mode 100644 examples/pybind11/basic.cpp delete mode 100644 examples/pybind11/basic_test.py diff --git a/MODULE.bazel b/MODULE.bazel index 18da9029..e2375770 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -85,5 +85,3 @@ crate.from_cargo( ) use_repo(crate, "crate_index") - -bazel_dep(name = "pybind11_bazel", version = "2.12.0", dev_dependency = True) diff --git a/examples/pybind11/BUILD.bazel b/examples/pybind11/BUILD.bazel deleted file mode 100644 index 74a49fd6..00000000 --- a/examples/pybind11/BUILD.bazel +++ /dev/null @@ -1,19 +0,0 @@ -load("@aspect_rules_py//py:defs.bzl", "py_library", "py_test") -load("@pybind11_bazel//:build_defs.bzl", "pybind_extension") - -pybind_extension( - name = "basic", - srcs = ["basic.cpp"], -) - -py_library( - name = "basic_lib", - data = [":basic"], - imports = ["."], -) - -py_test( - name = "basic_test", - srcs = ["basic_test.py"], - deps = [":basic_lib"], -) diff --git a/examples/pybind11/basic.cpp b/examples/pybind11/basic.cpp deleted file mode 100644 index 4996ac37..00000000 --- a/examples/pybind11/basic.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include - -int add(int i, int j) { - return i + j; -} - -PYBIND11_MODULE(basic, module) { - module.doc() = "A basic pybind11 extension"; - module.def("add", &add, "A function that adds two numbers"); -} diff --git a/examples/pybind11/basic_test.py b/examples/pybind11/basic_test.py deleted file mode 100644 index 0a1f15ad..00000000 --- a/examples/pybind11/basic_test.py +++ /dev/null @@ -1,14 +0,0 @@ -import unittest - -import basic - - -class TestBasic(unittest.TestCase): - - def test_add(self): - self.assertEqual(basic.add(1, 2), 3) - self.assertEqual(basic.add(2, 2), 4) - - -if __name__ == "__main__": - unittest.main()