Skip to content

Commit 2a3f8b8

Browse files
authored
Adding py311 validations (#1262)
1 parent e2e4542 commit 2a3f8b8

File tree

3 files changed

+29
-13
lines changed

3 files changed

+29
-13
lines changed

.github/scripts/validate_binaries.sh

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,28 @@ if [[ ${PACKAGE_TYPE} == "libtorch" ]]; then
1111
curl ${INSTALLATION} -o libtorch.zip
1212
unzip libtorch.zip
1313
else
14-
conda create -y -n ${ENV_NAME} python=${DESIRED_PYTHON} numpy pillow
15-
conda activate ${ENV_NAME}
16-
export CONDA_LIBRARY_PATH="$(dirname $(which python))/../lib"
17-
export LD_LIBRARY_PATH=$CONDA_LIBRARY_PATH:$LD_LIBRARY_PATH
18-
INSTALLATION=${INSTALLATION/"conda install"/"conda install -y"}
19-
eval $INSTALLATION
20-
python ./test/smoke_test/smoke_test.py
21-
if [[ ${TARGET_OS} != 'macos' && ${TARGET_OS} != 'windows' ]]; then
22-
${PWD}/check_binary.sh
14+
if [ $DESIRED_PYTHON == '3.11' ]; then
15+
export CPYTHON_VERSIONS=3.11.0
16+
sudo yum -y install openssl-devel libssl-dev bzip2-devel libffi-devel
17+
sudo yum -y groupinstall "Development Tools"
18+
export PYTHON_PATH="/opt/_internal/cpython-3.11.0/bin"
19+
export PIP_PATH="${PYTHON_PATH}/pip"
20+
export PIP_INSTALLATION="${INSTALLATION/pip3/"$PIP_PATH"}"
21+
export WITH_OPENSSL="/opt/openssl"
22+
./common/install_cpython.sh
23+
eval ${PYTHON_PATH}/python --version
24+
eval ${PIP_INSTALLATION}
25+
eval ${PYTHON_PATH}/python ./test/smoke_test/smoke_test.py --package torchonly
26+
else
27+
conda create -y -n ${ENV_NAME} python=${DESIRED_PYTHON} numpy pillow
28+
conda activate ${ENV_NAME}
29+
export CONDA_LIBRARY_PATH="$(dirname $(which python))/../lib"
30+
export LD_LIBRARY_PATH=$CONDA_LIBRARY_PATH:$LD_LIBRARY_PATH
31+
INSTALLATION=${INSTALLATION/"conda install"/"conda install -y"}
32+
eval $INSTALLATION
33+
python ./test/smoke_test/smoke_test.py
34+
if [[ ${TARGET_OS} != 'macos' && ${TARGET_OS} != 'windows' ]]; then
35+
${PWD}/check_binary.sh
36+
fi
2337
fi
2438
fi

.github/workflows/validate-linux-binaries.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
package-type: all
3737
os: linux
3838
channel: ${{ inputs.channel }}
39+
with-py311: enable
3940

4041
linux:
4142
needs: generate-linux-matrix

common/install_cpython.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ function do_cpython_build {
4040
mkdir -p ${prefix}/lib
4141

4242
# -Wformat added for https://bugs.python.org/issue17547 on Python 2.6
43-
CFLAGS="-Wformat" ./configure --prefix=${prefix} --disable-shared $unicode_flags > /dev/null
43+
if [[ -z ${WITH_OPENSSL} ]]; then
44+
CFLAGS="-Wformat" ./configure --prefix=${prefix} --disable-shared $unicode_flags > /dev/null
45+
else
46+
CFLAGS="-Wformat" ./configure --prefix=${prefix} --with-openssl=${WITH_OPENSSL} --with-openssl-rpath=auto --disable-shared $unicode_flags > /dev/null
47+
fi
4448

4549
make -j40 > /dev/null
4650
make install > /dev/null
@@ -61,7 +65,6 @@ function do_cpython_build {
6165
ln -s ${prefix} /opt/python/${abi_tag}
6266
}
6367

64-
6568
function build_cpython {
6669
local py_ver=$1
6770
check_var $py_ver
@@ -77,7 +80,6 @@ function build_cpython {
7780
rm -f Python-$py_ver.tgz
7881
}
7982

80-
8183
function build_cpythons {
8284
check_var $GET_PIP_URL
8385
curl -sLO $GET_PIP_URL
@@ -87,7 +89,6 @@ function build_cpythons {
8789
rm -f get-pip.py
8890
}
8991

90-
9192
mkdir -p /opt/python
9293
mkdir -p /opt/_internal
9394
build_cpythons $CPYTHON_VERSIONS

0 commit comments

Comments
 (0)