diff --git a/BUILD.bazel b/BUILD.bazel index 6152b57..26c7f5b 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -16,6 +16,6 @@ load("@python_versions//3.12:defs.bzl", compile_pip_requirements_3_12 = "compile compile_pip_requirements_3_12( name = "requirements_3_12", - src = "requirements.in", + src = "requirements_3_12.in", requirements_txt = "requirements_lock_3_12.txt", ) diff --git a/MODULE.bazel b/MODULE.bazel index a3e0623..26e3224 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -32,11 +32,15 @@ python.toolchain(python_version = "3.12") use_repo(python, "python_3_12", "python_versions", "pythons_hub") pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") + +# The requirements_lock_3_12.txt file is auto-generated from requirements_3_12.in and statically checked in. +# To regenerate it, run `bazel run //:requirements_3_12.update`. pip.parse( - download_only = True, - hub_name = "pypi", + # Hub names must be unique across Bazel modules. To avoid problems when integrating + # this module with others, namespace the hub name using the git repo name. + hub_name = "bedrock-rtl-pypi", # We need to use the same version here as in the `python.toolchain` call. python_version = "3.12", requirements_lock = "//:requirements_lock_3_12.txt", ) -use_repo(pip, "pypi") +use_repo(pip, "bedrock-rtl-pypi") diff --git a/python/eccgen/BUILD.bazel b/python/eccgen/BUILD.bazel index c6e255d..1dc25ac 100644 --- a/python/eccgen/BUILD.bazel +++ b/python/eccgen/BUILD.bazel @@ -19,7 +19,7 @@ package(default_visibility = ["//visibility:public"]) py_library( name = "hsiao_secded", srcs = ["hsiao_secded.py"], - deps = ["@pypi//numpy:pkg"], + deps = ["@bedrock-rtl-pypi//numpy:pkg"], ) py_binary( @@ -31,7 +31,7 @@ py_binary( ], deps = [ ":hsiao_secded", - "@pypi//jinja2:pkg", + "@bedrock-rtl-pypi//jinja2:pkg", ], ) @@ -40,7 +40,7 @@ py_test( srcs = ["hsiao_secded_test.py"], deps = [ ":hsiao_secded", - "@pypi//numpy:pkg", - "@pypi//parameterized:pkg", + "@bedrock-rtl-pypi//numpy:pkg", + "@bedrock-rtl-pypi//parameterized:pkg", ], ) diff --git a/requirements.in b/requirements_3_12.in similarity index 100% rename from requirements.in rename to requirements_3_12.in diff --git a/requirements_lock_3_12.txt b/requirements_lock_3_12.txt index 700f5e5..0ced9a0 100644 --- a/requirements_lock_3_12.txt +++ b/requirements_lock_3_12.txt @@ -7,7 +7,7 @@ jinja2==3.1.4 \ --hash=sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369 \ --hash=sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d - # via -r requirements.in + # via -r requirements_3_12.in markupsafe==3.0.2 \ --hash=sha256:0bff5e0ae4ef2e1ae4fdf2dfd5b76c75e5c2fa4132d05fc1b0dabcd20c7e28c4 \ --hash=sha256:0f4ca02bea9a23221c0182836703cbf8930c5e9454bacce27e767509fa286a30 \ @@ -127,8 +127,8 @@ numpy==2.1.3 \ --hash=sha256:f55ba01150f52b1027829b50d70ef1dafd9821ea82905b63936668403c3b471e \ --hash=sha256:f653490b33e9c3a4c1c01d41bc2aef08f9475af51146e4a7710c450cf9761598 \ --hash=sha256:fa2d1337dc61c8dc417fbccf20f6d1e139896a30721b7f1e832b2bb6ef4eb6c4 - # via -r requirements.in + # via -r requirements_3_12.in parameterized==0.9.0 \ --hash=sha256:4e0758e3d41bea3bbd05ec14fc2c24736723f243b28d702081aef438c9372b1b \ --hash=sha256:7fc905272cefa4f364c1a3429cbbe9c0f98b793988efb5bf90aac80f08db09b1 - # via -r requirements.in + # via -r requirements_3_12.in