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

gyp: remove support for Python 2 #2300

Merged
merged 2 commits into from
Feb 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,22 @@ Depending on your operating system, you will need to install:

### On Unix

* Python v2.7, v3.5, v3.6, v3.7, or v3.8
* Python v3.6, v3.7, v3.8, or v3.9
* `make`
* A proper C/C++ compiler toolchain, like [GCC](https://gcc.gnu.org)

### On macOS

**ATTENTION**: If your Mac has been _upgraded_ to macOS Catalina (10.15), please read [macOS_Catalina.md](macOS_Catalina.md).

* Python v2.7, v3.5, v3.6, v3.7, or v3.8
* Python v3.6, v3.7, v3.8, or v3.9
* [Xcode](https://developer.apple.com/xcode/download/)
* You also need to install the `XCode Command Line Tools` by running `xcode-select --install`. Alternatively, if you already have the full Xcode installed, you can find them under the menu `Xcode -> Open Developer Tool -> More Developer Tools...`. This step will install `clang`, `clang++`, and `make`.

### On Windows

Install the current version of Python from the [Microsoft Store package](https://docs.python.org/3/using/windows.html#the-microsoft-store-package).

#### Option 1

Install all the required tools and configurations using Microsoft's [windows-build-tools](https://github.com/felixrieseberg/windows-build-tools) using `npm install --global windows-build-tools` from an elevated PowerShell or CMD.exe (run as Administrator).

#### Option 2

Install tools and configuration manually:
* Install Visual C++ Build Environment: [Visual Studio Build Tools](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools)
(using "Visual C++ build tools" workload) or [Visual Studio 2017 Community](https://visualstudio.microsoft.com/pl/thank-you-downloading-visual-studio/?sku=Community)
Expand All @@ -64,8 +58,8 @@ Install tools and configuration manually:

### Configuring Python Dependency

`node-gyp` requires that you have installed a compatible version of Python, one of: v2.7, v3.5, v3.6,
v3.7, or v3.8. If you have multiple Python versions installed, you can identify which Python
`node-gyp` requires that you have installed a compatible version of Python, one of: v3.6, v3.7,
v3.8, or v3.9. If you have multiple Python versions installed, you can identify which Python
version `node-gyp` should use in one of the following ways:

1. by setting the `--python` command-line option, e.g.:
Expand Down
2 changes: 0 additions & 2 deletions gyp/pylib/gyp/MSVSSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@
_msvs_validators = {}
_msbuild_validators = {}


# A dictionary of settings converters. The key is the tool name, the value is
# a dictionary mapping setting names to conversion functions.
_msvs_to_msbuild_converters = {}


# Tool name mapping from MSVS to MSBuild.
_msbuild_name_of_tool = {}

Expand Down
4 changes: 3 additions & 1 deletion gyp/pylib/gyp/generator/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,9 @@ def WriteCopies(self, copies, extra_outputs):
self.LocalPathify(os.path.join(copy["destination"], filename))
)

self.WriteLn(f"{output}: {path} $(GYP_TARGET_DEPENDENCIES) | $(ACP)")
self.WriteLn(
f"{output}: {path} $(GYP_TARGET_DEPENDENCIES) | $(ACP)"
)
self.WriteLn("\t@echo Copying: $@")
self.WriteLn("\t$(hide) mkdir -p $(dir $@)")
self.WriteLn("\t$(hide) $(ACP) -rpf $< $@")
Expand Down
7 changes: 3 additions & 4 deletions test/fixtures/test-charmap.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import sys
import locale

Expand All @@ -18,9 +17,9 @@ def main():
pass

textmap = {
'cp936': u'\u4e2d\u6587',
'cp1252': u'Lat\u012Bna',
'cp932': u'\u306b\u307b\u3093\u3054'
'cp936': '\u4e2d\u6587',
'cp1252': 'Lat\u012Bna',
'cp932': '\u306b\u307b\u3093\u3054'
}
if encoding in textmap:
print(textmap[encoding])
Expand Down