Add Bazel extension to expose transitive dependencies via setup.bzl #110
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a Bazel module extension that allows downstream consumers to access transitive dependencies without explicitly declaring them in their
MODULE.bazel
files, following best practices for reusable Bazel modules.Problem
Currently, downstream projects using
score_docs_as_code
must manually declare:in their
MODULE.bazel
, even though it's only used indirectly by macros from this module. This violates the principle of encapsulated, reusable modules and puts an unnecessary burden on consumers.Solution
Added a
setup.bzl
module extension that exposes transitive dependencies:New Files:
setup/setup.bzl
- Module extension implementationsetup/BUILD
- Build file for the setup directoryexamples/test-extension/
- Example demonstrating usageVERIFICATION.md
- Testing and verification stepsUsage Pattern:
Before (required manual dependency declaration):
After (automatic via extension):
Benefits
MODULE.bazel
filesDocumentation
Updated documentation in:
README.md
- Main usage documentationexamples/README.md
- Extended examples with setup extension usageexamples/test-extension/
The solution allows downstream projects to use the
docs()
macro and utilities likescore_py_pytest
andscore_virtualenv
without manually declaring transitive dependencies.Fixes #109.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
releases.bazel.build
/usr/local/lib/node_modules/@bazel/bazelisk/bazelisk-linux_amd64 test //src/extensions/score_source_code_linker:score_source_code_linker_test
(dns block)./bazelisk version
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.