Skip to content

Commit a971947

Browse files
committed
lib: accept Python 3 by default
1 parent 9b6e9ac commit a971947

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ matrix:
3030
before_install: choco install python2
3131
- name: "Node.js 6 & Python 3.7 on Linux"
3232
python: 3.7
33-
env: NODE_GYP_FORCE_PYTHON=python3 EXPERIMENTAL_NODE_GYP_PYTHON3=1
33+
env: NODE_GYP_FORCE_PYTHON=python3
3434
before_install: nvm install 6
3535
- name: "Node.js 8 & Python 3.7 on Linux"
3636
python: 3.7
37-
env: NODE_GYP_FORCE_PYTHON=python3 EXPERIMENTAL_NODE_GYP_PYTHON3=1
37+
env: NODE_GYP_FORCE_PYTHON=python3
3838
before_install: nvm install 8
3939
- name: "Node.js 10 & Python 3.7 on Linux"
4040
python: 3.7
41-
env: NODE_GYP_FORCE_PYTHON=python3 EXPERIMENTAL_NODE_GYP_PYTHON3=1
41+
env: NODE_GYP_FORCE_PYTHON=python3
4242
before_install: nvm install 10
4343
- name: "Node.js 12 & Python 3.7 on Linux"
4444
python: 3.7
45-
env: NODE_GYP_FORCE_PYTHON=python3 EXPERIMENTAL_NODE_GYP_PYTHON3=1
45+
env: NODE_GYP_FORCE_PYTHON=python3
4646
before_install: nvm install 12
4747
- name: "Node.js 12 & Python 3.7 on Windows"
4848
os: windows
@@ -51,7 +51,6 @@ matrix:
5151
env: >-
5252
PATH=/c/Python37:/c/Python37/Scripts:$PATH
5353
NODE_GYP_FORCE_PYTHON=/c/Python37/python.exe
54-
EXPERIMENTAL_NODE_GYP_PYTHON3=1
5554
before_install: choco install python
5655
install:
5756
#- pip install -r requirements.txt

lib/find-python.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ PythonFinder.prototype = {
1818
log: logWithPrefix(log, 'find Python'),
1919
argsExecutable: [ '-c', 'import sys; print(sys.executable);' ],
2020
argsVersion: [ '-c', 'import sys; print("%s.%s.%s" % sys.version_info[:3]);' ],
21-
semverRange: process.env.EXPERIMENTAL_NODE_GYP_PYTHON3 ? '2.7.x || >=3.5.0'
22-
: '>=2.7.0 <3.0.0',
21+
semverRange: '2.7.x || >=3.5.0',
2322

2423
// These can be overridden for testing:
2524
execFile: cp.execFile,
@@ -93,6 +92,11 @@ PythonFinder.prototype = {
9392
check: this.checkCommand,
9493
arg: 'python'
9594
},
95+
{
96+
before: () => { this.addLog('checking if "python3" can be used') },
97+
check: this.checkCommand,
98+
arg: 'python3'
99+
},
96100
{
97101
before: () => { this.addLog('checking if "python2" can be used') },
98102
check: this.checkCommand,
@@ -286,7 +290,7 @@ PythonFinder.prototype = {
286290
// X
287291
const info = [
288292
'**********************************************************',
289-
'You need to install the latest version of Python 2.7.',
293+
'You need to install the latest version of Python.',
290294
'Node-gyp should be able to find and use Python. If not,',
291295
'you can try one of the following options:',
292296
`- Use the switch --python="${pathExample}"`,

0 commit comments

Comments
 (0)