diff --git a/lang/python/python-cached-property/Makefile b/lang/python/python-cached-property/Makefile index a95d298aaa..3ba42db1b9 100644 --- a/lang/python/python-cached-property/Makefile +++ b/lang/python/python-cached-property/Makefile @@ -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 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 diff --git a/lang/python/python-cached-property/test.sh b/lang/python/python-cached-property/test.sh new file mode 100644 index 0000000000..db3606ea11 --- /dev/null +++ b/lang/python/python-cached-property/test.sh @@ -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