Files
packages/lang/python/python-cached-property/test.sh
Alexandru Ardelean 6defd87092 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>
2026-04-16 19:01:19 +03:00

21 lines
423 B
Bash

[ "$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