mirror of
https://github.com/openwrt/packages.git
synced 2026-04-18 04:12:14 +00:00
- 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>
21 lines
423 B
Bash
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
|