Visitar URL original
Support for Python 3 · Issue #21821 · nodejs/node · GitHub
Skip to content

Support for Python 3 #21821

Description

@filips123

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).

Activity

  1. added
    pythonPRs and issues that require attention from people who are familiar with Python.
    on Jul 15, 2018
  2. targos commented on Jul 15, 2018

    @targos
    Member

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

  3. seishun commented on Jul 15, 2018

    @seishun
    Contributor

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

  4. chux0519 commented on Jul 16, 2018

    @chux0519
    Contributor

    @seishun like gn

  5. mscdex commented on Jul 16, 2018

    @mscdex
    Contributor

    Possibly relevant discussion here: #21410

  6. cfanoulis commented on Jul 18, 2018

    @cfanoulis
    Contributor

    I just want to drop this here...

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

  7. self-assigned this
    on Nov 11, 2018
  8. refack commented on Nov 11, 2018

    @refack
    Contributor

    There has been some major progress on this.

  9. reverofevil commented on Nov 11, 2018

    @reverofevil

    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

  10. refack commented on Nov 11, 2018

    @refack
    Contributor

    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)

  11. refack commented on Nov 15, 2018

    @refack
    Contributor

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

  12. added
    duplicateIssues and PRs that are duplicates of other issues or PRs.
    on Nov 15, 2018
  13. filips123 commented on Nov 16, 2018

    @filips123
    Author

    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 😁.

  14. refack commented on Nov 16, 2018

    @refack
    Contributor

    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.

  15. filips123 commented on Nov 16, 2018

    @filips123
    Author

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

  16. removed their assignment
    on Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIssues and PRs that are duplicates of other issues or PRs.feature requestIssues requesting new Node.js features.pythonPRs and issues that require attention from people who are familiar with Python.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions