-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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: Use print() function on both Python 2 and 3 #24486
Conversation
Is there any chance of the GYP patches being upstreamed? If not, it would be great to finally do the thing where we pull changes from our own fork of it… |
@addaleax Working on that in parallel. It would be a lot easier is we pip installed our Python dependencies instead of vendoring them in. |
6651436
to
d0b33fb
Compare
@nodejs/python |
@cclauss thank you for making it easier to review. |
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.
Should exclude tools/GYP
and tools/inspector_protocol
P.S. I'm self-assigned this so I'll get notifications from Github, and so that I will not lose track of it and help steward it to completion. |
d0b33fb
to
4021ecd
Compare
@@ -1,3 +1,4 @@ | |||
from __future__ import print_function |
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.
Nit: This would be better if it followed the copyright notice.
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 isn't our code. It should be patched upstream at https://chromium.googlesource.com/deps/inspector_protocol/
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.
Ah, okay. Sure, this has to be updated in upstream then.
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.
@cclauss Sorry I didn't notice this before.
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.
I will remove inspector_protocol from this PR.
However this opens up a can of worms that I do not have a solution for. Chromium in general and v8 specifically are not on GitHub. Their GitHub mirror does not accept pull requests. The v8 repo is just 1.4% Python but that is all legacy Python and at least 76 files need to be modified just to fix the print statement which is merely the start of a Python 3 port. v8 is a venerable codebase and I often hear that it was a godsend to the JavaScript community but its Python code needs to be modernized, removed, or replaced with JavaScript, Go, etc. 407 days until Python 2 end of life. @hugovk your expert advise here please.
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.
So they do accept PRs (which they call CLs) you just need to do it their way:
https://v8.dev/docs/contribute
As for inspector_protocol
it's a sub project so submitting patches should be simpler.
/cc @aslushnikov @ak239
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.
As for inspector_protocol it's a sub project so submitting patches should be simpler.
It's quite similar for both v8 and inspector-protocol.
For the inspector-protocol, check out these links:
@srl295 where do the python scripts in |
@cclauss from the Node.js perspective, IMHO our first goal is to get the main build@test (a.k.a CI) workflow compatible with python3. |
Sounds like a good plan. |
CI: https://ci.nodejs.org/job/node-test-pull-request/18805/ Reviewers please consider this for fast-tracking by 👍 . |
ack. |
Should I break this into seven separate PRs to make it easier to review? |
PR-URL: #24486 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
PR-URL: #24486 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
While running the test suite the progress bar shows former line endings if the new line is shorter than the former line. The length was calculated without the line ending. It is now an empty string to prevent the off by one error instead of using extra whitespace. PR-URL: #24748 Refs: #24486 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>
While running the test suite the progress bar shows former line endings if the new line is shorter than the former line. The length was calculated without the line ending. It is now an empty string to prevent the off by one error instead of using extra whitespace. PR-URL: #24748 Refs: #24486 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>
@refack sorry :( yes, they are 'our own'. I wrote them origianlly to be part of ICU, but the python scripts should be considered part of node. Incidentally, ICU itself will require python for build-from-repo (not from tarball). At this point it will require python 2.7 or 3. |
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.
I really thought I +1'ed a similar change here. but anyway, post merge LGTM. There's no need to upstream ICU's .py files at this point.
@srl295 Thanks for confirming 🙂 |
But on this point ICU as of 2 days ago does actually have its own slicer— please see #25136 and comment on the upstream design. This would replace node's special code (and it runs on python 2.7 and 3). |
PR-URL: nodejs#24486 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
While running the test suite the progress bar shows former line endings if the new line is shorter than the former line. The length was calculated without the line ending. It is now an empty string to prevent the off by one error instead of using extra whitespace. PR-URL: nodejs#24748 Refs: nodejs#24486 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>
PR-URL: nodejs#24748 Refs: nodejs#24486 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>
PR-URL: #24486 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
While running the test suite the progress bar shows former line endings if the new line is shorter than the former line. The length was calculated without the line ending. It is now an empty string to prevent the off by one error instead of using extra whitespace. PR-URL: #24748 Refs: #24486 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>
PR-URL: #24486 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
While running the test suite the progress bar shows former line endings if the new line is shorter than the former line. The length was calculated without the line ending. It is now an empty string to prevent the off by one error instead of using extra whitespace. PR-URL: #24748 Refs: #24486 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>
PR-URL: nodejs#24486 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> (cherry picked from commit b507783)
A subset of #23669 to simplify the review process. @refack @addaleax
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes