* lib: print Python executable path using UTF-8
The Python executable path may have non-ASCII characters, which can make
the print function fail if the environment encoding is different. This fixes
this issue by using stdout.buffer, which can be used with UTF-8 encoding
for the output, regardless of the environment encoding.
Fixes: https://github.com/nodejs/node-gyp/issues/2829
* fixup! lib: print Python executable path using UTF-8
BREAKING CHANGE: the `Gyp` class exported is now created using
ECMAScript classes and therefore might have small differences to classes
that were previously created with `util.inherits`.
BREAKING CHANGE: All internal functions have been coverted to return
promises and no longer accept callbacks. This is not a breaking change
for users but may be breaking to consumers of `node-gyp` if you are
requiring internal functions directly.
* migrate from tap to mocha
After make-fetch-happen update GitHub Actions started failing. Migrating
from tap to mocha testing framework for GitHub Action stability.
* write custom test reporter for more verbose output
Implemented a simple custom mocha test reporter to replace the default
one. Made test report more developer friendly.
This allows us to start testing Python 3 without breaking node-gyp
for users.
This also adds support for NODE_GYP_FORCE_PYTHON, which will be the
only Python binary acceptable when defined.
PR-URL: https://github.com/nodejs/node-gyp/pull/1815
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
In addition:
* moved module.exports to the bottom
* no single-line if statements
* no if statements without a {
* const for requires
* array declarations get spaces inside [ ]
* 'use strict' in all .js files
PR-URL: https://github.com/nodejs/node-gyp/pull/1794
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: João Reis <reis@janeasystems.com>
- Uses `.eslintrc.yaml` for configuration
- `npm run lint` is part of `npm test`
PR-URL: https://github.com/nodejs/node-gyp/pull/1497
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: João Reis <reis@janeasystems.com>
This is cleaner than filtering additional strings from
platform.python_version().
PR-URL: https://github.com/nodejs/node-gyp/pull/1504
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Rod Vagg <rod@vagg.org>
Work around a v0.10.x CI issue where path.resolve() on UNIX systems
prefixes Windows paths with the current working directory.
v0.12 and up are free of this issue because they use
path.win32.resolve() which does the right thing.
PR-URL: https://github.com/nodejs/node-gyp/pull/1172
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Break up findPython() into pieces that can be tested in isolation and
add tests that do so.
PR-URL: https://github.com/nodejs/node-gyp/pull/992
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>