Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ http_archive(
],
)

http_archive(
name = "rules_python",
sha256 = "5868e73107a8e85d8f323806e60cad7283f34b32163ea6ff1020cf27abef6036",
strip_prefix = "rules_python-0.25.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.25.0/rules_python-0.25.0.tar.gz",
)
Comment on lines +21 to +26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and prevent future developers from accidentally re-introducing the shadowing issue, it would be beneficial to add a comment explaining why rules_python must be defined this early in the file.

Suggested change
http_archive(
name = "rules_python",
sha256 = "5868e73107a8e85d8f323806e60cad7283f34b32163ea6ff1020cf27abef6036",
strip_prefix = "rules_python-0.25.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.25.0/rules_python-0.25.0.tar.gz",
)
# Define rules_python early to ensure this version is used and not a
# different version shadowed by a transitive dependency (e.g., from gRPC).
http_archive(
name = "rules_python",
sha256 = "5868e73107a8e85d8f323806e60cad7283f34b32163ea6ff1020cf27abef6036",
strip_prefix = "rules_python-0.25.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.25.0/rules_python-0.25.0.tar.gz",
)


load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains")

rules_java_dependencies()
Expand Down Expand Up @@ -51,25 +58,20 @@ load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_

hedron_compile_commands_setup()

http_archive(
name = "rules_python",
sha256 = "c68bdc4fbec25de5b5493b8819cfc877c4ea299c0dcb15c244c5a00208cde311",
strip_prefix = "rules_python-0.31.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.31.0/rules_python-0.31.0.tar.gz",
)

load("@rules_python//python:repositories.bzl", "python_register_toolchains")

python_register_toolchains(
name = "python3_9",
python_version = "3.9",
register_toolchains = False,
ignore_root_user_error = True,
)

python_register_toolchains(
name = "python3_10",
python_version = "3.10",
register_toolchains = False,
ignore_root_user_error = True,
)

load("@python3_9//:defs.bzl", python39 = "interpreter")
Expand Down