Skip to content

Commit

Permalink
Adding py311 validations (#1262)
Browse files Browse the repository at this point in the history
  • Loading branch information
atalman authored Jan 9, 2023
1 parent e2e4542 commit 2a3f8b8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
32 changes: 23 additions & 9 deletions .github/scripts/validate_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,28 @@ if [[ ${PACKAGE_TYPE} == "libtorch" ]]; then
curl ${INSTALLATION} -o libtorch.zip
unzip libtorch.zip
else
conda create -y -n ${ENV_NAME} python=${DESIRED_PYTHON} numpy pillow
conda activate ${ENV_NAME}
export CONDA_LIBRARY_PATH="$(dirname $(which python))/../lib"
export LD_LIBRARY_PATH=$CONDA_LIBRARY_PATH:$LD_LIBRARY_PATH
INSTALLATION=${INSTALLATION/"conda install"/"conda install -y"}
eval $INSTALLATION
python ./test/smoke_test/smoke_test.py
if [[ ${TARGET_OS} != 'macos' && ${TARGET_OS} != 'windows' ]]; then
${PWD}/check_binary.sh
if [ $DESIRED_PYTHON == '3.11' ]; then
export CPYTHON_VERSIONS=3.11.0
sudo yum -y install openssl-devel libssl-dev bzip2-devel libffi-devel
sudo yum -y groupinstall "Development Tools"
export PYTHON_PATH="/opt/_internal/cpython-3.11.0/bin"
export PIP_PATH="${PYTHON_PATH}/pip"
export PIP_INSTALLATION="${INSTALLATION/pip3/"$PIP_PATH"}"
export WITH_OPENSSL="/opt/openssl"
./common/install_cpython.sh
eval ${PYTHON_PATH}/python --version
eval ${PIP_INSTALLATION}
eval ${PYTHON_PATH}/python ./test/smoke_test/smoke_test.py --package torchonly
else
conda create -y -n ${ENV_NAME} python=${DESIRED_PYTHON} numpy pillow
conda activate ${ENV_NAME}
export CONDA_LIBRARY_PATH="$(dirname $(which python))/../lib"
export LD_LIBRARY_PATH=$CONDA_LIBRARY_PATH:$LD_LIBRARY_PATH
INSTALLATION=${INSTALLATION/"conda install"/"conda install -y"}
eval $INSTALLATION
python ./test/smoke_test/smoke_test.py
if [[ ${TARGET_OS} != 'macos' && ${TARGET_OS} != 'windows' ]]; then
${PWD}/check_binary.sh
fi
fi
fi
1 change: 1 addition & 0 deletions .github/workflows/validate-linux-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
package-type: all
os: linux
channel: ${{ inputs.channel }}
with-py311: enable

linux:
needs: generate-linux-matrix
Expand Down
9 changes: 5 additions & 4 deletions common/install_cpython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ function do_cpython_build {
mkdir -p ${prefix}/lib

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

make -j40 > /dev/null
make install > /dev/null
Expand All @@ -61,7 +65,6 @@ function do_cpython_build {
ln -s ${prefix} /opt/python/${abi_tag}
}


function build_cpython {
local py_ver=$1
check_var $py_ver
Expand All @@ -77,7 +80,6 @@ function build_cpython {
rm -f Python-$py_ver.tgz
}


function build_cpythons {
check_var $GET_PIP_URL
curl -sLO $GET_PIP_URL
Expand All @@ -87,7 +89,6 @@ function build_cpythons {
rm -f get-pip.py
}


mkdir -p /opt/python
mkdir -p /opt/_internal
build_cpythons $CPYTHON_VERSIONS

0 comments on commit 2a3f8b8

Please sign in to comment.