Skip to content

Commit

Permalink
feat: upgrade node-gyp@9 to support python3 (#392)
Browse files Browse the repository at this point in the history
pick from #385

closes #384
  • Loading branch information
fengmk2 authored Mar 24, 2022
1 parent 74a13b7 commit 0dc0f9e
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [ 10.x, 12.x, 14.x, 16.x ]
node-version: [ 14.x, 16.x ]
platform:
- os: ubuntu-latest
shell: bash
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@

Make `npm install` fast and handy.

## Node.js and Python required

- Node.js >= 14.x
- Python >= 3.x

## Use as Cli

### Install
Expand Down Expand Up @@ -148,7 +153,7 @@ const npminstall = require('npminstall');
- [x] All platform support
- [x] global install (`-g, --global`)
- [x] `preinstall`, `install`, `postinstall` scripts
- [x] node-gyp
- [x] node-gyp@9, only support Python@3
- [x] node-pre-gyp
- [x] bin (yo@1.6.0, fsevents@1.0.6)
- [x] scoped package
Expand Down Expand Up @@ -317,4 +322,4 @@ npm i babel-preset-es2015 browserify chalk debug minimist mkdirp

This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Mon Mar 21 2022 17:06:36 GMT+0800`.

<!-- GITCONTRIBUTOR_END -->
<!-- GITCONTRIBUTOR_END -->
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"ms": "^2.1.1",
"mz": "^2.7.0",
"mz-modules": "^2.1.0",
"node-gyp": "^4.0.0",
"node-gyp": "^9.0.0",
"node-homedir": "^1.1.1",
"normalize-package-data": "^2.5.0",
"npm-normalize-package-bin": "^1.0.1",
Expand Down Expand Up @@ -87,7 +87,7 @@
"fastest npm install"
],
"engines": {
"node": ">=10.0.0"
"node": ">=14.0.0"
},
"author": "fengmk2 <fengmk2@gmail.com> (https://github.com/fengmk2)",
"license": "MIT"
Expand Down
6 changes: 6 additions & 0 deletions test/fixtures/install-raw-socket/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "install-raw-socket",
"dependencies": {
"raw-socket": "^1.7.0"
}
}
2 changes: 1 addition & 1 deletion test/get.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('test/get.test.js', () => {
} catch (err) {
const headers = options.headers;
assert(headers.Authorization);
assert(err.name === 'RequestError');
assert(err.name === 'RequestError' || err.name === 'ConnectionTimeoutError');
assert(err.res.requestUrls.length === 5);
}
});
Expand Down
22 changes: 22 additions & 0 deletions test/install-with-python3.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict';

const coffee = require('coffee');
const helper = require('./helper');

if (process.platform !== 'win32') {
describe('test/install-with-python3.test.js', () => {
const cwd = helper.fixtures('install-raw-socket');
const cleanup = helper.cleanup(cwd);

beforeEach(cleanup);
afterEach(cleanup);

it('should install raw-socket with python3', async () => {
// https://github.com/cnpm/npminstall/issues/384
await coffee.fork(helper.npminstall, [ '-d' ], { cwd })
.debug()
.expect('code', 0)
.end();
});
});
}

0 comments on commit 0dc0f9e

Please sign in to comment.