Skip to content

Commit

Permalink
Support Python 3.11 (#30818)
Browse files Browse the repository at this point in the history
* Support Python 3.11

* Update build images for 3.11

* Whoopsie

* The architecture of this thing is garbage

* Silence ownership warning

* Account for change in git behavior

* Fix directory

* I am in great pain

* Update Windows and arm linux

* Agh

* Clean up
  • Loading branch information
gnossen committed Sep 12, 2022
1 parent d7cce32 commit 2297249
Show file tree
Hide file tree
Showing 19 changed files with 73 additions and 18 deletions.
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -105,6 +105,7 @@
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'License :: OSI Approved :: Apache Software License',
]

Expand Down
2 changes: 1 addition & 1 deletion src/python/grpcio/README.rst
Expand Up @@ -10,7 +10,7 @@ Package for gRPC Python.

Supported Python Versions
-------------------------
Python >= 3.6
Python >= 3.7

Installation
------------
Expand Down
2 changes: 1 addition & 1 deletion src/python/grpcio_channelz/README.rst
Expand Up @@ -5,7 +5,7 @@ Channelz is a live debug tool in gRPC Python.

Supported Python Versions
-------------------------
Python >= 3.6
Python >= 3.7

Dependencies
------------
Expand Down
1 change: 1 addition & 0 deletions src/python/grpcio_channelz/setup.py
Expand Up @@ -55,6 +55,7 @@ def run(self):
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'License :: OSI Approved :: Apache Software License',
]

Expand Down
2 changes: 1 addition & 1 deletion src/python/grpcio_health_checking/README.rst
Expand Up @@ -5,7 +5,7 @@ Reference package for GRPC Python health checking.

Supported Python Versions
-------------------------
Python >= 3.6
Python >= 3.7

Dependencies
------------
Expand Down
1 change: 1 addition & 0 deletions src/python/grpcio_health_checking/setup.py
Expand Up @@ -54,6 +54,7 @@ def run(self):
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'License :: OSI Approved :: Apache Software License',
]

Expand Down
2 changes: 1 addition & 1 deletion src/python/grpcio_reflection/README.rst
Expand Up @@ -5,7 +5,7 @@ Reference package for reflection in GRPC Python.

Supported Python Versions
-------------------------
Python >= 3.6
Python >= 3.7

Dependencies
------------
Expand Down
1 change: 1 addition & 0 deletions src/python/grpcio_reflection/setup.py
Expand Up @@ -55,6 +55,7 @@ def run(self):
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'License :: OSI Approved :: Apache Software License',
]

Expand Down
2 changes: 1 addition & 1 deletion src/python/grpcio_status/README.rst
Expand Up @@ -5,7 +5,7 @@ Reference package for GRPC Python status proto mapping.

Supported Python Versions
-------------------------
Python >= 3.6
Python >= 3.7

Dependencies
------------
Expand Down
1 change: 1 addition & 0 deletions src/python/grpcio_status/setup.py
Expand Up @@ -54,6 +54,7 @@ def run(self):
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'License :: OSI Approved :: Apache Software License',
]

Expand Down
2 changes: 1 addition & 1 deletion src/python/grpcio_testing/README.rst
Expand Up @@ -5,7 +5,7 @@ Testing utilities for gRPC Python

Supported Python Versions
-------------------------
Python >= 3.6
Python >= 3.7

Dependencies
------------
Expand Down
3 changes: 3 additions & 0 deletions tools/dockerfile/grpc_artifact_python_linux_armv7/Dockerfile
Expand Up @@ -27,6 +27,7 @@ RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.7.10" "3.7.10" /opt
RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.8.8" "3.8.8" /opt/python/cp38-cp38
RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.9.2" "3.9.2" /opt/python/cp39-cp39
RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.10.0" "3.10.0rc1" /opt/python/cp310-cp310
RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.11.0" "3.11.0rc1" /opt/python/cp311-cp311

