Closed georgasa closed 3 years ago
Hi @georgasa I think you found a legit bug. I've fixed in the linked commit. The unit tests cover most of the code, but not an e2e scenario, which would use click
. I'll add a test that should prevent bugs like this happening again.
Should be working now @georgasa , can you please pip install -U protobuf-uml-diagram
and test it again? It should install 0.7.
something goes wrong with the fullname, although it is supposed to be an optional filed.
I think I started with that idea, but due to lack of time I implemented only the full name in the diagrams, without making it an optional configuration.
Cheers Bruno
Hello Bruno,
thank a lot for your prompt reaction. I would like to have some assistance on how to use your tool. Attached the example proto file and the generated file from protoc-gen-go compiler: greetpb.zip
when I'm running the protobuf-uml-diagram. I'm getting the following error:
root@eeslave-43-spiderman-ft-node:~/protobuf-uml-diagram-0.6$ :) $ protobuf-uml-diagram --proto greet.pb.go --output /root/
Traceback (most recent call last):
File "/usr/local/bin/protobuf-uml-diagram", line 8, in
What am I doing wrong?
Thank you, Apostolos
Hi Apostolos,
What am I doing wrong?
Not much, I would blame the poor documentation, or not being very explicit on how this library works. So sorry.
I created protobuf-uml-diagram
to add the diagram to the docs of a Python project. I used the Python protobuf
module, which reads compiled $file.proto
Python modules.
Here's your diagram:
To create it, I did the following:
protoc greet.proto --python_out=.
which creates the Python module greet_pb2.py
PYTHONPATH=. protobuf-uml-diagram --proto greet_pb2 --output=.
Thinking now, I am wondering if the Python protobuf
port has a programmatic way to run protoc
. If so, then the input of the command could be either a protobuf Python module, or a protobuf definition .proto
file.
Not sure if that's what you were looking for?
Cheers Bruno
The picture is much clearer now (thank you Bruno). However I still can't reach the desired target (which actually is the picture you sent me!):
[root@eeslave-43-spiderman-ft-node ~]# PYTHONPATH=. protobuf-uml-diagram --proto greeting_pb2 --output=.
Traceback (most recent call last):
File "/usr/bin/protobuf-uml-diagram", line 11, in
Attached the proto and the compiled proto. proto.zip
Thanks, Apostolos
Also in a pure python3 environment there're some other issues:
[root@tankovic protobuf-uml-diagram]# python3 protobuf_uml_diagram.py --proto proto/greet_pb2 --output=.
Traceback (most recent call last):
File "protobuf_uml_diagram.py", line 28, in pip3 install --user
instead.
Requirement already satisfied: google in /usr/local/lib/python3.6/site-packages
Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python3.6/site-packages (from google)
Requirement already satisfied: soupsieve>1.2; python_version >= "3.0" in /usr/local/lib/python3.6/site-packages (from beautifulsoup4->google)
Hi @georgasa
The picture is much clearer now (thank you Bruno). However I still can't reach the desired target (which actually is the picture you sent me!):
We will get there!
Also in a pure python3 environment there're some other issues:
Was going to say we needed Python 3, but looks like you are on it now.
ModuleNotFoundError: No module named 'google'
The google
module that it is complaining is protobuf
. They use something called namespace packages (PEP-420), where google
is the top level package, with several sub-modules, like google.protobuf
.
From your error traceback it looks like you are now using Python 3.6. The namespaces were added in 3.3, so it should work fine. Did you install the latest version with pip
? It is supposed to install protobuf
too.
Could you try these commands and see if they provide any clue, please?
# it should the location of the installed script, confirm it's in Python 3.6 modules directory (it has 3.6 somewhere in the name I guess?)
$ which protobuf-uml-diagram
# this command should list all your python modules available using pip/setuptools; confirm protobuf-uml-diagram is there, and check if location is similar to the location from command above
$ pip list
# just to check nothing is wrong with your environment, it should just say "No broken requirements found."
$ pip check
I created a totally new, fresh CentOS-8 VM with python 3.9.0 and everything now works as a charm! Many many thanks for your precious help Bruno!
Regards, Apostolos
Really glad it worked Apostolos. Thanks for your patience!
Hello,
I'm constantly get the following error:
root@eeslave-43-spiderman-ft-node:~/protobuf-uml-diagram-0.6 :( $ protobuf-uml-diagram --proto greeting.proto --output /root/ Traceback (most recent call last): File "/usr/local/bin/protobuf-uml-diagram", line 11, in
load_entry_point('protobuf-uml-diagram', 'console_scripts', 'protobuf-uml-diagram')()
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in call
return self.main(args, kwargs)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, ctx.params)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(args, **kwargs)
TypeError: main() got an unexpected keyword argument 'fullname'
root@eeslave-43-spiderman-ft-node:~/protobuf-uml-diagram-0.6 :( $ protobuf-uml-diagram --proto greeting.proto --output /root/ --fullname tolis Traceback (most recent call last): File "/usr/local/bin/protobuf-uml-diagram", line 11, in
load_entry_point('protobuf-uml-diagram', 'console_scripts', 'protobuf-uml-diagram')()
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in call
return self.main(args, kwargs)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, ctx.params)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(args, **kwargs)
TypeError: main() got an unexpected keyword argument 'fullname'
something goes wrong with the fullname, although it is supposed to be an optional filed.
Thank you