From d714ae72e798dfde03ce55b709465fbb71f39fa6 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Tue, 18 Jul 2023 12:56:16 -0700 Subject: [PATCH] [dependency] Restrict cython to less than 3.X (#33738) This should resolve breakage on master caused by the jump to Cython 3.0.0 this morning. --- requirements.txt | 2 +- setup.py | 2 +- ...install_python_for_wheel_crosscompilation.sh | 2 +- ...python_manylinux2014_aarch64.current_version | 2 +- .../Dockerfile | 12 ++++++------ ...act_python_manylinux2014_x64.current_version | 2 +- .../Dockerfile | 12 ++++++------ ...act_python_manylinux2014_x86.current_version | 2 +- .../Dockerfile | 12 ++++++------ ...act_python_musllinux_1_1_x64.current_version | 2 +- .../Dockerfile | 12 ++++++------ ...act_python_musllinux_1_1_x86.current_version | 2 +- .../Dockerfile | 12 ++++++------ .../helper_scripts/.requirements.macos.txt.swo | Bin 0 -> 12288 bytes .../helper_scripts/requirements.macos.txt | 3 ++- .../macos/grpc_distribtests_python.sh | 10 +++++----- .../artifacts/build_artifact_python.bat | 2 +- .../artifacts/build_artifact_python.sh | 2 +- tools/run_tests/helper_scripts/build_python.sh | 2 +- 19 files changed, 48 insertions(+), 47 deletions(-) create mode 100644 tools/internal_ci/helper_scripts/.requirements.macos.txt.swo diff --git a/requirements.txt b/requirements.txt index 603db125747..05390850559 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # GRPC Python setup requirements coverage>=4.0 -cython>=0.29.8 +cython>=0.29.8,<3.0.0rc1 protobuf>=4.21.3,<5.0dev wheel>=0.29 diff --git a/setup.py b/setup.py index 57364bfb044..1948a4160b3 100644 --- a/setup.py +++ b/setup.py @@ -586,7 +586,7 @@ except ImportError: sys.stderr.write( "We could not find Cython. Setup may take 10-20 minutes.\n" ) - SETUP_REQUIRES += ("cython>=0.23",) + SETUP_REQUIRES += ("cython>=0.23,<3.0.0rc1",) COMMAND_CLASS = { "doc": commands.SphinxDocumentation, diff --git a/tools/dockerfile/grpc_artifact_python_linux_armv7/install_python_for_wheel_crosscompilation.sh b/tools/dockerfile/grpc_artifact_python_linux_armv7/install_python_for_wheel_crosscompilation.sh index b5f9a56a57b..08c6439d36a 100755 --- a/tools/dockerfile/grpc_artifact_python_linux_armv7/install_python_for_wheel_crosscompilation.sh +++ b/tools/dockerfile/grpc_artifact_python_linux_armv7/install_python_for_wheel_crosscompilation.sh @@ -44,4 +44,4 @@ popd rm -rf "Python-${PYTHON_VERSION}" # install cython and wheel -"${PYTHON_PREFIX}/bin/python3" -m pip install --upgrade cython wheel +"${PYTHON_PREFIX}/bin/python3" -m pip install --upgrade 'cython<3.0.0rc1' wheel diff --git a/tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64.current_version b/tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64.current_version index 0e79fda49d6..59a73a20c4e 100644 --- a/tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64.current_version +++ b/tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_manylinux2014_aarch64:8f31a9a0d9098577fa01bacbfc2940e7894fa0bd@sha256:9ea49947ec64337cdd40086912b59ace394179f87cf42531a077c5e5b86c1fe0 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_manylinux2014_aarch64:6e2cf9602baccda05d82402885660e028cc3ebc6@sha256:d56ea4394ea5ea9d09f940d1dba31e6196a8e919f60c6a4966a9192faa997f11 diff --git a/tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64/Dockerfile b/tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64/Dockerfile index f1648cd1bf8..db73c543fc3 100644 --- a/tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64/Dockerfile +++ b/tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64/Dockerfile @@ -19,12 +19,12 @@ ENV AUDITWHEEL_PLAT manylinux_2_17_$AUDITWHEEL_ARCH ################################### # Install Python build requirements -RUN /opt/python/cp36-cp36m/bin/pip install --upgrade cython -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 +RUN /opt/python/cp36-cp36m/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp37-cp37m/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp38-cp38/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp39-cp39/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp310-cp310/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp311-cp311/bin/pip install --upgrade 'cython<3.0.0rc1' #================= # Install ccache diff --git a/tools/dockerfile/grpc_artifact_python_manylinux2014_x64.current_version b/tools/dockerfile/grpc_artifact_python_manylinux2014_x64.current_version index a9c42de4b0d..80f2efc75f2 100644 --- a/tools/dockerfile/grpc_artifact_python_manylinux2014_x64.current_version +++ b/tools/dockerfile/grpc_artifact_python_manylinux2014_x64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_manylinux2014_x64:1949ee70cc9de7ec0ed7ed3c209c0a67a3c17778@sha256:84e0b37c7f61aebff44877993ec678f0e34869e70bca651f1cbd0e46485454b4 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_manylinux2014_x64:0af99bbd5b3f24218f6009df916a19fd7cb4f11c@sha256:67ab746e6da576606ebf41ad81027ad897544445fb93d5d5ca5f9d9b5428ec84 \ No newline at end of file diff --git a/tools/dockerfile/grpc_artifact_python_manylinux2014_x64/Dockerfile b/tools/dockerfile/grpc_artifact_python_manylinux2014_x64/Dockerfile index ffccd995a78..e9f8c534c15 100644 --- a/tools/dockerfile/grpc_artifact_python_manylinux2014_x64/Dockerfile +++ b/tools/dockerfile/grpc_artifact_python_manylinux2014_x64/Dockerfile @@ -24,12 +24,12 @@ RUN yum update -y && yum install -y curl-devel expat-devel gettext-devel openssl ################################### # Install Python build requirements -RUN /opt/python/cp36-cp36m/bin/pip install --upgrade cython -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 +RUN /opt/python/cp36-cp36m/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp37-cp37m/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp38-cp38/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp39-cp39/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp310-cp310/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp311-cp311/bin/pip install --upgrade 'cython<3.0.0rc1' #================= # Install ccache diff --git a/tools/dockerfile/grpc_artifact_python_manylinux2014_x86.current_version b/tools/dockerfile/grpc_artifact_python_manylinux2014_x86.current_version index a7e51e7ecd8..60ded4cf1e3 100644 --- a/tools/dockerfile/grpc_artifact_python_manylinux2014_x86.current_version +++ b/tools/dockerfile/grpc_artifact_python_manylinux2014_x86.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_manylinux2014_x86:49c7d242fed1a39ec7fe70c4be38de0cf4cb3006@sha256:c8789d88510b51b24bfaa21a91f0d21a4a5269f800bafd2c6c9626d628e93a6a \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_manylinux2014_x86:904b062b982ad12aad91173e2fc7809fd44c3924@sha256:993a963ac3985f8634951e1573d34e24b3868dfff3ad4ae4875dd2c47b73224f \ No newline at end of file diff --git a/tools/dockerfile/grpc_artifact_python_manylinux2014_x86/Dockerfile b/tools/dockerfile/grpc_artifact_python_manylinux2014_x86/Dockerfile index 052c196672b..c5435575fca 100644 --- a/tools/dockerfile/grpc_artifact_python_manylinux2014_x86/Dockerfile +++ b/tools/dockerfile/grpc_artifact_python_manylinux2014_x86/Dockerfile @@ -24,12 +24,12 @@ RUN yum update -y && yum install -y curl-devel expat-devel gettext-devel openssl ################################### # Install Python build requirements -RUN /opt/python/cp36-cp36m/bin/pip install --upgrade cython -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 +RUN /opt/python/cp36-cp36m/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp37-cp37m/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp38-cp38/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp39-cp39/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp310-cp310/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp311-cp311/bin/pip install --upgrade 'cython<3.0.0rc1' #================= # Install ccache diff --git a/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64.current_version b/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64.current_version index 1fd70005a13..0393c743da0 100644 --- a/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64.current_version +++ b/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_musllinux_1_1_x64:4b82ff22628795496952f54307ac84e3e82feca3@sha256:d357a7d75a41261251db35a41e8fbcef5c710e1b39d91f1c3d9503bf738b8203 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_musllinux_1_1_x64:0807f8211c3f381efa8684232c087c98a4ca7cb8@sha256:09bf18cc793d55cfc48d8e88b8b6e6914e9df2b35ec417fe77a4e20bfa251df7 \ No newline at end of file diff --git a/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64/Dockerfile b/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64/Dockerfile index c0166713d3e..b19d6ca28a5 100644 --- a/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64/Dockerfile +++ b/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64/Dockerfile @@ -16,12 +16,12 @@ FROM quay.io/pypa/musllinux_1_1_x86_64:2022-08-29-0fd77fa ################################### # Install Python build requirements -RUN /opt/python/cp36-cp36m/bin/pip install --upgrade cython -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 +RUN /opt/python/cp36-cp36m/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp37-cp37m/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp38-cp38/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp39-cp39/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp310-cp310/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp311-cp311/bin/pip install --upgrade 'cython<3.0.0rc1' #================= # Install ccache diff --git a/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86.current_version b/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86.current_version index b3583c8cc56..4c64f34c70a 100644 --- a/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86.current_version +++ b/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_musllinux_1_1_x86:178208f98536cdd71ebdfff92fd81b0a8f77c326@sha256:5f323fa0e66211a8f8c836cac34e7f95eec233e0a3248ea191bb5231588c5efa \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_musllinux_1_1_x86:3bc3eacb8eb4ebce5d13a2d4ecabba9074511d48@sha256:0512449e7d218c7687eb447701c8c6a33153a722722b76b2423ec58440a027de \ No newline at end of file diff --git a/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86/Dockerfile b/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86/Dockerfile index 9b9553d8dce..0384dfa1fe0 100644 --- a/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86/Dockerfile +++ b/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86/Dockerfile @@ -16,12 +16,12 @@ FROM quay.io/pypa/musllinux_1_1_i686:2022-08-29-0fd77fa ################################### # Install Python build requirements -RUN /opt/python/cp36-cp36m/bin/pip install --upgrade cython -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 +RUN /opt/python/cp36-cp36m/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp37-cp37m/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp38-cp38/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp39-cp39/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp310-cp310/bin/pip install --upgrade 'cython<3.0.0rc1' +RUN /opt/python/cp311-cp311/bin/pip install --upgrade 'cython<3.0.0rc1' #================= # Install ccache diff --git a/tools/internal_ci/helper_scripts/.requirements.macos.txt.swo b/tools/internal_ci/helper_scripts/.requirements.macos.txt.swo new file mode 100644 index 0000000000000000000000000000000000000000..49183e0d9d26dc6e5be1a439672b5d53a05cab4a GIT binary patch literal 12288 zcmeI&ze)o!90%~!!A+F<0#)bBU9VacyuneiSg3#KRIYdN8b~iONsH&8vrixh4nBmV zo4YUI133B!=A?zcH;L{u zA=sFgkA7;?JZi>*CQ>V!Ntp@e#>3gV>uI8&vaz3OmH1XlVSJujrt?_z67CO}P)zqs zqPeoh*X&}%H5;F1mZI!zkLKn=VBaM~da0j#~%=8n~5q lad38AZc$DWT_`Iv9jieRMGaTdBuQZhGT&{ugg_^C@(G2OV+jBN literal 0 HcmV?d00001 diff --git a/tools/internal_ci/helper_scripts/requirements.macos.txt b/tools/internal_ci/helper_scripts/requirements.macos.txt index 35572fb7b5a..8f8d1d2141c 100644 --- a/tools/internal_ci/helper_scripts/requirements.macos.txt +++ b/tools/internal_ci/helper_scripts/requirements.macos.txt @@ -1,5 +1,6 @@ +cython<3.0.0rc1 cryptography==3.4.6 PyJWT==2.0.1 pyOpenSSL==20.0.1 -PyYAML==5.4.1 +PyYAML==6.0 requests==2.25.1 diff --git a/tools/internal_ci/macos/grpc_distribtests_python.sh b/tools/internal_ci/macos/grpc_distribtests_python.sh index e60aadaf0a4..0361cae4ca3 100644 --- a/tools/internal_ci/macos/grpc_distribtests_python.sh +++ b/tools/internal_ci/macos/grpc_distribtests_python.sh @@ -26,11 +26,11 @@ source tools/internal_ci/helper_scripts/prepare_build_macos_rc # TODO(jtattermusch): cleanup this prepare build step (needed for python artifact build) # install cython for all python versions -python3.7 -m pip install -U cython setuptools==65.4.1 wheel --user -python3.8 -m pip install -U cython setuptools==65.4.1 wheel --user -python3.9 -m pip install -U cython setuptools==65.4.1 wheel --user -python3.10 -m pip install -U cython setuptools==65.4.1 wheel --user -python3.11 -m pip install -U cython setuptools==65.4.1 wheel --user +python3.7 -m pip install -U 'cython<3.0.0rc1' setuptools==65.4.1 wheel --user +python3.8 -m pip install -U 'cython<3.0.0rc1' setuptools==65.4.1 wheel --user +python3.9 -m pip install -U 'cython<3.0.0rc1' setuptools==65.4.1 wheel --user +python3.10 -m pip install -U 'cython<3.0.0rc1' setuptools==65.4.1 wheel --user +python3.11 -m pip install -U 'cython<3.0.0rc1' setuptools==65.4.1 wheel --user # Build all python macos artifacts (this step actually builds all the binary wheels and source archives) tools/run_tests/task_runner.py -f artifact macos python ${TASK_RUNNER_EXTRA_FILTERS} -j 4 -x build_artifacts/sponge_log.xml || FAILED="true" diff --git a/tools/run_tests/artifacts/build_artifact_python.bat b/tools/run_tests/artifacts/build_artifact_python.bat index a74c39f9b0b..e74b80e27c0 100644 --- a/tools/run_tests/artifacts/build_artifact_python.bat +++ b/tools/run_tests/artifacts/build_artifact_python.bat @@ -22,7 +22,7 @@ set PATH=C:\msys64\mingw%2\bin;C:\tools\msys64\mingw%2\bin;%PATH% python -m pip install --upgrade six @rem some artifacts are broken for setuptools 38.5.0. See https://github.com/grpc/grpc/issues/14317 python -m pip install --upgrade setuptools==44.1.1 -python -m pip install --upgrade cython +python -m pip install --upgrade "cython<3.0.0rc1" python -m pip install -rrequirements.txt --user @rem set GRPC_PYTHON_OVERRIDE_CYGWIN_DETECTION_FOR_27=1 diff --git a/tools/run_tests/artifacts/build_artifact_python.sh b/tools/run_tests/artifacts/build_artifact_python.sh index 0d84f24df43..75c4c890742 100755 --- a/tools/run_tests/artifacts/build_artifact_python.sh +++ b/tools/run_tests/artifacts/build_artifact_python.sh @@ -37,7 +37,7 @@ then # Any installation step is a potential source of breakages, # so we are trying to perform as few download-and-install operations # as possible. - "${PYTHON}" -m pip install --upgrade cython + "${PYTHON}" -m pip install --upgrade 'cython<3.0.0rc1' fi # Allow build_ext to build C/C++ files in parallel diff --git a/tools/run_tests/helper_scripts/build_python.sh b/tools/run_tests/helper_scripts/build_python.sh index 4f40fe7b438..5057b642c9c 100755 --- a/tools/run_tests/helper_scripts/build_python.sh +++ b/tools/run_tests/helper_scripts/build_python.sh @@ -164,7 +164,7 @@ pip_install_dir_and_deps() { pip_install -U gevent -pip_install --upgrade cython +pip_install --upgrade 'cython<3.0.0rc1' pip_install --upgrade six 'protobuf>=4.21.3rc1,!=4.22.0.*' if [ "$("$VENV_PYTHON" -c "import sys; print(sys.version_info[0])")" == "2" ]