Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding py311 validations for wheel builds #1262

Merged
merged 1 commit into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plan is to do all packages and the full check_binary in a follow up right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, once we have torchvision and torchaudio with 3.11 we will remove torchonly option

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw if you have issues with pip missing for some versions, you can add --with-ensurepip=install to this

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