Skip to content

Commit

Permalink
build: support Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
shipujin committed Oct 17, 2023
1 parent badba8c commit 21681f4
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 @@ -229,7 +229,7 @@ The Node.js project supports Python >= 3 for building and testing.

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

Installation via Linux package manager can be achieved with:
Expand All @@ -245,7 +245,7 @@ FreeBSD and OpenBSD users may also need to install `libexecinfo`.
#### macOS prerequisites

* Xcode Command Line Tools >= 13 for macOS
* Python >=3.6 <=3.11 (see note above)
* Python >=3.6 <=3.12 (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 @@ -575,7 +575,7 @@ to run it again before invoking `make -j4`.

##### Option 1: Manual install

* [Python 3.11](https://apps.microsoft.com/store/detail/python-311/9NRWMJP3717K)
* [Python 3.12](https://apps.microsoft.com/detail/python-3-12/9NCVDN91XZQP)
* The "Desktop development with C++" workload from
[Visual Studio 2022](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.12 >/dev/null && exec python3.12 "$0" "$@"
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" "$@"
Expand All @@ -23,7 +24,7 @@ except ImportError:
from distutils.spawn import find_executable as which

print('Node.js configure: Found Python {}.{}.{}...'.format(*sys.version_info))
acceptable_pythons = ((3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
acceptable_pythons = ((3, 12), (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 21681f4

Please sign in to comment.