-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
tools: python3 compat for inspector code generator #29340
Conversation
Should we upstream this? |
@targos I'm unclear on whether tools/inspector_protocol is an upstream dependency or not. We pull done upstream changes but we also have numerous local changes according to the history. |
There's another code generator in |
Nice! Elegant. If we are only using one version of code_generator.py then my preference be to leave the other one untouched so that we can keep an accurate track of our real dependencies as discussed at #29196 (comment) |
I believe the other one is also used so it's going to need the same fixes. As to why there are two (they're very similar), I don't know. |
We seem to have lots of redundant dependencies because we vendor-in and not pip install. Like the conversation at #28555 (comment) |
EDIT: Forgive the above... I was mistaken. I did prove that it is the deps file that we want to modify and not the tools file. Thus #29346 |
One of the things #22680 proposed was to remove one of the two copies of the build files for the inspector protocol but it was argued against by the V8 inspector folks. |
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.
Change deps/v8/third_party/inspector_protocol/code_generator.py instead of and tools/inspector_protocol/code_generator.py.
Both code generators are in use. The changes to the one in deps/ need to be upstreamed first however. |
Minor (conventional) preference for async_ instead of _async https://dbader.org/blog/meaning-of-underscores-in-python |
I opened https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/1781351 upstream. |
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.
Please modify this code to be aligned with the changes made in response to comments on https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/1781351
f9b635f
to
c83ad6b
Compare
@cclaus Done. |
The code generator takes a dict and turns it into a namedtuple. The dict contains the key "async", which is a keyword in python 3.7, and rejected by the namedtuple constructor. Rename it to "async_" to avoid the clash. Fixes: nodejs#29326
c83ad6b
to
b2d25ce
Compare
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 looks great and aligns with the changes that have now landed upstream:
https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/1781351
This file also exists at deps/v8/third_party/inspector_protocol/code_generator.py so we also need to update that file before we can close #29326
Original commit message: Make code generator python3.7 compatible (async keyword). Change-Id: Ifcd8b8cb1de60a007c7bbd4564d7869e83cb7109 Fixes: nodejs#29548 Refs: - nodejs#29548 (comment) - nodejs#29520 - nodejs#29340 - https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/1781351 - https://chromium.googlesource.com/deps/inspector_protocol/+/35c6d4d0d80b42d81bd00bcb1eb2b1093c80ed0a
Original commit message: Make code generator python3.7 compatible (async keyword). Change-Id: Ifcd8b8cb1de60a007c7bbd4564d7869e83cb7109 Fixes: #29548 Refs: - #29548 (comment) - #29520 - #29340 - https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/1781351 - https://chromium.googlesource.com/deps/inspector_protocol/+/35c6d4d0d80b42d81bd00bcb1eb2b1093c80ed0a PR-URL: #29585 Refs: #29520 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
The code generator takes a dict and turns it into a namedtuple. The dict contains the key "async", which is a keyword in python 3.7, and rejected by the namedtuple constructor. Rename it to "async_" to avoid the clash. Fixes: #29326 PR-URL: #29340 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Original commit message: Make code generator python3.7 compatible (async keyword). Change-Id: Ifcd8b8cb1de60a007c7bbd4564d7869e83cb7109 Fixes: #29548 Refs: - #29548 (comment) - #29520 - #29340 - https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/1781351 - https://chromium.googlesource.com/deps/inspector_protocol/+/35c6d4d0d80b42d81bd00bcb1eb2b1093c80ed0a PR-URL: #29585 Refs: #29520 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
The code generator takes a dict and turns it into a namedtuple. The dict contains the key "async", which is a keyword in python 3.7, and rejected by the namedtuple constructor. Rename it to "async_" to avoid the clash. Fixes: #29326 PR-URL: #29340 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Original commit message: Make code generator python3.7 compatible (async keyword). Change-Id: Ifcd8b8cb1de60a007c7bbd4564d7869e83cb7109 Fixes: #29548 Refs: - #29548 (comment) - #29520 - #29340 - https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/1781351 - https://chromium.googlesource.com/deps/inspector_protocol/+/35c6d4d0d80b42d81bd00bcb1eb2b1093c80ed0a PR-URL: #29585 Refs: #29520 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Original commit message: Make code generator python3.7 compatible (async keyword). Change-Id: Ifcd8b8cb1de60a007c7bbd4564d7869e83cb7109 Fixes: nodejs#29548 Refs: - nodejs#29548 (comment) - nodejs#29520 - nodejs#29340 - https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/1781351 - https://chromium.googlesource.com/deps/inspector_protocol/+/35c6d4d0d80b42d81bd00bcb1eb2b1093c80ed0a PR-URL: nodejs#29585 Refs: nodejs#29520 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Original commit message: Make code generator python3.7 compatible (async keyword). Change-Id: Ifcd8b8cb1de60a007c7bbd4564d7869e83cb7109 Fixes: nodejs#29548 Refs: - nodejs#29548 (comment) - nodejs#29520 - nodejs#29340 - https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/1781351 - https://chromium.googlesource.com/deps/inspector_protocol/+/35c6d4d0d80b42d81bd00bcb1eb2b1093c80ed0a PR-URL: nodejs#29585 Refs: nodejs#29520 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Original commit message: Make code generator python3.7 compatible (async keyword). Change-Id: Ifcd8b8cb1de60a007c7bbd4564d7869e83cb7109 Fixes: #29548 Refs: - #29548 (comment) - #29520 - #29340 - https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/1781351 - https://chromium.googlesource.com/deps/inspector_protocol/+/35c6d4d0d80b42d81bd00bcb1eb2b1093c80ed0a PR-URL: #29585 Refs: #29520 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Original commit message: Make code generator python3.7 compatible (async keyword). Change-Id: Ifcd8b8cb1de60a007c7bbd4564d7869e83cb7109 Fixes: nodejs#29548 Refs: - nodejs#29548 (comment) - nodejs#29520 - nodejs#29340 - https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/1781351 - https://chromium.googlesource.com/deps/inspector_protocol/+/35c6d4d0d80b42d81bd00bcb1eb2b1093c80ed0a PR-URL: nodejs#29585 Refs: nodejs#29520 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Original commit message: Make code generator python3.7 compatible (async keyword). Change-Id: Ifcd8b8cb1de60a007c7bbd4564d7869e83cb7109 Fixes: nodejs#29548 Refs: - nodejs#29548 (comment) - nodejs#29520 - nodejs#29340 - https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/1781351 - https://chromium.googlesource.com/deps/inspector_protocol/+/35c6d4d0d80b42d81bd00bcb1eb2b1093c80ed0a PR-URL: nodejs#29585 Refs: nodejs#29520 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Original commit message: Make code generator python3.7 compatible (async keyword). Change-Id: Ifcd8b8cb1de60a007c7bbd4564d7869e83cb7109 Fixes: nodejs#29548 Refs: - nodejs#29548 (comment) - nodejs#29520 - nodejs#29340 - https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/1781351 - https://chromium.googlesource.com/deps/inspector_protocol/+/35c6d4d0d80b42d81bd00bcb1eb2b1093c80ed0a PR-URL: nodejs#29585 Refs: nodejs#29520 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Original commit message: Make code generator python3.7 compatible (async keyword). Change-Id: Ifcd8b8cb1de60a007c7bbd4564d7869e83cb7109 Fixes: #29548 Refs: - #29548 (comment) - #29520 - #29340 - https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/1781351 - https://chromium.googlesource.com/deps/inspector_protocol/+/35c6d4d0d80b42d81bd00bcb1eb2b1093c80ed0a Backport-PR-URL: #30109 PR-URL: #29585 Refs: #29520 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Original commit message: Make code generator python3.7 compatible (async keyword). Change-Id: Ifcd8b8cb1de60a007c7bbd4564d7869e83cb7109 Fixes: #29548 Refs: - #29548 (comment) - #29520 - #29340 - https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/1781351 - https://chromium.googlesource.com/deps/inspector_protocol/+/35c6d4d0d80b42d81bd00bcb1eb2b1093c80ed0a Backport-PR-URL: #30109 PR-URL: #29585 Refs: #29520 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
The code generator takes a dict and turns it into a namedtuple. The dict
contains the key "async", which is a keyword in python 3, and rejected
by the namedtuple constructor. Rename it to "_async" to avoid the clash.