-
Notifications
You must be signed in to change notification settings - Fork 1.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
Fix Travis runs with Python 3 #1843
Conversation
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.
Very, very impressive! Thanks massively!
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.
lgtm.
It would be of interest to know if the Travis tests would pass on Python 3 on macOS. Please consider adding the changes from #1846 into this PR. |
test/test-find-python.js
Outdated
t.strictEqual(stdout, '') | ||
t.ok(/Python 2/.test(stderr)) | ||
t.ok(stdout === '' || stderr === '') | ||
t.ok(/Python 2/.test(stderr) || /Python 3/.test(stdout)) |
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.
Non-blocking but I think these two tests are going to be hard to debug if they fail (in the previous code if stdout
wasn't equal to ''
the contents would be included in the test failure).
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.
Would it be possible to refactor this so that if we're on Python 3, we run checks for that, which are strict and so output contents if they fail, otherwise we run stricts for Python 2?
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.
Updated, PTAL.
a7b1d46
to
5c89edb
Compare
Updated to include the macOS Travis run as discussed in #1846. @rvagg @MattIPv4 @richardlau let me know if you have any objection. |
.travis.yml
Outdated
@@ -44,6 +45,12 @@ matrix: | |||
python: 3.7 | |||
env: NODE_GYP_FORCE_PYTHON=python3 EXPERIMENTAL_NODE_GYP_PYTHON3=1 | |||
before_install: nvm install 12 | |||
- name: "Python 3.7 on macOS" | |||
os: osx | |||
osx_image: xcode11 |
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 know that I am trying your patience but... can you please do me a favor and comment out line 50. The error messages (and investigations elsewhere) suggest to me that using the current xcode11 might be part of our problem.
https://docs.travis-ci.com/user/reference/osx/#xcode-version
+No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
+No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
+gyp: No Xcode or CLT version detected!
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.
No problem. Pushed a commit just to get a Travis run, I will discard it if xcode11 is not the problem.
The Python 2 version also uses xcode11, so I don't think this will fix it. If it does, we have to understand why it's not a problem with Python 2.
It moved us from 6 failing down to 3 failing. Thanks much! This PR is a sold step forward. @gibfahn Can you provide us any guidance on these three failures which appear when Travis CI uses the current osx_image: xcode11. This PR gets Linux and Windows passing our Travis CI tests on Python 3.7 so it would be great to add macOS to that list. |
PR-URL: #1843 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Rod Vagg <r@va.gg> Reviewed-By: Matt Cowley <me@mattcowley.co.uk> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
CI: https://ci.nodejs.org/view/All/job/nodegyp-test-pull-request/153/ ✔️ Landed in 5459eca...2592036. Thanks for the reviews! @cclauss left the xcode line commented. Notice the number of passing tests is the same, so probably when a test fails we can't really consider the remaining tests in that file. For reference:
|
PR-URL: #1843 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Rod Vagg <r@va.gg> Reviewed-By: Matt Cowley <me@mattcowley.co.uk> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Refs: nodejs/node-gyp#1820 Refs: nodejs/node-gyp#1843 PR-URL: #29897 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Refs: nodejs/node-gyp#1820 Refs: nodejs/node-gyp#1843 PR-URL: #29897 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Refs: nodejs/node-gyp#1820 Refs: nodejs/node-gyp#1843 PR-URL: #29897 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Refs: nodejs/node-gyp#1820 Refs: nodejs/node-gyp#1843 PR-URL: nodejs#29897 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> (cherry picked from commit 66b9532)
Checklist
npm install && npm test
passesDescription of change
This fixes the remaining issues with
test-find-python.js
and running on Windows when using Python 3. This makes node-gyp compatible with Python 3 for everything that we run in CI (which is not that much).@cclauss the fixes here seemed logical to me, but I don't have much experience with Python, so a careful review would be very welcome.
This PR is semver-patch, using Python 3 still depends on
EXPERIMENTAL_NODE_GYP_PYTHON3
. I am preparing a different PR to address that.