Skip to content
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

Support for Python Rules that are Code Generators #6725

Open
andponlin-canva opened this issue Sep 4, 2024 · 0 comments
Open

Support for Python Rules that are Code Generators #6725

andponlin-canva opened this issue Sep 4, 2024 · 0 comments
Assignees
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: CLion CLion plugin product: GoLand GoLand plugin product: IntelliJ IntelliJ plugin product: PyCharm PyCharm plugin type: feature request

Comments

@andponlin-canva
Copy link
Contributor

andponlin-canva commented Sep 4, 2024

Description of the feature request:

Please see accompanying PR 6726.

Plugin recognizing code generators

When working with Python in Bazel, it is sometimes desirable to generate code using an Action configured from a Rule. In this situation, the Rule that configures the Action might return a PyInfo and to all intents and purposes behave as a py_library.

In the Intelli-J environment, the Rule would however not be recognized and the outputs of the Rule would not be seen as source code. This means that in logic that uses the generated code, these sources would simply be missing and would show as errors in the IDE.

It would be ideal if there were a means by which Rules could signal to the IDE that their outputs rather than their inputs (srcs attribute) supplied the sources for the Rule.

Plugin handling source supplied as a directory

Code generators are often not able to specify the precise list of output files ahead of time. This might be because the list of files is contingent on the contents of an input such as schema. For this reason the outputs from a code-generators' Rule might be a directory. In this case, The IDE is currently not able to handle a directory of Python source; it is wanting to work with files only. It would be better if the Plugin were able to work with source directories as well.

Which category does this issue belong to?

Intellij, GoLand, CLion, PyCharm

What underlying problem are you trying to solve with this feature?

At the present time when a Python Bazel Project uses the outputs of a code-generator Rule, the sources from the code generator are not recognized in the IDE and show as errors.

What operating system, Intellij IDE and programming languages are you using? Please provide specific versions.

2024.1

Have you found anything relevant by searching the web?

--

Any other information, logs, or outputs that you want to share?

--

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: CLion CLion plugin product: GoLand GoLand plugin product: IntelliJ IntelliJ plugin product: PyCharm PyCharm plugin type: feature request
Projects
None yet
Development

No branches or pull requests

4 participants