Uh oh!
There was an error while loading. Please reload this page.
build: refactor configure.py - #47323
Conversation
VoltrexKeyva
commented
Mar 30, 2023
Note that the tests are failing because the |
762c432 to
14b08f7Comparerichardlau
commented
Mar 30, 2023
FWIW some previous discussion in #42186. |
VoltrexKeyva
commented
Mar 31, 2023
I'm not sure about that, we'll have to switch either way though we could make our own class/function implementing version parsing but it's too much work for the simple use cases here, so I'd say we should make the move to the |
Uh oh!
There was an error while loading. Please reload this page.
f2d5605 to
e6931deCompareThere was a problem hiding this comment.
I'm not sure about this change, the path parameter of the icu_download() function was never used (not inside the function I mean), not even from the day it was added.
But an argument to the path parameter is being passed here:
Line 1819 in 069365c
even though it's not used inside the icu_download() function, is this a mistake or was it supposed to be used?
There was a problem hiding this comment.
👍 Let's revert this change and put a # noqa here to placate the linter.
There was a problem hiding this comment.
Why should we revert this? Do you want me to make this change in a separate PR?
targos
commented
Apr 12, 2023
@nodejs/python |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
This is a legacy codebase that a lot of folks depend on so we want to keep any possible breakage to a minimum. Here are some ideas...
Also, I would like to land #47519 before we land this so we have some stronger guardrails in place.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
👍 Let's revert this change and put a # noqa here to placate the linter.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ed5706f to
89e91edCompare
This comment was marked as outdated.
This comment was marked as outdated.
edf05e6 to
ff0ff9bCompare
cclauss
left a comment
There was a problem hiding this comment.
more ideas
I know we are only changing a single file but it is a vital file and I do not know if it has enough tests... Perhaps we should introduce these changes in multiple PRs. Your thoughts on test coverage?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
dec8698 to
f3c8e7fCompare- Explicitly specify the encoding when opening files. - Use f-strings to format strings. - Use `isinstance()` for type checks instead of `type()`. - Use the `with` keyword for resource-allocating operations. - Avoid using multiple statements in a single line. - Remove unnecessary `else` clauses after `return`. - Iterate with the `items()` method of dictionaries when both the key and value are used. - Remove unnecessary parentheses. - Rename unused unpacked variables to `_`, `_1`, etc etc. - Rename the `list` variable to avoid conflict with the global `list()` function. - Remove unused `path` parameter of the `icu_download()` function. - Use the `pathlib` library for paths instead of `os.path`.
VoltrexKeyva
commented
Apr 16, 2023
I'm fine with that, should I introduce each of these changes in separate PRs to reduce review time?
Writing new tests for such build files sounds like a good idea, but I have no experience writing tests for such files 😅. |
| valid_intl_modes = ('none', 'small-icu', 'full-icu', 'system-icu') | ||
| with open ('tools/icu/icu_versions.json') as f: | ||
| icu_versions = json.load(f) | ||
| icu_versions = json.loads((tools_path / 'icu' / 'icu_versions.json').read_text()) |
There was a problem hiding this comment.
.read_text(encoding='utf-8') is also possible.
I think we should get this PR will all changes ready and with all tests passing. Then we should have a second PR that is a strict subset of these changes. We land the second PR first and then after a release and user feedback, we rebase this PR and push the remaining into the next Node release. All the pathlib changes should land separately from all other changes. Thoughts? Or am I just being too paranoid? |
VoltrexKeyva
commented
Apr 16, 2023
What changes here counts as a strict subset?
That's a good idea. |
cclauss
commented
Apr 16, 2023
The pathlib changes vs. all non-pathlib changes. |
VoltrexKeyva
commented
Apr 22, 2023
Use Python's `pathlib` library for paths and related operations instead of `os.path`. Refs: nodejs#47323 (comment)nodejs#47323 (comment)
Use Python's `pathlib` library for paths and related operations instead of `os.path`. Refs: #47323 (comment)#47323 (comment) PR-URL: #47581 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Christian Clauss <cclauss@me.com>
Use Python's `pathlib` library for paths and related operations instead of `os.path`. Refs: #47323 (comment)#47323 (comment) PR-URL: #47581 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Christian Clauss <cclauss@me.com>
Use Python's `pathlib` library for paths and related operations instead of `os.path`. Refs: #47323 (comment)#47323 (comment) PR-URL: #47581 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Christian Clauss <cclauss@me.com>
Use Python's `pathlib` library for paths and related operations instead of `os.path`. Refs: nodejs#47323 (comment)nodejs#47323 (comment) PR-URL: nodejs#47581 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Christian Clauss <cclauss@me.com>
srl295
commented
Oct 1, 2024
broke ICU downloading on windows (the 'path' argument is a URL or a file path) - see #55214 |
isinstance()for type checks instead oftype().withkeyword for resource-allocating operations.elseclauses afterreturn.items()method of dictionaries when both the key and value are used._,_1, etc etc.listvariable to avoid conflict with the globallist()function.pathparameter of theicu_download()function.pathliblibrary for paths instead ofos.path.