diff --git a/.bazelversion b/.bazelversion index 09b254e..66ce77b 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.0.0 +7.0.0 diff --git a/.gitignore b/.gitignore index 477386b..6a7fbb4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /**/*.egg-info scratch bazel-* +MODULE.bazel.lock diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 0000000..f07024e --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,12 @@ +bazel_dep(name = "bazel_skylib", version = "1.4.0") +bazel_dep(name = "rules_python", version = "0.31.0") + +pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") + +pip.parse( + hub_name = "pypi", + python_version = "3.11", + requirements_lock = "//tools/python:requirements_lock.txt", +) + +use_repo(pip, "pypi") diff --git a/WORKSPACE b/WORKSPACE deleted file mode 100644 index 3770ab1..0000000 --- a/WORKSPACE +++ /dev/null @@ -1,52 +0,0 @@ -workspace( - name = "flowmetal" -) - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "bazel_skylib", - sha256 = "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", - ], -) - -load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") - -bazel_skylib_workspace() - -rules_python_version = "c504355672223144cefb2cbf3f69e2d38e7e2726" - -http_archive( - name = "rules_python", - sha256 = "3f12b492dbf7d56b0e3deed81f21d56c3241babaa52d7eb525cb7c657bba9125", - strip_prefix = "rules_python-{}".format(rules_python_version), - url = "https://github.com/bazelbuild/rules_python/archive/{}.zip".format(rules_python_version), -) - -load("@rules_python//python:repositories.bzl", "python_register_toolchains") - -python_register_toolchains( - name = "python3_10", - python_version = "3.10", -) - -load("@python3_10//:defs.bzl", python3_10="interpreter") - -load("@rules_python//python:pip.bzl", "pip_parse") - -# Create a central repo that knows about the dependencies needed from -# requirements_lock.txt. -pip_parse( - name = "pypi", - python_interpreter_target = python3_10, - requirements_lock = "//tools/python:requirements_lock.txt", -) - -load("@pypi//:requirements.bzl", "install_deps") - -install_deps()