`tox -e gen-nvmeof-proto` to generate the tox files
Fixes: https://tracker.ceph.com/issues/69995
Signed-off-by: Nizamudeen A <nia@redhat.com>
deps =
{[base]deps}
{[base-test]deps}
+depends = gen-nvmeof-proto
passenv =
PYTHONPATH
setenv =
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