-
-
Notifications
You must be signed in to change notification settings - Fork 603
feat(gazelle): Add type-checking only dependencies to pyi_deps #3014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dougthor42
merged 11 commits into
bazel-contrib:main
from
amartani:martani/gazelle-pyi-deps
Jun 26, 2025
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
41297f8
gazelle: Add support for generating pyi_deps
amartani 38dcd59
Add directive gazelle:python_generate_pyi_deps
amartani 5479ea6
Revert changes to target.go and simplify resolve.go
amartani 8208696
Adjust README for add_type_stub_packages
amartani 9f3f1c8
Include boto3-stubs in gazelle_python.yaml on type_checking_imports test
amartani b528dd8
Add tests for project / package mode; make the exported treesets dete…
amartani cdf413c
Use addModuleToTreeSet
amartani d0c0cb0
Merge remote-tracking branch 'origin/main' into martani/gazelle-pyi-deps
amartani e99a535
Merge added sections of the changelog
amartani 80d215f
Remove resolvedPyiDepsKey (unused)
amartani e782528
Merge branch 'main' into martani/gazelle-pyi-deps
dougthor42 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# gazelle:python_generate_pyi_deps true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
load("@rules_python//python:defs.bzl", "py_binary") | ||
|
||
# gazelle:python_generate_pyi_deps true | ||
|
||
py_binary( | ||
name = "add_type_stub_packages_bin", | ||
srcs = ["__main__.py"], | ||
main = "__main__.py", | ||
pyi_deps = [ | ||
"@gazelle_python_test//boto3_stubs", | ||
"@gazelle_python_test//django_types", | ||
], | ||
visibility = ["//:__subpackages__"], | ||
deps = [ | ||
"@gazelle_python_test//boto3", | ||
"@gazelle_python_test//boto3_stubs", | ||
"@gazelle_python_test//django", | ||
"@gazelle_python_test//django_types", | ||
], | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Add stubs to `deps` of `py_library` target | ||
|
||
This test case asserts that | ||
* if a package has the corresponding stub available, it is added to the `deps` of the `py_library` target. | ||
This test case asserts that | ||
* if a package has the corresponding stub available, it is added to the `pyi_deps` of the `py_library` target. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# gazelle:python_generation_mode file | ||
dougthor42 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# gazelle:python_generate_pyi_deps true |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.