libgpiod icon indicating copy to clipboard operation
libgpiod copied to clipboard

bindings: python: Build 3.13 wheels

Open vfazio opened this issue 4 months ago • 0 comments

Track the request to make 3.13 wheels. This is fairly simple:

diff --git a/bindings/python/generate_pypi_artifacts.sh b/bindings/python/generate_pypi_artifacts.sh
index c2fb79f..6385a8a 100755
--- a/bindings/python/generate_pypi_artifacts.sh
+++ b/bindings/python/generate_pypi_artifacts.sh
@@ -108,8 +108,7 @@ python3 -m "${venv_module}" .venv
 venv_python="${temp_dir}/.venv/bin/python"
 
 # Install build dependencies
-# cibuildwheel 2.18.1 pins the toolchain containers to 2024-05-13-0983f6f
-${venv_python} -m pip install build==1.2.1 cibuildwheel==2.18.1
+${venv_python} -m pip install build==1.2.2 cibuildwheel==2.21.3
 
 LIBGPIOD_VERSION=${src_version} ${venv_python} -m build --sdist --outdir ./dist "${source_dir}"
 sdist=$(find ./dist -name '*.tar.gz')

Testing shows the resulting wheels install fine and the _ext module loads

(venv) vfazio@vfazio4 /mnt/development/libgpiod/bindings/python $ docker run -it -v `pwd`:/work -w /work python:3.13 bash
Unable to find image 'python:3.13' locally
3.13: Pulling from library/python
cdd62bf39133: Pull complete 
a47cff7f31e9: Pull complete 
a173f2aee8e9: Pull complete 
01272fe8adba: Pull complete 
e2451c50195e: Pull complete 
c3da17cfdde3: Pull complete 
21104ca25c01: Pull complete 
Digest: sha256:45803c375b95ea33f482e53a461eca8f247617667d703660a06ccf5eb3d05326
Status: Downloaded newer image for python:3.13

root@5995d710492e:/work# python3 -V
Python 3.13.0

root@5995d710492e:~# cd `mktemp -d`
root@5995d710492e:/tmp/tmp.75TFlErYno# python3 -m venv venv
root@5995d710492e:/tmp/tmp.75TFlErYno# . venv/bin/activate

(venv) root@5995d710492e:/tmp/tmp.75TFlErYno# uname -a
Linux 5995d710492e 6.8.0-45-generic #45~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Sep 11 15:25:05 UTC 2 x86_64 GNU/Linux


(venv) root@5995d710492e:/tmp/tmp.75TFlErYno# cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

(venv) root@5995d710492e:/tmp/tmp.75TFlErYno# pip install /work/dist/gpiod-2.2.0-cp313-cp313-manylinux_2_17_
gpiod-2.2.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl  gpiod-2.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl    
(venv) root@5995d710492e:/tmp/tmp.75TFlErYno# pip install /work/dist/gpiod-2.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 
Processing /work/dist/gpiod-2.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Installing collected packages: gpiod
Successfully installed gpiod-2.2.0


(venv) root@a09a60ff06ef:/tmp/tmp.uzdBYWHx5Z# python3 -c "import gpiod; print(gpiod.api_version)"
2.1.3

(venv) root@5995d710492e:/tmp/tmp.75TFlErYno# python3 -c "import gpiod; print(gpiod.__version__)"
2.2.0

(venv) root@5995d710492e:/tmp/tmp.75TFlErYno# python3 -c "import gpiod; print(gpiod.is_gpiochip_device('/dev/null'))"
False

vfazio avatar Oct 14 '24 21:10 vfazio