Skip to content

feat(gazelle): enable pyi attrs by default#3753

Open
amartani wants to merge 3 commits intobazel-contrib:mainfrom
benchling:martani/update-defaults
Open

feat(gazelle): enable pyi attrs by default#3753
amartani wants to merge 3 commits intobazel-contrib:mainfrom
benchling:martani/update-defaults

Conversation

@amartani
Copy link
Copy Markdown
Contributor

@amartani amartani commented May 4, 2026

Default python_generate_pyi_deps and python_generate_pyi_srcs to true so generated targets preserve type-only dependencies and sibling stub files without extra directives. These directives have been available for many versions now, and defaulting to true better matches the intended semantics of current rules_python versions.

Write detailed docs for python_generate_pyi_deps since that was missing.

Default pyi_deps and pyi_srcs generation to true so generated targets preserve type-only dependencies and sibling stub files without extra directives.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the default settings for the Gazelle Python extension, setting both python_generate_pyi_deps and python_generate_pyi_srcs to true by default. The documentation has been expanded with detailed usage examples for these directives, and the CHANGELOG.md and configuration code have been updated to reflect these changes. I have no feedback to provide.

Copy link
Copy Markdown
Collaborator

@dougthor42 dougthor42 left a comment

Choose a reason for hiding this comment

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

Overall LGTM but I'll leave to @aignas to approve.

@aignas: Is changing the default considered a breaking change or is this fine to add in 2.1?

If I'd been paying attention more I probably would have tried to implement this myself in time for 2.0, but oh well 🙃.

Comment thread gazelle/docs/directives.md
Comment thread gazelle/docs/directives.md
amartani added 2 commits May 5, 2026 09:17
Add `:versionchanged: VERSION_NEXT_FEATURE` for `python_generate_pyi_deps`
and `python_generate_pyi_srcs` in directives documentation.
…ives

Move `:versionchanged: VERSION_NEXT_FEATURE` blocks to immediately follow
the `:versionadded:` sections for `python_generate_pyi_deps` and
`python_generate_pyi_srcs`.
@amartani
Copy link
Copy Markdown
Contributor Author

amartani commented May 5, 2026

Overall LGTM but I'll leave to @aignas to approve.

@aignas: Is changing the default considered a breaking change or is this fine to add in 2.1?

If I'd been paying attention more I probably would have tried to implement this myself in time for 2.0, but oh well 🙃.

From my read of https://rules-python.readthedocs.io/en/latest/contributing.html#breaking-changes I'd expect this change to be fine, but let me know.

@amartani amartani requested a review from dougthor42 May 5, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants