From 80b7c4a2b8eefb21f4ccfcc00d40c5e502becfff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 5 Oct 2021 13:33:50 +0200 Subject: [PATCH 1/3] deps: V8: patch jinja2 for Python 3.10 compat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/40296 Fixes: https://github.com/nodejs/node/issues/40294 Reviewed-By: Jiawen Geng Reviewed-By: James M Snell Reviewed-By: Richard Lau Reviewed-By: Christian Clauss Reviewed-By: Michaël Zasso --- common.gypi | 2 +- deps/v8/third_party/jinja2/tests.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/common.gypi b/common.gypi index b16f643d46d54d..f3a4aad62abef6 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.84', + 'v8_embedder_string': '-node.85', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/third_party/jinja2/tests.py b/deps/v8/third_party/jinja2/tests.py index 0adc3d4dbcbb88..39c7360253a709 100644 --- a/deps/v8/third_party/jinja2/tests.py +++ b/deps/v8/third_party/jinja2/tests.py @@ -10,7 +10,10 @@ """ import operator import re -from collections import Mapping +try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping from jinja2.runtime import Undefined from jinja2._compat import text_type, string_types, integer_types import decimal From 1007a6e87f0f6fe03aaa7483de5c54d4185b4bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 5 Oct 2021 13:34:39 +0200 Subject: [PATCH 2/3] tools: patch jinja2 for Python 3.10 compat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/40296 Fixes: https://github.com/nodejs/node/issues/40294 Reviewed-By: Jiawen Geng Reviewed-By: James M Snell Reviewed-By: Richard Lau Reviewed-By: Christian Clauss Reviewed-By: Michaël Zasso --- tools/inspector_protocol/jinja2/tests.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/inspector_protocol/jinja2/tests.py b/tools/inspector_protocol/jinja2/tests.py index 0adc3d4dbcbb88..39c7360253a709 100644 --- a/tools/inspector_protocol/jinja2/tests.py +++ b/tools/inspector_protocol/jinja2/tests.py @@ -10,7 +10,10 @@ """ import operator import re -from collections import Mapping +try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping from jinja2.runtime import Undefined from jinja2._compat import text_type, string_types, integer_types import decimal From 31c42aec830b8c44cad7efc23c723705655f6f4e Mon Sep 17 00:00:00 2001 From: FrankQiu Date: Mon, 4 Oct 2021 15:01:04 +0800 Subject: [PATCH 3/3] build: support Python 3.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/40296 Fixes: https://github.com/nodejs/node/issues/40294 Reviewed-By: Jiawen Geng Reviewed-By: James M Snell Reviewed-By: Richard Lau Reviewed-By: Christian Clauss Reviewed-By: Michaël Zasso --- .github/workflows/build-tarball.yml | 4 ++-- .github/workflows/build-windows.yml | 2 +- .github/workflows/linters.yml | 2 +- .github/workflows/test-asan.yml | 2 +- .github/workflows/test-linux.yml | 2 +- .github/workflows/test-macos.yml | 2 +- BUILDING.md | 4 ++-- configure | 3 ++- 8 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml index cf6e2ce3673149..ed412723588d15 100644 --- a/.github/workflows/build-tarball.yml +++ b/.github/workflows/build-tarball.yml @@ -16,7 +16,7 @@ env: jobs: build-tarball: env: - PYTHON_VERSION: 3.9 + PYTHON_VERSION: '3.10' runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -41,7 +41,7 @@ jobs: path: tarballs test-tarball-linux: env: - PYTHON_VERSION: 3.9 + PYTHON_VERSION: '3.10' needs: build-tarball runs-on: ubuntu-latest steps: diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index d04028cab029d8..e30274c47ad033 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -12,7 +12,7 @@ on: - v[0-9]+.x env: - PYTHON_VERSION: 3.9 + PYTHON_VERSION: '3.10' FLAKY_TESTS: dontcare jobs: diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 38168318ee7cc3..0264edaa940738 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -11,7 +11,7 @@ on: - v[0-9]+.x env: - PYTHON_VERSION: 3.9 + PYTHON_VERSION: '3.10' NODE_VERSION: lts/* jobs: diff --git a/.github/workflows/test-asan.yml b/.github/workflows/test-asan.yml index 852b205d1b7e70..8958610ffeecde 100644 --- a/.github/workflows/test-asan.yml +++ b/.github/workflows/test-asan.yml @@ -18,7 +18,7 @@ on: - 'doc/**' env: - PYTHON_VERSION: 3.9 + PYTHON_VERSION: '3.10' FLAKY_TESTS: dontcare jobs: diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index c730803e0c342a..b9ca56a4613ca5 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -12,7 +12,7 @@ on: - v[0-9]+.x env: - PYTHON_VERSION: 3.9 + PYTHON_VERSION: '3.10' FLAKY_TESTS: dontcare jobs: diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index f2745218bce2c5..1461feb96f4d3b 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -18,7 +18,7 @@ on: - 'doc/**' env: - PYTHON_VERSION: 3.9 + PYTHON_VERSION: '3.10' FLAKY_TESTS: dontcare jobs: diff --git a/BUILDING.md b/BUILDING.md index 3e5f17410b0583..5d2459eb76548f 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -239,7 +239,7 @@ test with Python 3. * GNU Make 3.81 or newer * Python (see note above) * Python 2.7 - * Python 3.5, 3.6, 3.7, or 3.8 + * Python 3.5, 3.6, 3.7, 3.8, 3.9 or 3.10 (see note above) Installation via Linux package manager can be achieved with: @@ -256,7 +256,7 @@ FreeBSD and OpenBSD users may also need to install `libexecinfo`. * Xcode Command Line Tools >= 10 for macOS * Python (see note above) * Python 2.7 - * Python 3.5, 3.6, 3.7, or 3.8 + * Python 3.6, 3.7, 3.8, 3.9, or 3.10 (see note above) macOS users can install the `Xcode Command Line Tools` by running `xcode-select --install`. Alternatively, if you already have the full Xcode diff --git a/configure b/configure index 4fec68abf979e1..debd3cc3d452d0 100755 --- a/configure +++ b/configure @@ -5,6 +5,7 @@ # as is the fact that the ] goes on a new line. _=[ 'exec' '/bin/sh' '-c' ''' test ${FORCE_PYTHON2} && exec python2 "$0" "$@" # workaround for gclient +command -v python3.10 >/dev/null && exec python3.10 "$0" "$@" command -v python3.9 >/dev/null && exec python3.9 "$0" "$@" command -v python3.8 >/dev/null && exec python3.8 "$0" "$@" command -v python3.7 >/dev/null && exec python3.7 "$0" "$@" @@ -24,7 +25,7 @@ except ImportError: from distutils.spawn import find_executable as which print('Node.js configure: Found Python {0}.{1}.{2}...'.format(*sys.version_info)) -acceptable_pythons = ((3, 9), (3, 8), (3, 7), (3, 6), (3, 5), (2, 7)) +acceptable_pythons = ((3,10), (3, 9), (3, 8), (3, 7), (3, 6), (3, 5), (2, 7)) if sys.version_info[:2] in acceptable_pythons: import configure else: