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

Support for Python 3 #21821

Closed
filips123 opened this issue Jul 15, 2018 · 12 comments
Closed

Support for Python 3 #21821

filips123 opened this issue Jul 15, 2018 · 12 comments
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. feature request Issues that request new features to be added to Node.js. python PRs and issues that require attention from people who are familiar with Python.

Comments

@filips123
Copy link

filips123 commented Jul 15, 2018

Add support for building with Python 3.
Python 2 is very old and it will not be supported in 2020 anymore (https://pythonclock.org/ and python/devguide#344).

@addaleax addaleax added the python PRs and issues that require attention from people who are familiar with Python. label Jul 15, 2018
@targos
Copy link
Member

targos commented Jul 15, 2018

We'd need gyp to support Python 3 first. See https://bugs.chromium.org/p/gyp/issues/detail?id=36

@seishun
Copy link
Contributor

seishun commented Jul 15, 2018

Let's be realistic, GYP will never support Python 3. We should instead move towards a different build system.

@Trott Trott added the feature request Issues that request new features to be added to Node.js. label Jul 15, 2018
@chux0519
Copy link
Contributor

@seishun like gn

@mscdex
Copy link
Contributor

mscdex commented Jul 16, 2018

Possibly relevant discussion here: #21410

@cfanoulis
Copy link
Contributor

cfanoulis commented Jul 18, 2018

I just want to drop this here...

https://docs.python.org/3/howto/pyporting.html

@refack refack self-assigned this Nov 11, 2018
@refack
Copy link
Contributor

refack commented Nov 11, 2018

There has been some major progress on this.

@reverofevil
Copy link

reverofevil commented Nov 11, 2018

I have a better idea: let's stop using Python to build native modules for Node.js. It's kind of a shame that we have to install Python to do this, as if Node.js was incapable of doing it at all.

GYP was crafted by Google to fit their needs at the moment, and it's declining ever since. Currently it's close to impossible to build native Node.js modules on non-latin windows, because of Python 2 lack of proper support for Unicode and GYP being built on top of it.

The way more popular and stable solution is cmake. Consider using it, please.

FYI: https://github.com/cjntaylor/node-cmake

@refack
Copy link
Contributor

refack commented Nov 11, 2018

Hello @polkovnikov-ph and thank you for your comment.

For the record, we don't just use python for scaffolding native-addons, we actually use it as node-core's tooling runtime (see /tools/).

For native-addons (via node-gyp) we are considering alternatives such as gyp.js, and I'll take a look at node-cmake.

GYP was crafted by Google to fit their needs at the moment, and it's declining ever since.

We've recently forked GYP, and I have plans of freshening it up (and maybe incrementally improve it). First item on the list is python3 support, and we're almost there.


as for:

Currently it's close to impossible to build native Node.js modules on non-latin windows, because of Python 2 lack of proper support for Unicode

There are workarounds (discussed in #12786) and being compatible with python3 should resolve this.

The way more popular and stable solution is cmake.

The big hindrance is that currently native addons are scaffolded with binding.gyp files. Replacing the meta-build system will require migrating every native-addon out there.
It might be possible to have cmake as an opt-in alternative formula for node-gyp, but that should be discussed in https://github.com/nodejs/node-gyp...
(keep in mind that for the end user who just wants to npm install some package, there is no way to know if some downstream dependency requires cmake to be built, and a failure will come as a surprise)

@refack
Copy link
Contributor

refack commented Nov 15, 2018

I'm going to close this as a duplicate of #23659

@refack refack closed this as completed Nov 15, 2018
@refack refack added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Nov 15, 2018
@filips123
Copy link
Author

filips123 commented Nov 16, 2018

You can close this if it is a duplicate, but I don't know how 4 months old issue can be duplicate of 1 month old issue 🤔. It is OK, but I just want to know what is this 😁.

@refack
Copy link
Contributor

refack commented Nov 16, 2018

but I don't know how 4 months old issue can be duplicate of 1 month old issue. 🤔

I'm sorry @filips123 it's not personal 😇. It's just that the other issue was brought to my attention first. I am working on this FR irregardless of this issue or that.

@filips123
Copy link
Author

filips123 commented Nov 16, 2018

@refack It is OK. I'm not sad or something like this 😄. I just wanted to know what was this 😁.

@refack refack removed their assignment Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. feature request Issues that request new features to be added to Node.js. python PRs and issues that require attention from people who are familiar with Python.
Projects
None yet
Development

No branches or pull requests

10 participants