Skip to content

Commit 4db773a

Browse files
authored
Update base image to use Python 3.13 (#338)
1 parent 8ddd15c commit 4db773a

File tree

4 files changed

+37
-12
lines changed

4 files changed

+37
-12
lines changed

.github/workflows/builder.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ jobs:
5959
echo "changed=true" >> $GITHUB_OUTPUT
6060
fi
6161
62-
- name: Build wheels cp312
62+
- name: Build wheels cp313
6363
uses: home-assistant/[email protected]
6464
if: github.event_name == 'release' || steps.requirements.outputs.changed == 'true'
6565
with:
6666
tag: musllinux_1_2
67-
abi: cp312
67+
abi: cp313
6868
arch: ${{ matrix.arch }}
6969
wheels-key: ${{ secrets.WHEELS_KEY }}
7070
apk: "mariadb-dev;postgresql-dev;libffi-dev"

Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ RUN \
6363

6464
# libcec
6565
COPY patches/libcec-fix-null-return.patch /usr/src/
66+
COPY patches/libcec-python313.patch /usr/src/
6667
RUN apk add --no-cache \
6768
eudev-libs \
6869
p8-platform \
@@ -76,20 +77,22 @@ RUN apk add --no-cache \
7677
&& git clone --depth 1 -b "libcec-${LIBCEC_VERSION}" https://github.com/Pulse-Eight/libcec \
7778
&& cd libcec \
7879
&& git apply ../libcec-fix-null-return.patch \
80+
&& git apply ../libcec-python313.patch \
7981
&& mkdir build \
8082
&& cd build \
8183
&& cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local \
82-
-DPYTHON_LIBRARY="/usr/local/lib/libpython3.12.so" \
83-
-DPYTHON_INCLUDE_DIR="/usr/local/include/python3.12" \
84+
-DPYTHON_LIBRARY="/usr/local/lib/libpython3.13.so" \
85+
-DPYTHON_INCLUDE_DIR="/usr/local/include/python3.13" \
8486
-DHAVE_LINUX_API=1 \
8587
.. \
8688
&& make -j"$(nproc)" \
8789
&& make install \
88-
&& echo "cec" > "/usr/local/lib/python3.12/site-packages/cec.pth" \
90+
&& echo "cec" > "/usr/local/lib/python3.13/site-packages/cec.pth" \
8991
&& apk del .build-dependencies \
9092
&& rm -rf \
9193
/usr/src/libcec \
92-
/usr/src/libcec-fix-null-return.patch
94+
/usr/src/libcec-fix-null-return.patch \
95+
/usr/src/libcec-python313.patch
9396

9497
# PicoTTS - it has no specific version - commit should be taken from build.json
9598
RUN apk add --no-cache \
@@ -99,7 +102,7 @@ RUN apk add --no-cache \
99102
autoconf \
100103
libtool \
101104
popt-dev \
102-
build-base \
105+
build-base \
103106
&& git clone https://github.com/naggety/picotts.git pico \
104107
&& cd pico/pico \
105108
&& git reset --hard "${PICOTTS_HASH}" \

build.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
image: ghcr.io/home-assistant/{arch}-homeassistant-base
22
build_from:
3-
aarch64: ghcr.io/home-assistant/aarch64-base-python:3.12-alpine3.20
4-
armhf: ghcr.io/home-assistant/armhf-base-python:3.12-alpine3.20
5-
armv7: ghcr.io/home-assistant/armv7-base-python:3.12-alpine3.20
6-
amd64: ghcr.io/home-assistant/amd64-base-python:3.12-alpine3.20
7-
i386: ghcr.io/home-assistant/i386-base-python:3.12-alpine3.20
3+
aarch64: ghcr.io/home-assistant/aarch64-base-python:3.13-alpine3.20
4+
armhf: ghcr.io/home-assistant/armhf-base-python:3.13-alpine3.20
5+
armv7: ghcr.io/home-assistant/armv7-base-python:3.13-alpine3.20
6+
amd64: ghcr.io/home-assistant/amd64-base-python:3.13-alpine3.20
7+
i386: ghcr.io/home-assistant/i386-base-python:3.13-alpine3.20
88
codenotary:
99
1010
base_image: [email protected]

patches/libcec-python313.patch

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--- a/src/libcec/SwigHelper.h
2+
+++ b/src/libcec/SwigHelper.h
3+
@@ -119,7 +119,7 @@ namespace CEC
4+
if (!!m_callbacks[callback])
5+
{
6+
/** call the callback */
7+
- result = PyEval_CallObject(m_callbacks[callback], arglist);
8+
+ result = PyObject_CallObject(m_callbacks[callback], arglist);
9+
10+
/** unref the argument and result */
11+
if (!!arglist)
12+
--- a/src/libcec/libcec.i
13+
+++ b/src/libcec/libcec.i
14+
@@ -141,7 +141,7 @@ namespace std {
15+
if (!!lib)
16+
{
17+
lib->InitVideoStandalone();
18+
- PyEval_InitThreads();
19+
+ // PyEval_InitThreads();
20+
}
21+
return lib;
22+
}

0 commit comments

Comments
 (0)