From 1637957eb1cf4ad4afeec85eef1ccd6971fc0234 Mon Sep 17 00:00:00 2001 From: Pranav Rathi <4427674+pranavrth@users.noreply.github.com> Date: Wed, 8 May 2024 14:19:35 +0530 Subject: [PATCH 1/4] Added script to install confluent_kafka module and do a sanity test with multiple python versions. --- tools/RELEASE.md | 24 ++++++++++++---- tools/test-released-wheels.sh | 54 +++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 6 deletions(-) create mode 100755 tools/test-released-wheels.sh diff --git a/tools/RELEASE.md b/tools/RELEASE.md index 72bc622d2..c755322bb 100644 --- a/tools/RELEASE.md +++ b/tools/RELEASE.md @@ -11,7 +11,7 @@ v0.11.4rc3 for the 3rd v0.11.4 release candidate. With the addition of prebuilt binary wheels we make use of Semaphore CI to build OSX, Linux and Windows binaries which are uploaded to build's artifact directory. These artifacts are downloaded and then uploaded manually -to PyPi. +to PyPI. **Note**: Python package versions use a lowercase `rcN` suffix to indicate release candidates while librdkafka uses `-RCN`. The Python format @@ -36,10 +36,10 @@ time line: * Create test tag to trigger CI builds, test. * Work out any release build issues. * librdkafka is released, update librdkafka version. - * Create release candidate tag, wait for CI builds, deploy to test-PyPi. + * Create release candidate tag, wait for CI builds, deploy to test-PyPI. * Create PR, get it reviewed. * When it is time for final release, merge the PR. - * On master, create release tag, wait for CI builds, deploy to PyPi. + * On master, create release tag, wait for CI builds, deploy to PyPI. * Update confluent.io docs. * Announce release. @@ -290,7 +290,7 @@ With the PR merged to master, check out and update master: Now go back to 5.1 and start the final RELEASE ITERATION. -### 5.6. Upload wheel packages to PyPi +### 5.6. Upload wheel packages to PyPI **CANDIDATE ITERATION:** To upload binary packages to test.pypi.org, use: @@ -301,7 +301,7 @@ Now go back to 5.1 and start the final RELEASE ITERATION. $ twine upload dl-v0.11.4rc1/* -### 5.7. Upload source packages to PyPi +### 5.7. Upload source packages to PyPI When uploading source packages make sure to have checked out the correct tag and that you do not have any uncommited modifications and that the `build/` @@ -316,7 +316,19 @@ directory is empty. $ python setup.py sdist upload -### 5.8. Verify installation from PyPi +### 5.8. Verify installation from PyPI + +#### New way + +Use `tools/test-released-wheels` script to test installation from PyPI + +**CANDIDATE ITERATION:** + $ ./tools/test-released-wheels 0.11.4rc1 test + +**RELEASE ITERATION:** + $ ./tools/test-released-wheels 0.11.4 + +#### Old way In the same virtualenv as created above: diff --git a/tools/test-released-wheels.sh b/tools/test-released-wheels.sh new file mode 100755 index 000000000..cf2c5f7e6 --- /dev/null +++ b/tools/test-released-wheels.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +set -e + +# Check if an argument is present +if [ -z "$1" ]; then + echo "Please provide a version of confluent_kafka to install." + exit 1 +fi + +# Check if pyenv is installed +if ! command -v pyenv &> /dev/null; then + echo "pyenv is not installed. Please install pyenv before running this script." + exit 1 +fi + +# List of Python versions to run the code with +python_versions=("3.6.15" "3.7.17" "3.8.18" "3.9.18" "3.10.11" "3.11.7" "3.12.1") + +eval "$(pyenv init -)" + + +# Loop through each Python version and execute the code +for version in "${python_versions[@]}"; do + + echo -e "\e[1;34mRunning with Python version $version in env $environment_name \e[0m" + + echo Installing python $version + pyenv install -s $version > /dev/null 2>&1 + + echo Using $version + pyenv shell $version > /dev/null 2>&1 + + echo Python version: `python -V` + echo Pip version: `pip -V` + + echo "Uninstalling confluent_kafka if already installed" + pip uninstall -y confluent_kafka > /dev/null 2>&1 || true + + if [ "$2" = "test" ]; then + echo "Installing confluent_kafka from test PyPI" + pip install --index-url https://test.pypi.org/simple/ confluent_kafka==$1 > /dev/null 2>&1 + else + echo "Installing confluent_kafka" + pip install confluent_kafka==$1 > /dev/null 2>&1 + fi + + echo "Testing confluent_kafka" + output=$(python -c 'import confluent_kafka as ck ; print("py:", ck.version(), "c:", ck.libversion())') + echo -e "\e[1;32m$output\e[0m" + echo "Successfully tested confluent_kafka version $1 with Python version $version" + echo + echo +done From 9a892888c21162804930fa601a6a614efb10d8f7 Mon Sep 17 00:00:00 2001 From: Pranav Rathi <4427674+pranavrth@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:41:55 +0530 Subject: [PATCH 2/4] Pip update before installing --- tools/test-released-wheels.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/test-released-wheels.sh b/tools/test-released-wheels.sh index cf2c5f7e6..9a6a3bd8c 100755 --- a/tools/test-released-wheels.sh +++ b/tools/test-released-wheels.sh @@ -34,6 +34,8 @@ for version in "${python_versions[@]}"; do echo Python version: `python -V` echo Pip version: `pip -V` + pip install --upgrade pip + echo "Uninstalling confluent_kafka if already installed" pip uninstall -y confluent_kafka > /dev/null 2>&1 || true From 8b7f565df0a3372bb0b24edefdb931fc05fc9dfe Mon Sep 17 00:00:00 2001 From: Pranav Rathi <4427674+pranavrth@users.noreply.github.com> Date: Mon, 14 Oct 2024 12:03:11 +0530 Subject: [PATCH 3/4] Added 3.13 python --- tools/test-released-wheels.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/test-released-wheels.sh b/tools/test-released-wheels.sh index 9a6a3bd8c..95272eaf2 100755 --- a/tools/test-released-wheels.sh +++ b/tools/test-released-wheels.sh @@ -15,7 +15,7 @@ if ! command -v pyenv &> /dev/null; then fi # List of Python versions to run the code with -python_versions=("3.6.15" "3.7.17" "3.8.18" "3.9.18" "3.10.11" "3.11.7" "3.12.1") +python_versions=("3.6.15" "3.7.17" "3.8.18" "3.9.18" "3.10.11" "3.11.7" "3.12.1" "3.13.0") eval "$(pyenv init -)" @@ -44,7 +44,7 @@ for version in "${python_versions[@]}"; do pip install --index-url https://test.pypi.org/simple/ confluent_kafka==$1 > /dev/null 2>&1 else echo "Installing confluent_kafka" - pip install confluent_kafka==$1 > /dev/null 2>&1 + pip install confluent_kafka==$1 fi echo "Testing confluent_kafka" From 18de5f824d1aa442329ea19326cd9a0d433d8a0e Mon Sep 17 00:00:00 2001 From: Pranav Rathi <4427674+pranavrth@users.noreply.github.com> Date: Mon, 18 Nov 2024 21:45:49 +0530 Subject: [PATCH 4/4] Removed python 3.6 --- tools/test-released-wheels.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test-released-wheels.sh b/tools/test-released-wheels.sh index 95272eaf2..993a9ae78 100755 --- a/tools/test-released-wheels.sh +++ b/tools/test-released-wheels.sh @@ -15,7 +15,7 @@ if ! command -v pyenv &> /dev/null; then fi # List of Python versions to run the code with -python_versions=("3.6.15" "3.7.17" "3.8.18" "3.9.18" "3.10.11" "3.11.7" "3.12.1" "3.13.0") +python_versions=("3.7.17" "3.8.18" "3.9.18" "3.10.11" "3.11.7" "3.12.1" "3.13.0") eval "$(pyenv init -)"