From 60c5eb29a3f97e6503e12151c1b1f74adee2e724 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Sun, 22 Mar 2026 06:55:57 +0000 Subject: [PATCH] python-attrs: bump to 25.4.0 Changes since 23.1.0: - attrs 24.1.0: add __attrs_init__ customization via on_setattr - attrs 24.2.0: improve type annotations, deprecate older APIs - attrs 25.1.0: Python 3.13 support, drop Python 3.7 - attrs 25.3.0: further type annotation improvements - attrs 25.4.0: bug fixes and maintenance Signed-off-by: Alexandru Ardelean --- lang/python/python-attrs/Makefile | 6 ++--- lang/python/python-attrs/test.sh | 44 +++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 lang/python/python-attrs/test.sh diff --git a/lang/python/python-attrs/Makefile b/lang/python/python-attrs/Makefile index 3af9a09ce2..dec0c501cb 100644 --- a/lang/python/python-attrs/Makefile +++ b/lang/python/python-attrs/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-attrs -PKG_VERSION:=23.1.0 +PKG_VERSION:=25.4.0 PKG_RELEASE:=1 PYPI_NAME:=attrs -PKG_HASH:=6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015 +PKG_HASH:=16d5969b87f0859ef33a48b35d55ac1be6e42ae49d5e853b597db70c35c57e11 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE @@ -30,7 +30,7 @@ define Package/python3-attrs SUBMENU:=Python TITLE:=Classes Without Boilerplate URL:=https://www.attrs.org/ - DEPENDS:=+python3-light + DEPENDS:=+python3-light +python3-codecs endef define Package/python3-attrs/description diff --git a/lang/python/python-attrs/test.sh b/lang/python/python-attrs/test.sh new file mode 100644 index 0000000000..3b640120b3 --- /dev/null +++ b/lang/python/python-attrs/test.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +[ "$1" = python3-attrs ] || exit 0 + +python3 - <<'EOF' +import attr +import attrs + +# Define a class with attrs +@attr.s +class Point: + x = attr.ib() + y = attr.ib(default=0) + +p = Point(1, 2) +assert p.x == 1 +assert p.y == 2 + +p2 = Point(3) +assert p2.y == 0 + +# Equality +assert Point(1, 2) == Point(1, 2) +assert Point(1, 2) != Point(1, 3) + +# attrs.define (modern API) +@attrs.define +class Circle: + radius: float + color: str = "red" + +c = Circle(5.0) +assert c.radius == 5.0 +assert c.color == "red" + +c2 = Circle(radius=3.0, color="blue") +assert c2.color == "blue" + +# asdict +d = attr.asdict(p) +assert d == {"x": 1, "y": 2} + +print("python-attrs OK") +EOF