git: 36ae8f643ea4 - main - devel/py-klepto: Add py-klepto 0.2.3
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 18 Apr 2023 18:08:10 UTC
The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=36ae8f643ea4d811693c6cf3af8cc0fee8e8df65 commit 36ae8f643ea4d811693c6cf3af8cc0fee8e8df65 Author: Po-Chuan Hsieh <sunpoet@FreeBSD.org> AuthorDate: 2023-04-18 17:51:34 +0000 Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org> CommitDate: 2023-04-18 18:00:40 +0000 devel/py-klepto: Add py-klepto 0.2.3 klepto extends Python's lru_cache to utilize different keymaps and alternate caching algorithms, such as lfu_cache and mru_cache. While caching is meant for fast access to saved results, klepto also has archiving capabilities, for longer-term storage. klepto uses a simple dictionary-sytle interface for all caches and archives, and all caches can be applied to any Python function as a decorator. Keymaps are algorithms for converting a function's input signature to a unique dictionary, where the function's results are the dictionary value. Thus for y = f(x), y will be stored in cache[x] (e.g. {x:y}). klepto provides both standard and "safe" caching, where "safe" caches are slower but can recover from hashing errors. klepto is intended to be used for distributed and parallel computing, where several of the keymaps serialize the stored objects. Caches and archives are intended to be read/write accessible from different threads and processes. klepto enables a user to decorate a function, save the results to a file or database archive, close the interpreter, start a new session, and reload the function and it's cache. --- devel/Makefile | 1 + devel/py-klepto/Makefile | 24 ++++++++++++++++++++++++ devel/py-klepto/distinfo | 3 +++ devel/py-klepto/pkg-descr | 16 ++++++++++++++++ 4 files changed, 44 insertions(+) diff --git a/devel/Makefile b/devel/Makefile index a649b0effb2a..921fb473867e 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -4834,6 +4834,7 @@ SUBDIR += py-keystoneauth1 SUBDIR += py-keystonemiddleware SUBDIR += py-kitchen + SUBDIR += py-klepto SUBDIR += py-knack SUBDIR += py-l18n SUBDIR += py-lark diff --git a/devel/py-klepto/Makefile b/devel/py-klepto/Makefile new file mode 100644 index 000000000000..66d6769d1b0e --- /dev/null +++ b/devel/py-klepto/Makefile @@ -0,0 +1,24 @@ +PORTNAME= klepto +PORTVERSION= 0.2.3 +CATEGORIES= devel python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Persistent caching to memory, disk, or database +WWW= https://github.com/uqfoundation/klepto + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=42:devel/py-setuptools@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}dill>=0.3.6:devel/py-dill@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pox>=0.3.2:devel/py-pox@${PY_FLAVOR} + +USES= python:3.7+ +USE_PYTHON= autoplist concurrent pep517 + +NO_ARCH= yes + +.include <bsd.port.mk> diff --git a/devel/py-klepto/distinfo b/devel/py-klepto/distinfo new file mode 100644 index 000000000000..987b57c67e30 --- /dev/null +++ b/devel/py-klepto/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1681836949 +SHA256 (klepto-0.2.3.tar.gz) = fc66eca93413d8c348a31de3e7383d37d1f01b9e98755cac8358e9e0a88830c3 +SIZE (klepto-0.2.3.tar.gz) = 155892 diff --git a/devel/py-klepto/pkg-descr b/devel/py-klepto/pkg-descr new file mode 100644 index 000000000000..406323fc9cd2 --- /dev/null +++ b/devel/py-klepto/pkg-descr @@ -0,0 +1,16 @@ +klepto extends Python's lru_cache to utilize different keymaps and alternate +caching algorithms, such as lfu_cache and mru_cache. While caching is meant for +fast access to saved results, klepto also has archiving capabilities, for +longer-term storage. klepto uses a simple dictionary-sytle interface for all +caches and archives, and all caches can be applied to any Python function as a +decorator. Keymaps are algorithms for converting a function's input signature to +a unique dictionary, where the function's results are the dictionary value. Thus +for y = f(x), y will be stored in cache[x] (e.g. {x:y}). + +klepto provides both standard and "safe" caching, where "safe" caches are slower +but can recover from hashing errors. klepto is intended to be used for +distributed and parallel computing, where several of the keymaps serialize the +stored objects. Caches and archives are intended to be read/write accessible +from different threads and processes. klepto enables a user to decorate a +function, save the results to a file or database archive, close the interpreter, +start a new session, and reload the function and it's cache.