-
Notifications
You must be signed in to change notification settings - Fork 243
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
#3211 [SDL 0234] Proxy Library RPC Generation #3213
Conversation
* Split existing `InterfaceGenerator` into `InterfaceParser` and `InterfaceGenerator` * Moved InterfaceParser into `smartdevicelink/rpc_spec` * Rejoined `InterfaceParser` as `tools/rpc_spec` Git submodule from `smartdevicelink/rpc_spec` * Refactored `InterfaceGenerator` to use Parser from `tools/rpc_spec` Git submodule and be compatible with Python 3.5
@vladmu Can the python install requirements.txt command be added to cores build script? |
@JackLivio moved the python install requirements.txt to core build script as per your comment. |
@@ -12,7 +12,17 @@ | |||
import string | |||
import uuid | |||
|
|||
from generator import Model | |||
from model.array import Array |
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.
Is it possible to wrap all of the imports in a try/catch? If an error is encountered a log is printed that reminds the developer to run
git submodule init
git submodule update
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 code tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py
called from tools/InterfaceGenerator/Generator.py
, where we adding appropriate paths:
ROOT = Path(__file__).absolute().parents[1]
sys.path.append(ROOT.joinpath('rpc_spec/InterfaceParser').as_posix())
and after this imports wrapped into try/catch:
try:
...
except ModuleNotFoundError as error:
so if issue with submodule appear it will be cached in Generator.py, so there is no options that such issue appear in SmartFactoryBase.py
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.
Oh very good, thank you for the explanation.
Would it be possible to update the error message with some extra information?
Please make sure the RPC Spec Generator Submodule is initialized.
Check the sdl_core source directory in `tools/rpc_spec`.
Try running in the source directory:
$ git submodule init
$ git submodule update
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.
extra information added
.gitmodules
Outdated
@@ -0,0 +1,4 @@ | |||
[submodule "tools/rpc_spec"] | |||
path = tools/rpc_spec | |||
url = https://github.com/vladmu/rpc_spec.git |
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.
reminder to update this when merging
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.
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.
changed to:
[submodule "tools/rpc_spec"]
path = tools/rpc_spec
url = https://github.com/smartdevicelink/rpc_spec.git
branch = develop
Fixes #3211
This PR is [ready] for review.
Risk
This PR makes [no] API changes.
Testing Plan
Covered within existing unit tests and ATF tests.
Summary
This Pull Request provides changes of
InterfaceGenerator
according to the SDL-0234 proposal's requirements.Changelog
Enhancements
InterfaceGenerator
intoInterfaceParser
andInterfaceGenerator
smartdevicelink/rpc_spec
InterfaceParser
astools/rpc_spec
Git submodule fromsmartdevicelink/rpc_spec
InterfaceGenerator
to use Parser fromtools/rpc_spec
Git submodule and be compatible with Python 3.5CLA