ENV AUDITWHEEL_ARCH armv7l
ENV AUDITWHEEL_PLAT linux_armv7l
Expand Down Expand Up @@ -59,3 +60,5 @@ ENV CXX ${CROSS_TRIPLE}-g++
# truncate it.
# TODO(jtattermusch): Remove this hack when possible.
RUN echo "# file contents removed to avoid resetting PATH set by the docker image" >/etc/profile

RUN git config --global --add safe.directory /var/local/jenkins/grpc
Expand Up @@ -14,7 +14,7 @@

# Docker file for building gRPC manylinux Python artifacts.

FROM quay.io/pypa/manylinux2014_x86_64:2021-08-26-12e5da0
FROM quay.io/pypa/manylinux2014_x86_64:2022-08-29-0fd77fa

# manylinux_2_17 is the preferred alias of manylinux2014
ENV AUDITWHEEL_PLAT manylinux_2_17_$AUDITWHEEL_ARCH
Expand All @@ -29,6 +29,7 @@ RUN /opt/python/cp37-cp37m/bin/pip install --upgrade cython
RUN /opt/python/cp38-cp38/bin/pip install --upgrade cython
RUN /opt/python/cp39-cp39/bin/pip install --upgrade cython
RUN /opt/python/cp310-cp310/bin/pip install --upgrade cython
RUN /opt/python/cp311-cp311/bin/pip install --upgrade cython

#=================
# Install ccache
Expand All @@ -43,3 +44,5 @@ RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/downloa
&& make -j4 && make install \
&& cd ../.. \
&& rm -rf ccache-4.5.1 ccache.tar.gz

RUN git config --global --add safe.directory /var/local/jenkins/grpc
Expand Up @@ -14,7 +14,7 @@

# Docker file for building gRPC manylinux Python artifacts.

FROM quay.io/pypa/manylinux2014_i686:2021-08-26-12e5da0
FROM quay.io/pypa/manylinux2014_i686:2022-08-29-0fd77fa

# manylinux_2_17 is the preferred alias of manylinux2014
ENV AUDITWHEEL_PLAT manylinux_2_17_$AUDITWHEEL_ARCH
Expand All @@ -29,6 +29,7 @@ RUN /opt/python/cp37-cp37m/bin/pip install --upgrade cython
RUN /opt/python/cp38-cp38/bin/pip install --upgrade cython
RUN /opt/python/cp39-cp39/bin/pip install --upgrade cython
RUN /opt/python/cp310-cp310/bin/pip install --upgrade cython
RUN /opt/python/cp311-cp311/bin/pip install --upgrade cython

#=================
# Install ccache
Expand All @@ -42,4 +43,7 @@ RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/downloa
&& cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
&& make -j4 && make install \
&& cd ../.. \
&& rm -rf ccache-4.5.1 ccache.tar.gz
&& rm -rf ccache-4.5.1 ccache.tar.gz


RUN git config --global --add safe.directory /var/local/jenkins/grpc
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM quay.io/pypa/musllinux_1_1_x86_64:2021-11-15-a808c18
FROM quay.io/pypa/musllinux_1_1_x86_64:2022-08-29-0fd77fa

###################################
# Install Python build requirements
Expand All @@ -21,6 +21,7 @@ RUN /opt/python/cp37-cp37m/bin/pip install --upgrade cython
RUN /opt/python/cp38-cp38/bin/pip install --upgrade cython
RUN /opt/python/cp39-cp39/bin/pip install --upgrade cython
RUN /opt/python/cp310-cp310/bin/pip install --upgrade cython
RUN /opt/python/cp311-cp311/bin/pip install --upgrade cython

#=================
# Install ccache
Expand All @@ -35,3 +36,5 @@ RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/downloa
&& make -j4 && make install \
&& cd ../.. \
&& rm -rf ccache-4.5.1 ccache.tar.gz

