Skip to content
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

WIP: Python 3 on Linux passes Travis CI tests #1839

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 20 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,51 +28,44 @@ matrix:
PATH=/c/Python27:/c/Python27/Scripts:$PATH
NODE_GYP_FORCE_PYTHON=/c/Python27/python.exe
before_install: choco install python2
- name: "Node.js 6 & Python 3.7 on Linux"
python: 3.7
env: NODE_GYP_FORCE_PYTHON=python3 EXPERIMENTAL_NODE_GYP_PYTHON3=1
before_install: nvm install 6
- name: "Node.js 8 & Python 3.7 on Linux"
python: 3.7
env: NODE_GYP_FORCE_PYTHON=python3 EXPERIMENTAL_NODE_GYP_PYTHON3=1
before_install: nvm install 8
- name: "Node.js 10 & Python 3.7 on Linux"
python: 3.7
env: NODE_GYP_FORCE_PYTHON=python3 EXPERIMENTAL_NODE_GYP_PYTHON3=1
before_install: nvm install 10
- name: "Node.js 12 & Python 3.7 on Linux"
python: 3.7
env: NODE_GYP_FORCE_PYTHON=python3 EXPERIMENTAL_NODE_GYP_PYTHON3=1
before_install: nvm install 12
- name: "Node.js 12 & Python 3.7 on Windows"
- name: "Python 3.6 on Linux"
env: NODE_GYP_FORCE_PYTHON=python3.6 EXPERIMENTAL_NODE_GYP_PYTHON3=1
python: 3.6
- name: "Python 3.6 on macOS"
os: osx
language: cpp
env: NODE_GYP_FORCE_PYTHON=python3.6 EXPERIMENTAL_NODE_GYP_PYTHON3=1
- name: "Python 3.6 on Windows"
os: windows
language: node_js
node_js: 12 # node
language: cpp
# language: node_js
# node_js: 12 # node
env: >-
PATH=/c/Python37:/c/Python37/Scripts:$PATH
NODE_GYP_FORCE_PYTHON=/c/Python37/python.exe
PATH=/c/Python36:/c/Python36/Scripts:$PATH
NODE_GYP_FORCE_PYTHON=/c/Python36/python.exe
EXPERIMENTAL_NODE_GYP_PYTHON3=1
before_install: choco install python
before_install: choco install python --version 3.6.8
allow_failures:
- env: NODE_GYP_FORCE_PYTHON=python3 EXPERIMENTAL_NODE_GYP_PYTHON3=1
- env: NODE_GYP_FORCE_PYTHON=python3.6 EXPERIMENTAL_NODE_GYP_PYTHON3=1
- env: >-
PATH=/c/Python37:/c/Python37/Scripts:$PATH
NODE_GYP_FORCE_PYTHON=/c/Python37/python.exe
PATH=/c/Python36:/c/Python36/Scripts:$PATH
NODE_GYP_FORCE_PYTHON=/c/Python36/python.exe
EXPERIMENTAL_NODE_GYP_PYTHON3=1
install:
#- pip install -r requirements.txt
- pip install flake8 # pytest # add another testing frameworks later
- pip install flake8
before_script:
- flake8 --version
# stop the build if there are Python syntax errors or undefined names
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. Two space indentation is OK. The GitHub editor is 127 chars wide
- flake8 . --count --exit-zero --ignore=E111,E114,W503 --max-complexity=10 --max-line-length=127 --statistics
- echo "EXPERIMENTAL_NODE_GYP_PYTHON3 is ${EXPERIMENTAL_NODE_GYP_PYTHON3}"
- ${NODE_GYP_FORCE_PYTHON} --version || true
- npm install
script:
- node -e 'require("npmlog").level="verbose"; require("./lib/find-python")(null,()=>{})'
- npm test
#- pytest --capture=sys # add other tests here
notifications:
on_success: change
on_failure: change # `always` will be the setting once code changes slow down
5 changes: 4 additions & 1 deletion gyp/pylib/gyp/generator/ninja.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
import gyp.msvs_emulation
import gyp.MSVSUtil as MSVSUtil
import gyp.xcode_emulation
from cStringIO import StringIO
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO

from gyp.common import GetEnvironFallback
import gyp.ninja_syntax as ninja_syntax
Expand Down
4 changes: 2 additions & 2 deletions test/test-find-python.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ test('find python', function (t) {
t.strictEqual(err, null)
var proc = execFile(found, ['-V'], function (err, stdout, stderr) {
t.strictEqual(err, null)
t.strictEqual(stdout, '')
t.ok(/Python 2/.test(stderr))
t.strictEqual(stderr, '')
t.ok(/Python 3/.test(stdout))
})
proc.stdout.setEncoding('utf-8')
proc.stderr.setEncoding('utf-8')
Expand Down