Skip to content

Add test for python executable search logic.#756

Closed
bnoordhuis wants to merge 0 commit intonodejs:masterfrom
bnoordhuis:add-find-python-test
Closed

Add test for python executable search logic.#756
bnoordhuis wants to merge 0 commit intonodejs:masterfrom
bnoordhuis:add-find-python-test

Conversation

@bnoordhuis
Copy link
Copy Markdown
Member

Break out the search logic into a separate function and add a regression
test.

References: #668

R=@rvagg? /cc @refack

Comment thread lib/configure.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're missing the critical fix of using which's result

       python = execPath

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, yes, that's intentional. Mixing a general refactor and bug fixes in a single commit is bad style.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 got it.

@refack refack mentioned this pull request Oct 4, 2015
@bnoordhuis
Copy link
Copy Markdown
Member Author

Maybe R=@TooTallNate?

Comment thread lib/configure.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we don't have the Max length linter rule.

@bnoordhuis
Copy link
Copy Markdown
Member Author

@thefourtheye What was the verdict on this PR?

@rvagg
Copy link
Copy Markdown
Member

rvagg commented Nov 18, 2015

I don't have time right now to review this but fwiw I extracted this logic into a separate package a while back: https://github.com/rvagg/check-python and figured one day I'd come back here and PR a full replacement. The logging is the tricky bit, however.

Comment thread lib/configure.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the refactoring, failNoPython directly calls the configure's callback and brings the execution to end. But ideally it should have called findPython's callback and that should have propagated the error back to the caller of configure. This will still work but looks like it can be improved/done better to me. Please point out if I am missing something obvious.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it does, doesn't it? It calls the callback from findPython()'s arguments.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnoordhuis I am sorry. You are correct. As the change was lengthier, I was not able to view it properly I guess. LGTM.

@thefourtheye
Copy link
Copy Markdown
Contributor

LGTM with a suggestion/question.

bnoordhuis added a commit that referenced this pull request Nov 24, 2015
Break out the search logic into a separate function and add a regression
test.

References: #668
PR-URL: #756
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
@bnoordhuis bnoordhuis closed this Nov 24, 2015
@bnoordhuis bnoordhuis deleted the add-find-python-test branch November 24, 2015 14:08
@bnoordhuis
Copy link
Copy Markdown
Member Author

Landed in 817ed9b with the s/equal/strictEqual/ fix.

Koroffin pushed a commit to Koroffin/node-gyp that referenced this pull request Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants