Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions doc/source/hacking/grpc_protocols.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,9 @@ git repository to avoid depending on grpcio-tools for user installations.
Regenerating code
~~~~~~~~~~~~~~~~~
When ``.proto`` files are modified, the corresponding Python code needs to
be regenerated. As a prerequisite for code generation you need to install
``grpcio-tools`` using pip or some other mechanism::
be regenerated::

pip3 install --user grpcio-tools
tox -e build-grpc

To actually regenerate the code::

./setup.py build_grpc

The ``requirements/requirements.in`` file needs to be updated to match the
protobuf version requirements of the ``grpcio-tools`` version used to
generate the code.
This installs the correct version of ``grpcio-tools`` and regenerates the
protobuf and grpc code.
2 changes: 1 addition & 1 deletion requirements/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Jinja2 >= 2.10
importlib_metadata >= 3.6; python_version < "3.10"
packaging
pluginbase
protobuf <6.0dev,>=5.29
protobuf <9,>=5.29
psutil
ruamel.yaml >= 0.16.7
ruamel.yaml.clib >= 0.1.2
Expand Down
6 changes: 0 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,6 @@ def run(self):
with open(path, "w", encoding="utf-8") as f:
f.write(code)

print(
"\n"
"NOTE: Please update requirements/requirements.in to match the protobuf\n"
"requirement in the grpcio-tools version you used."
)


def get_cmdclass():
cmdclass = {
Expand Down
11 changes: 11 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,14 @@ deps =
# installed by the base environment.
[testenv:.package]
deps =


#
# Regenerate protobuf and grpc code
#
[testenv:build-grpc]
skip_install = True
commands = python setup.py build_grpc
deps =
grpcio-tools==1.69.0 # Requires protobuf >= 5.29
Cython
Loading