python-cached-property: update to 2.0.1

- bump 1.5.2 -> 2.0.1
- add PYPI_SOURCE_NAME:=cached_property (PyPI renamed tarball from
  cached-property to cached_property)
- add PKG_BUILD_DEPENDS:=python-setuptools/host
- add +python3-asyncio +python3-logging to DEPENDS (new in 2.x)
- add test.sh

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
This commit is contained in:
Alexandru Ardelean
2026-04-16 12:25:48 +00:00
committed by Alexandru Ardelean
parent 0b4980efe0
commit 6defd87092
2 changed files with 27 additions and 4 deletions
+7 -4
View File
@@ -1,11 +1,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=python-cached-property
PKG_VERSION:=1.5.2
PKG_RELEASE:=2
PKG_VERSION:=2.0.1
PKG_RELEASE:=1
PYPI_NAME:=cached-property
PKG_HASH:=9fa5755838eecbb2d234c3aa390bd80fbd3ac6b6869109bfc1b499f7bd89a130
PYPI_SOURCE_NAME:=cached_property
PKG_HASH:=484d617105e3ee0e4f1f58725e72a8ef9e93deee462222dbd51cd91230897641
PKG_BUILD_DEPENDS:=python-setuptools/host
PKG_MAINTAINER:=Javier Marcet <javier@marcet.info>
PKG_LICENSE:=BSD-3-Clause
@@ -21,7 +24,7 @@ define Package/python3-cached-property
SUBMENU:=Python
TITLE:=A decorator for caching properties in classes
URL:=https://github.com/pydanny/cached-property
DEPENDS:=+python3-light
DEPENDS:=+python3-light +python3-asyncio +python3-logging
endef
define Package/python3-cached-property/description
@@ -0,0 +1,20 @@
[ "$1" = python3-cached-property ] || exit 0
python3 - << 'EOF'
from cached_property import cached_property
class MyClass:
def __init__(self):
self._calls = 0
@cached_property
def value(self):
self._calls += 1
return 42
obj = MyClass()
assert obj.value == 42
assert obj.value == 42
assert obj._calls == 1, f"Expected 1 call, got {obj._calls}"
print("python3-cached-property OK")
EOF