]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: tox command to generate the nvmeof proto files
authorNizamudeen A <nia@redhat.com>
Mon, 17 Feb 2025 11:30:08 +0000 (17:00 +0530)
committerNizamudeen A <nia@redhat.com>
Wed, 19 Feb 2025 09:33:27 +0000 (15:03 +0530)
`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>
src/pybind/mgr/dashboard/tox.ini

index fdb2dd75809908203e8a9de2967f7aa8520d8e12..d92d763fdada57bfcd60aff5e454c77c2d76a876 100644 (file)
@@ -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