Skip to content

Commit 000114f

Browse files
authored
[Manywheel] Add Python-3.13 compilation from branch (#1827)
* [Manywheel] Add Python-3.13 compilation from branch * fix * fix * test * fix_cpython_build * Add 3.7.5 back
1 parent 1d0b405 commit 000114f

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

common/install_cpython.sh

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
set -uex -o pipefail
33

44
PYTHON_DOWNLOAD_URL=https://www.python.org/ftp/python
5+
PYTHON_DOWNLOAD_GITHUB_BRANCH=https://github.com/python/cpython/archive/refs/heads
56
GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py
67

78
# Python versions to be installed in /opt/$VERSION_NO
8-
CPYTHON_VERSIONS=${CPYTHON_VERSIONS:-"3.7.5 3.8.1 3.9.0 3.10.1 3.11.0 3.12.0"}
9+
CPYTHON_VERSIONS=${CPYTHON_VERSIONS:-"3.7.5 3.8.1 3.9.0 3.10.1 3.11.0 3.12.0 3.13.0"}
910

1011
function check_var {
1112
if [ -z "$1" ]; then
@@ -16,9 +17,11 @@ function check_var {
1617

1718
function do_cpython_build {
1819
local py_ver=$1
20+
local py_folder=$2
1921
check_var $py_ver
22+
check_var $py_folder
2023
tar -xzf Python-$py_ver.tgz
21-
pushd Python-$py_ver
24+
pushd $py_folder
2225

2326
local prefix="/opt/_internal/cpython-${py_ver}"
2427
mkdir -p ${prefix}/lib
@@ -44,7 +47,7 @@ function do_cpython_build {
4447
fi
4548

4649
popd
47-
rm -rf Python-$py_ver
50+
rm -rf $py_folder
4851
# Some python's install as bin/python3. Make them available as
4952
# bin/python.
5053
if [ -e ${prefix}/bin/python3 ]; then
@@ -64,8 +67,16 @@ function build_cpython {
6467
check_var $py_ver
6568
check_var $PYTHON_DOWNLOAD_URL
6669
local py_ver_folder=$py_ver
67-
wget -q $PYTHON_DOWNLOAD_URL/$py_ver_folder/Python-$py_ver.tgz
68-
do_cpython_build $py_ver none
70+
if [ "$py_ver" = "3.13.0" ]; then
71+
PY_VER_SHORT="3.13"
72+
check_var $PYTHON_DOWNLOAD_GITHUB_BRANCH
73+
wget $PYTHON_DOWNLOAD_GITHUB_BRANCH/$PY_VER_SHORT.tar.gz -O Python-$py_ver.tgz
74+
do_cpython_build $py_ver cpython-$PY_VER_SHORT
75+
else
76+
wget -q $PYTHON_DOWNLOAD_URL/$py_ver_folder/Python-$py_ver.tgz
77+
do_cpython_build $py_ver Python-$py_ver
78+
fi
79+
6980
rm -f Python-$py_ver.tgz
7081
}
7182

0 commit comments

Comments
 (0)