blob: a137df42a5b36154ddf95e11c66726976c28d358 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=uv-build
PYTHON_COMPAT=( python3_{12..14} )
inherit distutils-r1 optfeature
DESCRIPTION="Async Key-Value Store - A pluggable interface for KV Stores"
HOMEPAGE="
https://github.com/strawgate/py-key-value
https://pypi.org/project/py-key-value-aio/
"
MY_PN="py-key-value"
SRC_URI="
https://github.com/strawgate/${MY_PN}/archive/refs/tags/${PV}.tar.gz
-> ${P}.gh.tar.gz"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm64"
RDEPEND="
>=dev-python/beartype-0.20.0[${PYTHON_USEDEP}]
>=dev-python/typing-extensions-4.15.0[${PYTHON_USEDEP}]
"
BDEPEND="
test? (
>=dev-python/aiofile-3.5.0[${PYTHON_USEDEP}]
>=dev-python/anyio-4.4.0[${PYTHON_USEDEP}]
>=dev-python/cachetools-5.0.0[${PYTHON_USEDEP}]
>=dev-python/cryptography-45.0.0[${PYTHON_USEDEP}]
>=dev-python/dirty-equals-0.10.0[${PYTHON_USEDEP}]
>=dev-python/diskcache-5.0.0[${PYTHON_USEDEP}]
>=dev-python/pathvalidate-3.3.1[${PYTHON_USEDEP}]
>=dev-python/pydantic-2.11.9[${PYTHON_USEDEP}]
)
"
EPYTEST_PLUGINS=(
inline-snapshot
pytest-{asyncio,mock,timeout}
)
EPYTEST_XDIST=1
distutils_enable_tests pytest
EPYTEST_IGNORE=(
# We can't test most stores due to missing dependencies and/or Docker use
tests/stores/aerospike/
tests/stores/duckdb/
tests/stores/dynamodb/
tests/stores/elasticsearch/
tests/stores/firestore/
tests/stores/keyring/
tests/stores/memcached/
tests/stores/mongodb/
tests/stores/opensearch/
tests/stores/postgresql
tests/stores/redis/
tests/stores/rocksdb/
tests/stores/s3/
tests/stores/valkey/
tests/stores/vault/
)
src_prepare() {
distutils-r1_src_prepare
# Disable Docker-dependent tests
sed -e '/def should_run_docker_tests() -> bool:/a \ return False' \
-e '/def should_skip_docker_tests() -> bool:/a \ return True' \
-i "tests/conftest.py" || die
}
python_test() {
epytest -o asyncio_mode=auto --dist=loadfile
}
pkg_postinst() {
optfeature "disk- and file-backed cache" "dev-python/diskcache >=dev-python/pathvalidate-3.3.1"
optfeature "encryption wrappers" dev-python/cryptography
optfeature_header "Install optional key-value store backends:"
optfeature "Elasticsearch" "dev-python/elasticsearch dev-python/aiohttp"
optfeature "File-tree" "dev-python/aiofile dev-python/anyio"
optfeature "system keyring" "dev-python/keyring dev-python/dbus-python"
optfeature "memory" dev-python/cachetools
optfeature "MongoDB" dev-python/pymongo
optfeature "OpenSearch" dev-python/opensearch-py
optfeature "PostgreSQL" dev-python/asyncpg
optfeature "Pydantic" ">=dev-python/pydantic-2.11.9"
optfeature "Redis" dev-python/redis
optfeature "HashiCorp Vault" dev-python/hvac
}
|