From 7ca00dfa99743b7e06178cc53c2e7d4d2db57a81 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Thu, 9 Apr 2026 08:36:52 +0300 Subject: [PATCH] python-installer: update to 1.0.0 Update package to 1.0.0. This is the first stable release. Changes since 0.7.0: - Dropped support for Python 3.7, 3.8, 3.9; added Python 3.13/3.14 - Added --overwrite-existing and --validate-record CLI options - Support installing multiple wheels in a single invocation - Security: fixed a path traversal bug - Do not install __pycache__ directories from wheels - Switch to stream-based validation instead of in-memory (lower memory) - Sort entries before writing RECORD; fixed Windows relative path bug - Complete type annotations with strict mypy enforcement - API change: SchemeDictionaryDestination.overwrite_existing now defaults to True (was False); update patch 001 accordingly Remove patch 001-don-t-raise-error-if-file-exists.patch and set '--overwrite-existing' in build scripts. Signed-off-by: Alexandru Ardelean --- lang/python/python-installer/Makefile | 6 ++--- ...001-don-t-raise-error-if-file-exists.patch | 13 ---------- lang/python/python-installer/test.sh | 25 +++++++++++++++++++ lang/python/python3-host-build.mk | 1 + lang/python/python3-package.mk | 1 + 5 files changed, 30 insertions(+), 16 deletions(-) delete mode 100644 lang/python/python-installer/patches/001-don-t-raise-error-if-file-exists.patch create mode 100755 lang/python/python-installer/test.sh diff --git a/lang/python/python-installer/Makefile b/lang/python/python-installer/Makefile index bab8f63ddc..604bbe934e 100644 --- a/lang/python/python-installer/Makefile +++ b/lang/python/python-installer/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-installer -PKG_VERSION:=0.7.0 -PKG_RELEASE:=3 +PKG_VERSION:=1.0.0 +PKG_RELEASE:=1 PYPI_NAME:=installer -PKG_HASH:=a26d3e3116289bb08216e0d0f7d925fcef0b0194eedfa0c944bcaaa106c4b631 +PKG_HASH:=c6d691331621cf3fec4822f5c6f83cab3705f79b316225dc454127411677c71f PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE diff --git a/lang/python/python-installer/patches/001-don-t-raise-error-if-file-exists.patch b/lang/python/python-installer/patches/001-don-t-raise-error-if-file-exists.patch deleted file mode 100644 index f5ebb48c37..0000000000 --- a/lang/python/python-installer/patches/001-don-t-raise-error-if-file-exists.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/installer/destinations.py b/src/installer/destinations.py -index a3c1967..9f733c8 100644 ---- a/src/installer/destinations.py -+++ b/src/installer/destinations.py -@@ -164,7 +164,7 @@ class SchemeDictionaryDestination(WheelDestination): - target_path = self._path_with_destdir(scheme, path) - if os.path.exists(target_path): - message = f"File already exists: {target_path}" -- raise FileExistsError(message) -+ os.remove(target_path) - - parent_folder = os.path.dirname(target_path) - if not os.path.exists(parent_folder): diff --git a/lang/python/python-installer/test.sh b/lang/python/python-installer/test.sh new file mode 100755 index 0000000000..24669d2a46 --- /dev/null +++ b/lang/python/python-installer/test.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +[ "$1" = python3-installer ] || exit 0 + +python3 - << 'EOF' +from installer import install +from installer.sources import WheelFile +from installer.destinations import SchemeDictionaryDestination +import tempfile +import os + +# Verify the API is importable and overwrite_existing defaults to True +dest = SchemeDictionaryDestination( + scheme_dict={ + "purelib": "/tmp", + "platlib": "/tmp", + "headers": "/tmp", + "scripts": "/tmp", + "data": "/tmp", + }, + interpreter="/usr/bin/python3", + script_kind="posix", +) +assert dest.overwrite_existing is True +EOF diff --git a/lang/python/python3-host-build.mk b/lang/python/python3-host-build.mk index 738d157287..2ffaf22838 100644 --- a/lang/python/python3-host-build.mk +++ b/lang/python/python3-host-build.mk @@ -56,6 +56,7 @@ define Py3Host/Install/Installer $(call HostPython3/Run, \ $(HOST_BUILD_DIR), \ -m installer \ + --overwrite-existing \ --destdir "$(1)" \ --prefix "" \ "$(PYTHON3_HOST_BUILD_DIR)"/openwrt-build/$(PYTHON3_HOST_WHEEL_NAME)-$(PYTHON3_HOST_WHEEL_VERSION)-*.whl \ diff --git a/lang/python/python3-package.mk b/lang/python/python3-package.mk index 819b6bf64a..0f45bdc3cc 100644 --- a/lang/python/python3-package.mk +++ b/lang/python/python3-package.mk @@ -285,6 +285,7 @@ define Py3Build/Install/Default $(call Python3/Run, \ $(PKG_BUILD_DIR), \ -m installer \ + --overwrite-existing \ --destdir "$(PKG_INSTALL_DIR)" \ --no-compile-bytecode \ --prefix /usr \