RUN git config --global --add safe.directory /var/local/jenkins/grpc
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM quay.io/pypa/musllinux_1_1_i686:2021-11-15-a808c18
FROM quay.io/pypa/musllinux_1_1_i686:2022-08-29-0fd77fa

###################################
# Install Python build requirements
Expand All @@ -21,6 +21,7 @@ RUN /opt/python/cp37-cp37m/bin/pip install --upgrade cython
RUN /opt/python/cp38-cp38/bin/pip install --upgrade cython
RUN /opt/python/cp39-cp39/bin/pip install --upgrade cython
RUN /opt/python/cp310-cp310/bin/pip install --upgrade cython
RUN /opt/python/cp311-cp311/bin/pip install --upgrade cython

#=================
# Install ccache
Expand All @@ -35,3 +36,5 @@ RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/downloa
&& make -j4 && make install \
&& cd ../.. \
&& rm -rf ccache-4.5.1 ccache.tar.gz

RUN git config --global --add safe.directory /var/local/jenkins/grpc
17 changes: 17 additions & 0 deletions tools/internal_ci/helper_scripts/install_python_interpreters.ps1
Expand Up @@ -111,3 +111,20 @@ $Python310x64Config = @{
PythonInstallerHash = "9ea305690dbfd424a632b6a659347c1e"
}
Install-Python @Python310x64Config

# Python 3.11
$Python311x86Config = @{
PythonVersion = "3.11.0"
PythonInstaller = "python-3.11.0rc1"
PythonInstallPath = "C:\Python311_32bit"
PythonInstallerHash = "d2e5420e53d9e71c82b4a19763dbaa12"
}
Install-Python @Python311x86Config

$Python311x64Config = @{
PythonVersion = "3.11.0"
PythonInstaller = "python-3.11.0rc1-amd64"
PythonInstallPath = "C:\Python311"
PythonInstallerHash = "5943d8702e40a5ccd62e5a8d4c8852aa"
}
Install-Python @Python311x64Config
8 changes: 8 additions & 0 deletions tools/internal_ci/helper_scripts/prepare_build_macos_rc
Expand Up @@ -159,6 +159,14 @@ then
shasum -c /tmp/python_installer_checksum.sha256
time sudo installer -pkg ./python-3.10.5-macos11.pkg -target /
fi

# Install Python 3.11 if it doesn't exist
if [ ! -f "/usr/local/bin/python3.11" ]; then
time curl -O https://www.python.org/ftp/python/3.11.0/python-3.11.0rc1-macos11.pkg
echo "eec3f817797b1d61f48f29b96ac0443ea19f3170 python-3.11.0rc1-macos11.pkg" > /tmp/python_installer_checksum.sha256
shasum -c /tmp/python_installer_checksum.sha256
time sudo installer -pkg ./python-3.11.0rc1-macos11.pkg -target /
fi
fi

