Skip to content

Commit

Permalink
build: support Python 3.11
Browse files Browse the repository at this point in the history
PR-URL: nodejs/node#45191
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Christian Clauss <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
  • Loading branch information
lpinca authored and RobDangerous committed Jun 10, 2023
1 parent fdd5063 commit ea9ec15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ The Node.js project supports Python >= 3 for building and testing.

* `gcc` and `g++` >= 8.3 or newer
* GNU Make 3.81 or newer
* Python 3.6, 3.7, 3.8, 3.9, or 3.10 (see note above)
* Python >=3.6 <=3.11 (see note above)
* For test coverage, your Python installation must include pip.

Installation via Linux package manager can be achieved with:
Expand All @@ -252,7 +252,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, 3.9, or 3.10 (see note above)
* Python >=3.6 <=3.11 (see note above)
* For test coverage, your Python installation must include pip.

macOS users can install the `Xcode Command Line Tools` by running
Expand Down Expand Up @@ -571,7 +571,7 @@ to run it again before invoking `make -j4`.

##### Option 1: Manual install

* [Python 3.10](https://www.microsoft.com/en-us/p/python-310/9pjpw5ldxlz5)
* [Python 3.11](https://apps.microsoft.com/store/detail/python-311/9NRWMJP3717K)
* The "Desktop development with C++" workload from
[Visual Studio 2019](https://visualstudio.microsoft.com/downloads/) or
the "C++ build tools" workload from the
Expand Down
3 changes: 2 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -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.11 >/dev/null && exec python3.11 "$0" "$@"
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" "$@"
Expand All @@ -22,7 +23,7 @@ except ImportError:
from distutils.spawn import find_executable as which

print('Node.js configure: Found Python {}.{}.{}...'.format(*sys.version_info))
acceptable_pythons = ((3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
acceptable_pythons = ((3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
if sys.version_info[:2] in acceptable_pythons:
import configure
else:
Expand Down

0 comments on commit ea9ec15

Please sign in to comment.