blob: f830d44c6622b81eee0c9a3b6ed72d6bcedfd030 [file] [log] [blame]
diff --git a/BUILD.bazel b/BUILD.bazel
index dc694c922..2b906e751 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -3,6 +3,8 @@
# Most useful is the pyx_library rule from //Tools:rules.bzl
# which mirrors py_library but compiles .pyx files.
+load("@rules_python//python:defs.bzl", "py_binary", "py_library")
+
py_library(
name = "cython_lib",
srcs = glob(
@@ -26,9 +28,15 @@ py_binary(
deps = ["cython_lib"],
)
+# May not be named "cython", since that conflicts with Cython/ on OSX
py_binary(
- name = "cython",
+ name = "cython_binary",
srcs = ["cython.py"],
+ main = "cython.py",
visibility = ["//visibility:public"],
deps = ["cython_lib"],
)
+alias(
+ name = "cython",
+ actual = ":cython_binary",
+)
diff --git a/MODULE.bazel b/MODULE.bazel
new file mode 100644
index 000000000..7626dc057
--- /dev/null
+++ b/MODULE.bazel
@@ -0,0 +1,25 @@
+module(
+ name = "cython",
+ version = "3.0.11-1",
+)
+
+bazel_dep(name = "rules_python", version = "0.37.1")
+
+PYTHON_VERSIONS = [
+ "3.8",
+ "3.9",
+ "3.10",
+ "3.11",
+ "3.12",
+ "3.13",
+]
+
+python = use_extension("@rules_python//python/extensions:python.bzl", "python")
+
+[
+ python.toolchain(
+ is_default = python_version == PYTHON_VERSIONS[-1],
+ python_version = python_version,
+ )
+ for python_version in PYTHON_VERSIONS
+]