pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.34k stars 639 forks source link

Teach Python protobuf backend that `grpcio-tools` provides `protobuf` #16603

Open dheerajramchandani opened 2 years ago

dheerajramchandani commented 2 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. E.g., It would be easier if [...] I am trying to use pants with Python and Protobuf and mentioned grpcio and grpcio-tools in my requirements.txt file. The package goal failed because it could not find protobuf in the requirements.txt. If we install grpcio-tools using pip, it resolves this dependency and installs protobuf. it would be nice if Pants was able to do that.

Describe the solution you'd like A clear and concise description of what you want to happen. I'd want Pants to auto-resolve the dependency for any packages in requirements.txt just like how pip does.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. Currently, I am explicitly mentioning the dependency I need in the 3rdparty/requirements.txt.

Additional context Add any other context or screenshots about the feature request here.

Eric-Arellano commented 2 years ago

Thanks! I tweaked the title to make this more precise what's needed. Pants usually doesn't explicitly check for certain requirements like protobuf being in your repository. That's only for codegen. So the simplest fix for this is to teach Pants that grpcio-tools satisfies the need for protobuf.