From 75a74f235e60f7468cc0e196785afcda6d743127 Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Mon, 17 Feb 2025 17:00:08 +0530 Subject: [PATCH] mgr/dashboard: tox command to generate the nvmeof proto files `tox -e gen-nvmeof-proto` to generate the tox files Fixes: https://tracker.ceph.com/issues/69995 Signed-off-by: Nizamudeen A --- src/pybind/mgr/dashboard/tox.ini | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/pybind/mgr/dashboard/tox.ini b/src/pybind/mgr/dashboard/tox.ini index fdb2dd75809..d92d763fdad 100644 --- a/src/pybind/mgr/dashboard/tox.ini +++ b/src/pybind/mgr/dashboard/tox.ini @@ -161,6 +161,7 @@ description = deps = {[base]deps} {[base-test]deps} +depends = gen-nvmeof-proto passenv = PYTHONPATH setenv = @@ -177,3 +178,13 @@ description = Generate Sphinx documentation from OpenAPI specification deps = -r../../../../admin/doc-requirements.txt changedir = ../../../../doc commands = sphinx-build -W -b html -c . -D suppress_warnings=ref.* -d {envtmpdir}/doctrees mgr/ceph_api {envtmpdir}/html + +[testenv:gen-nvmeof-proto] +allowlist_externals = cp +changedir = ../ +description = Generate Python code from Protobuf files for nvmeof gateway +sitepackages = true +commands_pre = cp ../../nvmeof/gateway/control/proto/gateway.proto dashboard/services/proto/ +commands = + python -c "import grpc; print(f'using grpc version: {grpc.__version__}')" + python -m grpc_tools.protoc --proto_path=. --python_out=. --grpc_python_out=. dashboard/services/proto/gateway.proto --experimental_allow_proto3_optional -- 2.39.5