build: replace optparse for argparse in configure.py#29814
build: replace optparse for argparse in configure.py#29814vccolombo wants to merge 2 commits intonodejs:masterfrom vccolombo:argparse-configurepy
Conversation
Issue #29813 suggested migrating from optparse to argparse as optparse is deprecated. This commit does the changes necessary to this migration, as suggested in https://docs.python.org/3/library/argparse.html#module-argparse Most of the work was done in PR #26725 Fixes: #29813
Probably needs someone more familiar with Python (cc @nodejs/python) but with |
|
My method of approaching this would be a separate repo to prove it all out. I would have one file that would be all the optparse stuff with as minimal changes as possible. I would have a second file that was my proposed solution using argparse. Each file would take in commandline args and print out the parsed args. Then I would have a test runner (Travis CI, GitHub Actions, CircleCI, etc.) and I would run the same set of inputs through both and see if the outputs matched. Does that make sense? |
|
As discussed at https://docs.python.org/2/library/argparse.html#argparse.Namespace try vars(args) to get a sense of what is inside. |
|
Thank you very much for your help. I need some time to try it and I'll come back after that |
|
Hello there. Really sorry for the delay. I got stuck with some stuff from college. I may need a couple of weeks to deliver something here. But I still want to work on and finish this. Hope you understand Thanks! |
|
No rush on this one given that both Python 3.8 (released yesterday) and 3.9 (1+ years away) support the deprecated module. If you are not warped up in one month then I will take a whack at it. |
|
Ping @vccolombo @cclauss |
|
Hi! I wasn't able to finish it, sorry about that. I though it would be easier when I saw the Issue, and now I'm on a new job so it's even harder to find time to tackle it. Really sorry again. Thank you for your time |
|
@vccolombo thank you for the work! |
Refs: nodejs#26725 Fixes: nodejs#29813 Refs: nodejs#29814 PR-URL: nodejs#35755 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Christian Clauss <cclauss@me.com>
Hello! I saw Issue #29813 and decided to take the challenge as my first commit to Node.
However while looking on what was done in PR #26725 I got confused about what is gyp_args and what that PR changed about it.
Currently, my PR fails when running
gyp_args += argswith errorTypeError: 'Namespace' object is not iterableCan anyone give me some help about this?
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes