diff options
| author | Crucible <crucible@localhost> | 2026-10-02 03:05:03 -0500 |
|---|---|---|
| committer | Crucible <crucible@localhost> | 2026-10-02 03:05:03 -0500 |
| commit | c8cc1214c14d1f5931a1ecb986b940d05cf5145b (patch) | |
| tree | 688b35f9bd1276715e07d46cf77cc778f6435ee5 /dev-python/fakeredis | |
| parent | c387ab5925039957145c01955c824bf9b3c7cafc (diff) | |
| download | srcux-c8cc1214c14d1f5931a1ecb986b940d05cf5145b.tar.gz srcux-c8cc1214c14d1f5931a1ecb986b940d05cf5145b.tar.xz srcux-c8cc1214c14d1f5931a1ecb986b940d05cf5145b.zip | |
Publish srcux candidate 0000000551-20261002-030306
Diffstat (limited to 'dev-python/fakeredis')
| -rw-r--r-- | dev-python/fakeredis/Manifest | 2 | ||||
| -rw-r--r-- | dev-python/fakeredis/fakeredis-2.39.0.ebuild | 137 |
2 files changed, 139 insertions, 0 deletions
diff --git a/dev-python/fakeredis/Manifest b/dev-python/fakeredis/Manifest index 4d561d52ef54..a73f6bf1eae2 100644 --- a/dev-python/fakeredis/Manifest +++ b/dev-python/fakeredis/Manifest @@ -4,3 +4,5 @@ DIST fakeredis-2.37.1.tar.gz 238182 BLAKE2B 48755cfc378a0e6199f902d58bee2b9d1e1b DIST fakeredis-2.37.1.tar.gz.provenance 9609 BLAKE2B 0d8e0083615dd76de483c88fcbcb125b4dbd9d32c8d139e4cf3d9d6a9c965c88b937cb4b11cfc58f154da9ffd5eec943938176557792a7b65b2d99d667834b97 SHA512 168051305b87497761bcda3d1627c26d33f30a520de8ae2e8a50d2c3e87260a68c99833031d89195ded134661d94a5a08cbd00f125fcc2d1ba1e0b0eddb95dd8 DIST fakeredis-2.38.0.tar.gz 271116 BLAKE2B c16d21d194a2589363a753737fbbe0729ead7fd4f192610b5e170cbfde8dc09c5edf2534f74ca87ea022b58ac8c3f8fc94622934efeeb5dea4ae15b6eaf3ec08 SHA512 f8020da63b3ec516329b517f39fa1fa5224efb6ccebb9c1c6ffccc3906711d0d5dfc5bf73fb0ea7137481a345e3028ff1eb6c56b26e13437384d215771ffd20f DIST fakeredis-2.38.0.tar.gz.provenance 9942 BLAKE2B e29e23b6ec2a64fcbbe8c078ea0b01aa728d81a63e6c4898971187184aa59bfb219c072d8933bc4ae64040db6d89b7ad334b4489b6da8e2d640c639200e33fa2 SHA512 18400e533c3471d087e8429a41d5cb664a023a5bc12276f0021aeb9616dd7c18523284716f9a89c93ac3f30019f6540bb3935c6a7073f43fd59d4644afb499ba +DIST fakeredis-2.39.0.tar.gz 301722 BLAKE2B 4f0550eb73f0b67061cc96e6b44bca7920aaa423563ab0c588ed264259e340de20a417c4535f82dc09714d6902d9bc298e07145b27ac72c3642bb3b387c74d2e SHA512 b0b15942440a0926ebb40db4ffe49e80d35bddf59de6919d3c68b651ddab6ebce17f7310406bc2c9ee5fe912f875a6bf58430392652ec95c18cbc5c7f839b7ca +DIST fakeredis-2.39.0.tar.gz.provenance 9797 BLAKE2B 07d67ab697bee1676aa436aaeb30e10628cc407823d1ce3f4a4c9187f1a9862050d720c6d2c70bacc082d4244c48968dae848ff615115f50ec8084f757ff0547 SHA512 b50b217469ca5fc2629e297823abfd2f83c398cbb4c4dda962c59286eb3af0c811d8cbadaf1d0291edf1f95916db96587a559a1279dda9bba6e95fabca7375d7 diff --git a/dev-python/fakeredis/fakeredis-2.39.0.ebuild b/dev-python/fakeredis/fakeredis-2.39.0.ebuild new file mode 100644 index 000000000000..1cd41739c433 --- /dev/null +++ b/dev-python/fakeredis/fakeredis-2.39.0.ebuild @@ -0,0 +1,137 @@ +# Copyright 2020-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=hatchling +PYPI_VERIFY_REPO=https://github.com/cunla/fakeredis-py +PYTHON_COMPAT=( python3_{13..14} ) + +inherit distutils-r1 pypi + +DESCRIPTION="Fake implementation of redis API for testing purposes" +HOMEPAGE=" + https://github.com/cunla/fakeredis-py/ + https://pypi.org/project/fakeredis/ +" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~sparc ~x86" + +RDEPEND=" + >=dev-python/redis-4.3[${PYTHON_USEDEP}] + >=dev-python/sortedcontainers-2[${PYTHON_USEDEP}] +" +BDEPEND=" + test? ( + dev-db/redis + dev-db/valkey + dev-python/packaging[${PYTHON_USEDEP}] + dev-python/valkey[${PYTHON_USEDEP}] + ) +" + +EPYTEST_PLUGINS=( pytest-{asyncio,mock} ) +EPYTEST_XDIST=1 +distutils_enable_tests pytest + +src_prepare() { + distutils-r1_src_prepare + + # do not install duplicate license + sed -i -e '\@fakeredis/LICENSE@d' pyproject.toml || die +} + +wait_for_status() { + local expected=${1} + + local i + for i in {1..50}; do + "${server}-cli" -p "${redis_port}" ping + [[ ${?} -eq ${expected} ]] && return + sleep 0.2 + done + + die "Timeout while waiting for ${1}-server to start/stop" +} + +src_test() { + local server + for server in redis valkey; do + local redis_pid="${T}/${server}.pid" + local redis_port=6390 + local redis_log="${T}/${server}.log" + local redis_db="${T}/${server}.db" + + einfo "Running ${server} server tests" + "${EPREFIX}/usr/sbin/${server}-server" - <<- EOF || die "Unable to start ${server} server" + daemonize yes + pidfile ${redis_pid} + port ${redis_port} + logfile ${redis_log} + dir ${redis_db%/*} + dbfilename ${redis_db##*/} + bind 127.0.0.1 + EOF + + # wait for the server to start + wait_for_status 0 + + distutils-r1_src_test + + "${server}-cli" -p "${redis_port}" shutdown || die "Unable to stop ${server} server" + + # wait for the server to stop + wait_for_status 1 + done +} + +python_test() { + local EPYTEST_DESELECT=( + # json ext + test/test_stack/test_json.py + test/test_stack/test_json_arr_commands.py + test/test_stack/test_json_fpha.py + # TODO + "test/test_mixins/test_pubsub_commands.py::test_published_message_to_shard_channel[Strict3]" + "test/test_mixins/test_pubsub_commands.py::test_pubsub_shardnumsub[Strict2]" + "test/test_mixins/test_pubsub_commands.py::test_pubsub_shardnumsub[Strict3]" + ) + + local EPYTEST_IGNORE=( + # these tests fail a lot... + test/test_hypothesis + test/test_hypothesis_joint.py + ) + + case ${server} in + redis) + EPYTEST_DESELECT+=( + "test/test_mixins/test_acl_commands.py::test_acl_cat[Strict2]" + "test/test_mixins/test_acl_commands.py::test_acl_cat[Strict3]" + "test/test_async/test_redis_only.py::test_async_lock[fake_resp2]" + "test/test_async/test_redis_only.py::test_async_lock[fake_resp3]" + "test/test_mixins/test_set_commands.py::test_smismember_wrong_type[FakeStrict2]" + "test/test_mixins/test_set_commands.py::test_smismember_wrong_type[FakeStrict3]" + "test/test_mixins/test_set_commands.py::test_smismember_wrong_type[Strict2]" + "test/test_mixins/test_set_commands.py::test_smismember_wrong_type[Strict3]" + ) + + # run fake tests only once + # TODO: figure out how to run tcp_server tests + # they fail if a server is running, + # and conftest fails if one isn't running + epytest -m "not real and not tcp_server" + ;; + valkey) + EPYTEST_DESELECT+=( + test/test_stack/test_vectorset.py + ) + ;; + esac + + # we can run "fake" tests in parallel, but "real" seem to share + # the same connection + EPYTEST_XDIST= epytest -m "real" +} |
