From 75c4bdeb2106c66370de19626509986f740cafc8 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 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common.gypi b/common.gypi index c33f4429dbcb55..8120bed999992f 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.11', + 'v8_embedder_string': '-node.12', ##### 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..b14f85ff148c1c 100644 --- a/deps/v8/third_party/jinja2/tests.py +++ b/deps/v8/third_party/jinja2/tests.py @@ -10,7 +10,7 @@ """ import operator import re -from collections import Mapping +from collections.abc import Mapping from jinja2.runtime import Undefined from jinja2._compat import text_type, string_types, integer_types import decimal From 24c403cfaf8bdbcd8b19037531c8998709d2b949 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/inspector_protocol/jinja2/tests.py b/tools/inspector_protocol/jinja2/tests.py index 0adc3d4dbcbb88..b14f85ff148c1c 100644 --- a/tools/inspector_protocol/jinja2/tests.py +++ b/tools/inspector_protocol/jinja2/tests.py @@ -10,7 +10,7 @@ """ import operator import re -from collections import Mapping +from collections.abc import Mapping from jinja2.runtime import Undefined from jinja2._compat import text_type, string_types, integer_types import decimal From 7752088ef663baa29501480f19e1bbc6de852e0d 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/coverage-linux.yml | 2 +- .github/workflows/coverage-windows.yml | 2 +- .github/workflows/linters.yml | 2 +- .github/workflows/test-asan.yml | 2 +- .github/workflows/test-internet.yml | 2 +- .github/workflows/test-linux.yml | 2 +- .github/workflows/test-macos.yml | 2 +- BUILDING.md | 4 ++-- configure | 3 ++- 11 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml index 0e70aaaa5cd1fd..7f96504f781406 100644 --- a/.github/workflows/build-tarball.yml +++ b/.github/workflows/build-tarball.yml @@ -27,7 +27,7 @@ jobs: build-tarball: if: github.event.pull_request.draft == false env: - PYTHON_VERSION: 3.9 + PYTHON_VERSION: '3.10' runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -52,7 +52,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 d489de708d130b..e6fd0a4b92fe23 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/coverage-linux.yml b/.github/workflows/coverage-linux.yml index 59a758ebdfc6a0..e322e764840989 100644 --- a/.github/workflows/coverage-linux.yml +++ b/.github/workflows/coverage-linux.yml @@ -19,7 +19,7 @@ on: - 'doc/**' env: - PYTHON_VERSION: 3.9 + PYTHON_VERSION: '3.10' FLAKY_TESTS: dontcare jobs: diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index 0f0072bfe6c532..4473eb9bd74ae3 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -21,7 +21,7 @@ on: - 'tools/**' 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 2694e07ab3c6fd..131d220562a5d9 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 8745f5eb4c0f9a..021747ace19a4b 100644 --- a/.github/workflows/test-asan.yml +++ b/.github/workflows/test-asan.yml @@ -22,7 +22,7 @@ on: - 'doc/**' env: - PYTHON_VERSION: 3.9 + PYTHON_VERSION: '3.10' FLAKY_TESTS: dontcare jobs: diff --git a/.github/workflows/test-internet.yml b/.github/workflows/test-internet.yml index 8d2ba377d3cd0f..44757dd287280c 100644 --- a/.github/workflows/test-internet.yml +++ b/.github/workflows/test-internet.yml @@ -20,7 +20,7 @@ on: - test/internet/** 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 07e871bd07dc02..01227a0ff92289 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 a099a25285c278..6c5e3ab310cb27 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -22,7 +22,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 520d9b3d521538..99b2014c19b9ca 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -235,7 +235,7 @@ The Node.js project supports Python >= 3 for building and testing. * `gcc` and `g++` >= 8.3 or newer, or * GNU Make 3.81 or newer -* Python 3.6, 3.7, 3.8, or 3.9 (see note above) +* Python 3.6, 3.7, 3.8, 3.9, or 3.10 (see note above) Installation via Linux package manager can be achieved with: @@ -250,7 +250,7 @@ FreeBSD and OpenBSD users may also need to install `libexecinfo`. #### macOS prerequisites * Xcode Command Line Tools >= 11 for macOS -* Python 3.6, 3.7, 3.8, or 3.9 (see note above) +* 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 baf4b513da881b..6ef2da2e631e6e 100755 --- a/configure +++ b/configure @@ -4,6 +4,7 @@ # Note that the mix of single and double quotes is intentional, # as is the fact that the ] goes on a new line. _=[ 'exec' '/bin/sh' '-c' ''' +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" "$@" @@ -21,7 +22,7 @@ except ImportError: from distutils.spawn import find_executable as which print('Node.js configure: Found Python {}.{}.{}...'.format(*sys.version_info)) -acceptable_pythons = ((3, 9), (3, 8), (3, 7), (3, 6)) +acceptable_pythons = ((3, 10), (3, 9), (3, 8), (3, 7), (3, 6)) if sys.version_info[:2] in acceptable_pythons: import configure else: