diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 42ab111..1286699 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,7 +5,7 @@ "build": { "dockerfile": "Dockerfile", // Update 'VARIANT' to pick an Alpine version: 3.10, 3.11, 3.12 - "args": { "VARIANT": "3.12" } + "args": { "VARIANT": "3.13" } }, // Set *default* container specific settings.json values on container create. diff --git a/.github/workflows/builder.yml b/.github/workflows/builder.yml index 5a75d02..bd0fbdb 100644 --- a/.github/workflows/builder.yml +++ b/.github/workflows/builder.yml @@ -12,7 +12,7 @@ env: DEBIAN_LATEST: "bookworm" UBUNTU_LATEST: "20.4" RASPBIAN_LATEST: "bullseye" - PYTHON_LATEST: "3.12" + PYTHON_LATEST: "3.13" jobs: init: @@ -250,7 +250,7 @@ jobs: matrix: arch: ${{ fromJson(needs.init.outputs.architectures_alpine) }} version: ["3.18", "3.19", "3.20"] - python: ["3.10", "3.11", "3.12"] + python: ["3.11", "3.12", "3.13"] steps: - name: Checkout the repository uses: actions/checkout@v4.2.2 diff --git a/README.md b/README.md index 56ce7a3..c23ad9e 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,11 @@ We support the latest 3 release with the latest 3 Alpine version. | Image | OS | Tags | latest | |-------|----|------|--------| -| armhf-base-python | Alpine | 3.10, 3.11, 3.12, 3.10-alpine3.18, 3.10-alpine3.19, 3.10-alpine3.20, 3.11-alpine3.18, 3.11-alpine3.19, 3.11-alpine3.20, 3.12-alpine3.18, 3.12-alpine3.19, 3.12-alpine3.20 | 3.12-alpine3.20 | -| armv7-base-python | Alpine | 3.10, 3.11, 3.12, 3.10-alpine3.18, 3.10-alpine3.19, 3.10-alpine3.20, 3.11-alpine3.18, 3.11-alpine3.19, 3.11-alpine3.20, 3.12-alpine3.18, 3.12-alpine3.19, 3.12-alpine3.20 | 3.12-alpine3.20 | -| aarch64-base-python | Alpine | 3.10, 3.11, 3.12, 3.10-alpine3.18, 3.10-alpine3.19, 3.10-alpine3.20, 3.11-alpine3.18, 3.11-alpine3.19, 3.11-alpine3.20, 3.12-alpine3.18, 3.12-alpine3.19, 3.12-alpine3.20 | 3.12-alpine3.20 | -| amd64-base-python | Alpine | 3.10, 3.11, 3.12, 3.10-alpine3.18, 3.10-alpine3.19, 3.10-alpine3.20, 3.11-alpine3.18, 3.11-alpine3.19, 3.11-alpine3.20, 3.12-alpine3.18, 3.12-alpine3.19, 3.12-alpine3.20 | 3.12-alpine3.20 | -| i386-base-python | Alpine | 3.10, 3.11, 3.12, 3.10-alpine3.18, 3.10-alpine3.19, 3.10-alpine3.20, 3.11-alpine3.18, 3.11-alpine3.19, 3.11-alpine3.20, 3.12-alpine3.18, 3.12-alpine3.19, 3.12-alpine3.20 | 3.12-alpine3.20 | +| armhf-base-python | Alpine | 3.11, 3.12, 3.13, 3.11-alpine3.18, 3.11-alpine3.19, 3.11-alpine3.20, 3.12-alpine3.18, 3.12-alpine3.19, 3.12-alpine3.20, 3.13-alpine3.18, 3.13-alpine3.19, 3.13-alpine3.20 | 3.13-alpine3.20 | +| armv7-base-python | Alpine | 3.11, 3.12, 3.13, 3.11-alpine3.18, 3.11-alpine3.19, 3.11-alpine3.20, 3.12-alpine3.18, 3.12-alpine3.19, 3.12-alpine3.20, 3.13-alpine3.18, 3.13-alpine3.19, 3.13-alpine3.20 | 3.13-alpine3.20 | +| aarch64-base-python | Alpine | 3.11, 3.12, 3.13, 3.11-alpine3.18, 3.11-alpine3.19, 3.11-alpine3.20, 3.12-alpine3.18, 3.12-alpine3.19, 3.12-alpine3.20, 3.13-alpine3.18, 3.13-alpine3.19, 3.13-alpine3.20 | 3.13-alpine3.20 | +| amd64-base-python | Alpine | 3.11, 3.12, 3.13, 3.11-alpine3.18, 3.11-alpine3.19, 3.11-alpine3.20, 3.12-alpine3.18, 3.12-alpine3.19, 3.12-alpine3.20, 3.13-alpine3.18, 3.13-alpine3.19, 3.13-alpine3.20 | 3.13-alpine3.20 | +| i386-base-python | Alpine | 3.11, 3.12, 3.13, 3.11-alpine3.18, 3.11-alpine3.19, 3.11-alpine3.20, 3.12-alpine3.18, 3.12-alpine3.19, 3.12-alpine3.20, 3.13-alpine3.18, 3.13-alpine3.19, 3.13-alpine3.20 | 3.13-alpine3.20 | ## Others diff --git a/python/3.10/arm-alignment.patch b/python/3.10/arm-alignment.patch deleted file mode 100644 index a7a4b39..0000000 --- a/python/3.10/arm-alignment.patch +++ /dev/null @@ -1,17 +0,0 @@ -Author: Dave Jones -Description: Use aligned access for _sha3 module on ARM. ---- a/Modules/_sha3/sha3module.c -+++ b/Modules/_sha3/sha3module.c -@@ -64,6 +64,12 @@ - #define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN - #endif - -+/* Bus error on 32-bit ARM due to un-aligned memory accesses; 64-bit ARM -+ * doesn't complain but un-aligned memory accesses are sub-optimal */ -+#if defined(__arm__) || defined(__aarch64__) -+#define NO_MISALIGNED_ACCESSES -+#endif -+ - /* mangle names */ - #define KeccakF1600_FastLoop_Absorb _PySHA3_KeccakF1600_FastLoop_Absorb - #define Keccak_HashFinal _PySHA3_Keccak_HashFinal diff --git a/python/3.10/asynctio_unix_events.patch b/python/3.10/asynctio_unix_events.patch deleted file mode 100644 index 45bf3fc..0000000 --- a/python/3.10/asynctio_unix_events.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py -index f34a5b4b44..b1d0f1e61e 100644 ---- a/Lib/asyncio/unix_events.py -+++ b/Lib/asyncio/unix_events.py -@@ -369,6 +369,11 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop): - fut.set_result(total_sent) - return - -+ # On 32-bit architectures truncate to 1GiB to avoid OverflowError, -+ # see bpo-38319. -+ if sys.maxsize < 2 ** 32: -+ blocksize = min(blocksize, 2 ** 30) -+ - try: - sent = os.sendfile(fd, fileno, offset, blocksize) - except (BlockingIOError, InterruptedError): \ No newline at end of file diff --git a/python/3.10/fix-xattrs-glibc.patch b/python/3.10/fix-xattrs-glibc.patch deleted file mode 100644 index 6902425..0000000 --- a/python/3.10/fix-xattrs-glibc.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c -index 8f8ba25..72b92da 100644 ---- a/Modules/posixmodule.c -+++ b/Modules/posixmodule.c -@@ -103,8 +103,9 @@ corresponding Unix manual entries for more information on calls."); - #undef HAVE_SCHED_SETAFFINITY - #endif - --#if defined(HAVE_SYS_XATTR_H) && defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__) -+#if defined(HAVE_SYS_XATTR_H) && defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__) - #define USE_XATTRS -+#include - #endif - - #ifdef USE_XATTRS - diff --git a/python/3.10/Dockerfile b/python/3.13/Dockerfile similarity index 97% rename from python/3.10/Dockerfile rename to python/3.13/Dockerfile index 97eb7f9..a209429 100644 --- a/python/3.10/Dockerfile +++ b/python/3.13/Dockerfile @@ -62,7 +62,7 @@ RUN set -ex \ xz-dev \ zlib-dev \ bluez-dev \ -# add build deps before removing fetch deps in case there's overlap + # add build deps before removing fetch deps in case there's overlap && apk del .fetch-deps \ \ && for i in /usr/src/*.patch; do \ @@ -78,7 +78,6 @@ RUN set -ex \ --with-lto \ --with-system-libmpdec \ --with-system-expat \ - --with-system-ffi \ --without-ensurepip \ --without-static-libpython \ && make -j "$(nproc)" \ diff --git a/python/3.10/build.yaml b/python/3.13/build.yaml similarity index 87% rename from python/3.10/build.yaml rename to python/3.13/build.yaml index 9a49caa..b91e5c7 100644 --- a/python/3.10/build.yaml +++ b/python/3.13/build.yaml @@ -9,9 +9,9 @@ cosign: base_identity: https://github.com/home-assistant/docker-base/.* identity: https://github.com/home-assistant/docker-base/.* args: - PYTHON_VERSION: 3.10.14 + PYTHON_VERSION: 3.13.0 PIP_VERSION: 24.2 - GPG_KEY: A035C8C19219BA821ECEA86B64E628F8D684696D + GPG_KEY: 7169605F62C751356D054A26A821E680E5FA6305 labels: io.hass.base.name: python org.opencontainers.image.source: https://github.com/home-assistant/docker-base diff --git a/python/3.10/musl-find_library.patch b/python/3.13/musl-find_library.patch similarity index 100% rename from python/3.10/musl-find_library.patch rename to python/3.13/musl-find_library.patch diff --git a/python/3.13/musl-skip_failing_tests.patch b/python/3.13/musl-skip_failing_tests.patch new file mode 100644 index 0000000..3b8b1e3 --- /dev/null +++ b/python/3.13/musl-skip_failing_tests.patch @@ -0,0 +1,70 @@ +commit 5e047972f7c80e95c2baecc9da86ee049df0b9c1 +Author: Marc Mueller <30130371+cdce8p@users.noreply.github.com> +Date: 2024-10-11 20:11:47 +0200 + + Skip failing tests on musl + +diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py +index ed23f73e3cf..ccc36f7e774 100644 +--- a/Lib/test/support/__init__.py ++++ b/Lib/test/support/__init__.py +@@ -561,6 +561,7 @@ def skip_if_suppress_immortalization(): + # have subprocess or fork support. + is_emscripten = sys.platform == "emscripten" + is_wasi = sys.platform == "wasi" ++is_musl = sys.platform = "linux" + + is_apple_mobile = sys.platform in {"ios", "tvos", "watchos"} + is_apple = is_apple_mobile or sys.platform == "darwin" +diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py +index 541ccdb3d09..4d5f8e982c8 100644 +--- a/Lib/test/test_math.py ++++ b/Lib/test/test_math.py +@@ -1,7 +1,7 @@ + # Python test set -- math module + # XXXX Should not do tests around zero only + +-from test.support import verbose, requires_IEEE_754 ++from test.support import is_musl, verbose, requires_IEEE_754 + from test import support + import unittest + import fractions +@@ -2706,7 +2706,7 @@ def test_fma_infinities(self): + # gh-73468: On some platforms, libc fma() doesn't implement IEE 754-2008 + # properly: it doesn't use the right sign when the result is zero. + @unittest.skipIf( +- sys.platform.startswith(("freebsd", "wasi")) ++ sys.platform.startswith(("freebsd", "wasi")) or is_musl + or (sys.platform == "android" and platform.machine() == "x86_64"), + f"this platform doesn't implement IEE 754-2008 properly") + def test_fma_zero_result(self): +diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py +index 2a46e058e95..a630f79a702 100644 +--- a/Lib/test/test_re.py ++++ b/Lib/test/test_re.py +@@ -1,6 +1,6 @@ + from test.support import (gc_collect, bigmemtest, _2G, + cpython_only, captured_stdout, +- check_disallow_instantiation, is_emscripten, is_wasi, ++ check_disallow_instantiation, is_emscripten, is_musl, is_wasi, + warnings_helper, SHORT_TIMEOUT, CPUStopwatch, requires_resource) + import locale + import re +@@ -2016,7 +2016,7 @@ def test_bug_20998(self): + self.assertEqual(re.fullmatch('[a-c]+', 'ABC', re.I).span(), (0, 3)) + + @unittest.skipIf( +- is_emscripten or is_wasi, ++ is_emscripten or is_wasi or is_musl, + "musl libc issue on Emscripten/WASI, bpo-46390" + ) + def test_locale_caching(self): +@@ -2056,7 +2056,7 @@ def check_en_US_utf8(self): + self.assertIsNone(re.match(b'(?Li)\xe5', b'\xc5')) + + @unittest.skipIf( +- is_emscripten or is_wasi, ++ is_emscripten or is_wasi or is_musl, + "musl libc issue on Emscripten/WASI, bpo-46390" + ) + def test_locale_compiled(self):