if [ "${PREPARE_BUILD_INSTALL_DEPS_CSHARP}" == "true" ]
Expand Down
23 changes: 16 additions & 7 deletions tools/run_tests/artifacts/artifact_targets.py
Expand Up @@ -441,40 +441,49 @@ def targets():
PythonArtifact('manylinux2014', 'x64', 'cp37-cp37m', presubmit=True),
PythonArtifact('manylinux2014', 'x64', 'cp38-cp38', presubmit=True),
PythonArtifact('manylinux2014', 'x64', 'cp39-cp39'),
PythonArtifact('manylinux2014', 'x64', 'cp310-cp310', presubmit=True),
PythonArtifact('manylinux2014', 'x64', 'cp310-cp310'),
PythonArtifact('manylinux2014', 'x64', 'cp311-cp311', presubmit=True),
PythonArtifact('manylinux2014', 'x86', 'cp37-cp37m', presubmit=True),
PythonArtifact('manylinux2014', 'x86', 'cp38-cp38', presubmit=True),
PythonArtifact('manylinux2014', 'x86', 'cp39-cp39'),
PythonArtifact('manylinux2014', 'x86', 'cp310-cp310', presubmit=True),
PythonArtifact('manylinux2014', 'x86', 'cp310-cp310'),
PythonArtifact('manylinux2014', 'x86', 'cp311-cp311', presubmit=True),
PythonArtifact('manylinux2014', 'aarch64', 'cp37-cp37m',
presubmit=True),
PythonArtifact('manylinux2014', 'aarch64', 'cp38-cp38', presubmit=True),
PythonArtifact('manylinux2014', 'aarch64', 'cp39-cp39'),
PythonArtifact('manylinux2014', 'aarch64', 'cp310-cp310'),
# TODO(https://github.com/grpc/grpc/issues/30927): Support aarch64 with 3.11. Blocked on dockcross support.
PythonArtifact('linux_extra', 'armv7', 'cp37-cp37m', presubmit=True),
PythonArtifact('linux_extra', 'armv7', 'cp38-cp38'),
PythonArtifact('linux_extra', 'armv7', 'cp39-cp39'),
PythonArtifact('linux_extra', 'armv7', 'cp310-cp310', presubmit=True),
PythonArtifact('musllinux_1_1', 'x64', 'cp310-cp310', presubmit=True),
PythonArtifact('linux_extra', 'armv7', 'cp310-cp310'),
PythonArtifact('linux_extra', 'armv7', 'cp311-cp311', presubmit=True),
PythonArtifact('musllinux_1_1', 'x64', 'cp310-cp310'),
PythonArtifact('musllinux_1_1', 'x64', 'cp311-cp311', presubmit=True),
PythonArtifact('musllinux_1_1', 'x64', 'cp37-cp37m', presubmit=True),
PythonArtifact('musllinux_1_1', 'x64', 'cp38-cp38'),
PythonArtifact('musllinux_1_1', 'x64', 'cp39-cp39'),
PythonArtifact('musllinux_1_1', 'x86', 'cp310-cp310', presubmit=True),
PythonArtifact('musllinux_1_1', 'x86', 'cp310-cp310'),
PythonArtifact('musllinux_1_1', 'x86', 'cp311-cp311', presubmit=True),
PythonArtifact('musllinux_1_1', 'x86', 'cp37-cp37m', presubmit=True),
PythonArtifact('musllinux_1_1', 'x86', 'cp38-cp38'),
PythonArtifact('musllinux_1_1', 'x86', 'cp39-cp39'),
PythonArtifact('macos', 'x64', 'python3.7', presubmit=True),
PythonArtifact('macos', 'x64', 'python3.8'),
PythonArtifact('macos', 'x64', 'python3.9'),
PythonArtifact('macos', 'x64', 'python3.10', presubmit=True),
PythonArtifact('macos', 'x64', 'python3.11', presubmit=True),
PythonArtifact('windows', 'x86', 'Python37_32bit', presubmit=True),
PythonArtifact('windows', 'x86', 'Python38_32bit'),
PythonArtifact('windows', 'x86', 'Python39_32bit'),
PythonArtifact('windows', 'x86', 'Python310_32bit', presubmit=True),
PythonArtifact('windows', 'x86', 'Python310_32bit'),
PythonArtifact('windows', 'x86', 'Python311_32bit', presubmit=True),
PythonArtifact('windows', 'x64', 'Python37', presubmit=True),
PythonArtifact('windows', 'x64', 'Python38'),
PythonArtifact('windows', 'x64', 'Python39'),
PythonArtifact('windows', 'x64', 'Python310', presubmit=True),
PythonArtifact('windows', 'x64', 'Python310'),
PythonArtifact('windows', 'x64', 'Python311', presubmit=True),
RubyArtifact('linux', 'x86-mingw32', presubmit=True),
RubyArtifact('linux', 'x64-mingw32', presubmit=True),
RubyArtifact('linux', 'x64-mingw-ucrt', presubmit=True),
Expand Down

0 comments on commit 2297249

Please sign in to comment.