title: How do I generate python grpc code from within a setuptools installer (setup.py)?
body: <p>We have some proto files for gRPC in a repo and I read that it is not good to commit generated code. So I figured I need to have the generation as part of the package installation (e.g. setuptools, setup.py)</p>
  
  <p>However, to generate gRPC code, you need to first install the package by running <code>pip install grpcio-tools</code> according to <a href="https://grpc.io/docs/tutorials/basic/python.html" rel="noreferrer">the docs</a>. But the purpose of setup.py is to automatically pull down dependencies like <em>grpcio-tools</em>.</p>
  
  <p>So is there a best-practice for doing this? As in, how to generate code that depends on another python package from within setuptools? Am I better off just create a separate <code>build.sh</code> script that manually pip-installs and generates the code? Or should I expect users of the package to already have <em>grpcio-tools</em> installed?</p>