Skip to content

Commit

Permalink
Added changes for Python 3.13 wheel generation (#1828)
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavrth authored Oct 10, 2024
1 parent 645b0d5 commit b5c82b9
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 14 deletions.
62 changes: 56 additions & 6 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ global_job_config:
- checkout
- mkdir artifacts
blocks:
- name: "Wheels: OSX x64"
- name: "Wheels: OSX x64 - Python 3.6-3.12"
run:
when: "tag =~ '.*'"
dependencies: []
Expand All @@ -30,10 +30,33 @@ blocks:
jobs:
- name: Build
commands:
- PIP_INSTALL_OPTIONS="--user" tools/wheels/build-wheels.sh "${LIBRDKAFKA_VERSION#v}" wheelhouse
- PIP_INSTALL_OPTIONS="--user" tools/wheels/build-wheels.sh "${LIBRDKAFKA_VERSION#v}" wheelhouse 2.16.2
- tar -czf wheelhouse-macOS-${ARCH}.tgz wheelhouse
- artifact push workflow wheelhouse-macOS-${ARCH}.tgz --destination artifacts/wheels-${OS_NAME}-${ARCH}.tgz/
- name: "Wheels: OSX arm64"
- name: "Wheels: OSX x64 - Python 3.13"
run:
when: "tag =~ '.*'"
dependencies: []
task:
agent:
machine:
type: s1-prod-macos-13-5-amd64
env_vars:
- name: OS_NAME
value: osx
- name: ARCH
value: x64
- name: CIBW_SKIP
value: cp36-* cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*
- name: CIBW_ENVIRONMENT_MACOS
value: MACOSX_DEPLOYMENT_TARGET=13
jobs:
- name: Build
commands:
- PIP_INSTALL_OPTIONS="--user" tools/wheels/build-wheels.sh "${LIBRDKAFKA_VERSION#v}" wheelhouse
- tar -czf wheelhouse-macOS-${ARCH}-py313.tgz wheelhouse
- artifact push workflow wheelhouse-macOS-${ARCH}-py313.tgz --destination artifacts/wheels-${OS_NAME}-${ARCH}-py313.tgz/
- name: "Wheels: OSX arm64 - Python 3.8-3.12"
run:
when: "tag =~ '.*'"
dependencies: []
Expand All @@ -51,9 +74,34 @@ blocks:
jobs:
- name: Build
commands:
- PIP_INSTALL_OPTIONS="--user" tools/wheels/build-wheels.sh "${LIBRDKAFKA_VERSION#v}" wheelhouse
- PIP_INSTALL_OPTIONS="--user" tools/wheels/build-wheels.sh "${LIBRDKAFKA_VERSION#v}" wheelhouse 2.16.2
- tar -czf wheelhouse-macOS-${ARCH}.tgz wheelhouse
- artifact push workflow wheelhouse-macOS-${ARCH}.tgz --destination artifacts/wheels-${OS_NAME}-${ARCH}.tgz/
- name: "Wheels: OSX arm64 - Python 3.13"
run:
when: "tag =~ '.*'"
dependencies: []
task:
agent:
machine:
type: s1-prod-macos-13-5-arm64
env_vars:
- name: OS_NAME
value: osx
- name: CIBW_ARCHS
value: arm64
- name: ARCH
value: arm64
- name: CIBW_SKIP
value: cp38-* cp39-* cp310-* cp311-* cp312-*
- name: CIBW_ENVIRONMENT_MACOS
value: MACOSX_DEPLOYMENT_TARGET=13
jobs:
- name: Build
commands:
- PIP_INSTALL_OPTIONS="--user" tools/wheels/build-wheels.sh "${LIBRDKAFKA_VERSION#v}" wheelhouse
- tar -czf wheelhouse-macOS-${ARCH}-py313.tgz wheelhouse
- artifact push workflow wheelhouse-macOS-${ARCH}-py313.tgz --destination artifacts/wheels-${OS_NAME}-${ARCH}-py313.tgz/
- name: "Wheels: Linux arm64"
run:
when: "tag =~ '.*'"
Expand Down Expand Up @@ -206,8 +254,10 @@ blocks:
run:
when: "tag =~ '.*'"
dependencies:
- "Wheels: OSX x64"
- "Wheels: OSX arm64"
- "Wheels: OSX x64 - Python 3.6-3.12"
- "Wheels: OSX x64 - Python 3.13"
- "Wheels: OSX arm64 - Python 3.8-3.12"
- "Wheels: OSX arm64 - Python 3.13"
- "Wheels: Linux arm64"
- "Wheels: Linux x64"
- "Wheels: Windows"
Expand Down
4 changes: 2 additions & 2 deletions tools/build-manylinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# docker run -t -v $(pwd):/io quay.io/pypa/manylinux2010_x86_64:latest /io/tools/build-manylinux.sh <librdkafka_tag>

LIBRDKAFKA_VERSION=$1
PYTHON_VERSIONS=("cp36" "cp37" "cp38" "cp39" "cp310" "cp311" "cp312")
PYTHON_VERSIONS=("cp36" "cp37" "cp38" "cp39" "cp310" "cp311" "cp312" "cp313")

if [[ -z "$LIBRDKAFKA_VERSION" ]]; then
echo "Usage: $0 <librdkafka_tag>"
Expand Down Expand Up @@ -92,7 +92,7 @@ for PYBIN in /opt/python/cp*/bin; do
"${PYBIN}/pip" -V
"${PYBIN}/pip" install --no-index -f /io/wheelhouse confluent_kafka
"${PYBIN}/python" -c 'import confluent_kafka; print(confluent_kafka.libversion())'
"${PYBIN}/pip" install -r /io/tests/requirements.txt
"${PYBIN}/pip" install pytest
"${PYBIN}/pytest" /io/tests/test_Producer.py
echo "## Uninstalling $PYBIN"
"${PYBIN}/pip" uninstall -y confluent_kafka
Expand Down
2 changes: 1 addition & 1 deletion tools/mingw-w64/semaphore_commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export MAKE=mingw32-make # so that Autotools can find it

cmd /c mklink /D C:\Python38\python3.exe C:\Python38\python.exe

python -m pip install cibuildwheel==2.16.2
python -m pip install cibuildwheel==2.21.3
4 changes: 2 additions & 2 deletions tools/wheels/build-wheels.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ set WHEELHOUSE=%4
if [%WHEELHOUSE%]==[] goto usage
echo on

set CIBW_BUILD=cp36-%BW_ARCH% cp37-%BW_ARCH% cp38-%BW_ARCH% cp39-%BW_ARCH% cp310-%BW_ARCH% cp311-%BW_ARCH% cp312-%BW_ARCH%
set CIBW_BUILD=cp36-%BW_ARCH% cp37-%BW_ARCH% cp38-%BW_ARCH% cp39-%BW_ARCH% cp310-%BW_ARCH% cp311-%BW_ARCH% cp312-%BW_ARCH% cp313-%BW_ARCH%
set CIBW_BEFORE_BUILD=python -m pip install delvewheel==1.1.4
set CIBW_TEST_REQUIRES=-r tests/requirements.txt
set CIBW_TEST_REQUIRES=pytest
set CIBW_TEST_COMMAND=pytest {project}\tests\test_Producer.py
rem set CIBW_BUILD_VERBOSITY=3
set include=%cd%\%DEST%\build\native\include
Expand Down
5 changes: 2 additions & 3 deletions tools/wheels/build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ this_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Skip PyPy, Python2, old Python3 versions, musl, and x86 builds.
export CIBW_SKIP="pp* cp27-* cp35-* *i686 *musllinux* $CIBW_SKIP"
# Run a simple test suite
export CIBW_TEST_REQUIRES="-r tests/requirements.txt"
export CIBW_TEST_REQUIRES="pytest"
export CIBW_TEST_COMMAND="pytest {project}/tests/test_Producer.py"
export CIBW_MANYLINUX_X86_64_IMAGE="manylinux_2_28"
export CIBW_MANYLINUX_AARCH64_IMAGE="manylinux_2_28"


librdkafka_version=$1
wheeldir=$2
cibuildwheel_version="2.16.2"
cibuildwheel_version=${3:-"2.21.3"}

if [[ -z $wheeldir ]]; then
echo "Usage: $0 <librdkafka-nuget-version> <wheeldir>"
Expand Down

0 comments on commit b5c82b9

Please sign in to comment.