https://pantsbuild.org/ logo
#general
Title
# general
l

lively-king-98806

09/12/2022, 9:01 PM
What’s the correct way to handle tooling from pip. We use betterproto and they release a
betterpoto[compiler]
which is a protoc_gen plugin that needs to be installed to generate protobuf files with grpcio-tools. Are plugins the expected route here?
h

high-yak-85899

09/13/2022, 12:03 AM
I'm confused by the question. Are you asking if it's okay to specify things like
<package_name>[<optional_dependencies>]
in a requirements file?
l

lively-king-98806

09/13/2022, 1:05 PM
Hey @rough-vase-83553. Sorry, I think I figured it out.
betterproto[compiler]
would install a
protoc-gen-python_betterproto
script which would not work due to missing dependencies (black and markupsafe). Adding those as dependencies fixed the issue.
It does pollute the virtualenv with those requirements that aren’t needed outside of compiling protobufs though. It would seem that creating a plugin might solve that issue but I’m not sure how big of an issue it really is