Skip to content

Commit

Permalink
Mark internal deps extension as reproducible
Browse files Browse the repository at this point in the history
This avoids an unnecessary lockfile entry for users of rules_python.
  • Loading branch information
fmeum committed May 12, 2024
1 parent 01ae7e7 commit f4b7e94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
3 changes: 1 addition & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module(
)

bazel_dep(name = "bazel_features", version = "1.9.1")
bazel_dep(name = "bazel_skylib", version = "1.3.0")
bazel_dep(name = "bazel_skylib", version = "1.6.1")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "platforms", version = "0.0.4")

Expand All @@ -14,7 +14,6 @@ bazel_dep(name = "rules_proto", version = "6.0.0-rc1")
bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf")

internal_deps = use_extension("//python/private/bzlmod:internal_deps.bzl", "internal_deps")
internal_deps.install()
use_repo(
internal_deps,
"rules_python_internal",
Expand Down
13 changes: 5 additions & 8 deletions python/private/bzlmod/internal_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@

"Python toolchain module extension for internal rule use"

load("@bazel_skylib//lib:modules.bzl", "modules")
load("//python/pip_install:repositories.bzl", "pip_install_dependencies")
load("//python/private:internal_config_repo.bzl", "internal_config_repo")

# buildifier: disable=unused-variable
def _internal_deps_impl(module_ctx):
def _internal_deps():
internal_config_repo(name = "rules_python_internal")
pip_install_dependencies()

internal_deps = module_extension(
doc = "This extension to register internal rules_python dependecies.",
implementation = _internal_deps_impl,
tag_classes = {
"install": tag_class(attrs = dict()),
},
internal_deps = modules.as_extension(
_internal_deps,
doc = "This extension registers internal rules_python dependencies.",
)

0 comments on commit f4b7e94

Please sign in to comment.