-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finish adding types to rosidl_parser
#832
base: rolling
Are you sure you want to change the base?
Conversation
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
@@ -108,7 +108,7 @@ | |||
BooleanValue = Literal['boolean'] | |||
OctetValue = Literal['octet'] | |||
|
|||
SignedExplicitIntegerTypeValues = Literal['int8', 'int16', 'int32' 'int64'] | |||
SignedExplicitIntegerTypeValues = Literal['int8', 'int16', 'int32', 'int64'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sneaky! Nice catch
if isinstance(t, Token): | ||
if token_type is None or t.type == token_type: | ||
return t | ||
return True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is another nice catch!
Pulls: #832 |
|
||
from lark import Lark | ||
from lark.lexer import Token | ||
from lark.tree import Branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like RHEL CI is failing with:
10:30:30 Traceback (most recent call last):
10:30:30 File "/home/jenkins-agent/workspace/ci_linux-rhel/ws/install/rosidl_generator_type_description/lib/rosidl_generator_type_description/rosidl_generator_type_description", line 21, in <module>
10:30:30 from rosidl_generator_type_description import generate_type_hash
10:30:30 File "/home/jenkins-agent/workspace/ci_linux-rhel/ws/install/rosidl_generator_type_description/lib/python3.9/site-packages/rosidl_generator_type_description/__init__.py", line 24, in <module>
10:30:30 from rosidl_parser.parser import parse_idl_file
10:30:30 File "/home/jenkins-agent/workspace/ci_linux-rhel/ws/install/rosidl_parser/lib/python3.9/site-packages/rosidl_parser/parser.py", line 30, in <module>
10:30:30 from lark.tree import Branch
10:30:30 ImportError: cannot import name 'Branch' from 'lark.tree' (/usr/lib/python3.9/site-packages/lark/tree.py)
Probably RHEL has a version of Lark that's older than this commit: lark-parser/lark@acf2a26
I suggest making this a try/except ImportError
where this file defines Branch
if it can't be imported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I added the try/except
.
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Moved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm with green CI. (including a couple of bug fixes!)
Signed-off-by: Michael Carlstrom <[email protected]>
I removed the try/except and just left the copied the definitions since the Mypy running on |
Signed-off-by: Michael Carlstrom <[email protected]>
Pulls: #832 |
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
@Mergifyio update |
☑️ Nothing to do
|
Pulls: #832 |
Has to add lots of None checks inside the code. So if possible run the CI with downstream to make sure I didn't make a mistake anywhere.