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
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
--- /dev/null
+[ "$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