-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Proposal: drop support for Python 2 #32814
Comments
I suggested it in nodejs/build#2168 but there wasn’t much enthusiasm for doing so. |
I think the other thing that would need to be kept in mind is if there would be a minimum Python 3 version/branch and if supported platforms have that particular Python 3 version/branch (easily) available (e.g. from official package repositories). |
Python 3.5, 3.6, 3.7, and 3.8 until September 2020 when 3.5 reaches end of life. |
If we do decide to drop Python 2 and support only Python 3, we're talking about dropping it fully only in April 2023, because we're not dropping it for Node.js v14 and we'll need to keep supporting (at least in that release line) it until v14 goes EOL. I'd be more interested in removing Python as a dependency if possible, as personally I find the Python 2/3 discussion in the project very distracting (and I don't see it going away anytime soon, even after Python 2 officially goes EOL). I guess the main issue is gyp requires Python, especially for native modules, which means we can't effectively drop it anytime soon (same reason as described above). Hopefully moving core's build toolchain from gyp to cmake can reduce our dependency on Python though. |
Gyp (the Python version) could be dropped if https://github.com/indutny/gyp.js/ was completed, any takers? I think 14.x should prefer using Python 3 when searching (over Python 2), but I don't think we should delete/break support for it until:
|
Seems like |
FWIW, most of the Python issues I've seen lately are coming from our dependencies, and not from our codebase. |
I think #32814 (comment) has broad consensus as "would be great", but it needs work. cmake is in progress, but gyp.js is not. |
Kicked off https://ci.nodejs.org/job/node-test-commit/37549/ against sam-github@b00561d out of curiosity about whether our CI supports python 3 everywhere (I suspect not). But... it doesn't work because we explicitly call |
Honestly if we're going to switch build systems, I'd much rather be it one that is more flexible than gyp, and cmake fits that bill as far as I can tell. One example is being able to easily detect platform features, something you can't really do with gyp. Having this ability alone would be great for binding authors who currently have to maintain separate "config.h" files for example for each platform, but even then that's not foolproof because installations can still vary in available features/APIs. Also as cmake is more popular than gyp amongst OSS projects, I think it'd probably make build integration much easier as well for binding authors. |
@mscdex agreed, but I think it's a harder sell for native modules (although it might be feasible). |
@mmarchini Obviously there would need to be a transition period where both would have to be supported, at least for addons. |
In my comments above, I made the classic mistake of mixing discussion of node itself and addons in the community, sorry.
|
Re gyp.js, that's been kind of on me and i've been continually dropping the ball on it due to lack of it feeling like a pressing thing. The rough plan was/is something like this:
It's pretty basic as it is now but that's mostly because it hasn't had a reason to be pushed harder, so we need to get it out into the wild and encourage folks to help improve it. Aside from it only supporting very basic gyp configs, Windows support is probably the biggest missing thing right now. But we have plenty of clever folks around that I'm sure would love to help make it work nicely. |
drop python2 PRs now are merged. |
Is your feature request related to a problem? Please describe.
Python 2 went EOL on 1/1/2020 and we receive no more support from the Python Core Team after Python 2.7.18 even for known security issues. Node.js and Node-gyp work with both Python 2 and Python 3. Should we drop support for Python 2 in Node.js 14? If not now, when?
Please describe the problem you are trying to solve.
Describe the solution you'd like
Encouraging users to continue to use Python 2 exposes them to unnecessary security risks. Supporting both Python 2 and Python 3 make it harder to diagnose problems and requires much more hardware, time, power, complexity to test on multiple platforms. In some cases we have already stopped testing on legacy Python while claiming that we still support it.
Describe alternatives you've considered
Please describe alternative solutions or features you have considered.
Waiting.
The text was updated successfully, but these errors were encountered: