summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-11-03 04:35:05 +0100
committerMichał Górny <mgorny@gentoo.org>2024-11-03 04:36:58 +0100
commit95536337abdf12e7500696f409366de8e573e068 (patch)
tree8c4a4f41d0b9cca6d0e7e989e3591a4fda8becd8
parentdev-python/hishel: Remove old (diff)
downloadgentoo-95536337abdf12e7500696f409366de8e573e068.tar.gz
gentoo-95536337abdf12e7500696f409366de8e573e068.tar.bz2
gentoo-95536337abdf12e7500696f409366de8e573e068.zip
dev-python/hishel: Bump to 0.1.1
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--dev-python/hishel/Manifest1
-rw-r--r--dev-python/hishel/hishel-0.1.1.ebuild73
2 files changed, 74 insertions, 0 deletions
diff --git a/dev-python/hishel/Manifest b/dev-python/hishel/Manifest
index 385ea42b6573..48bd2479354e 100644
--- a/dev-python/hishel/Manifest
+++ b/dev-python/hishel/Manifest
@@ -1 +1,2 @@
DIST hishel-0.0.33.gh.tar.gz 836608 BLAKE2B f2db821b66ab0387756c503f2c844704bfbce7d98399b2454ed1b0f5e65ed946e9d857412ac7f9bbb5532e8cc8546fe7e8480f29d87e61d287690a82879d5773 SHA512 c69261b0f3af45c57f9d95114bfe03c64c7f6490429f9c00dbad41935da16a3125c08d4aaf613686a29c54b5a13b1884dd0c298b718158b25ee28422f3c236be
+DIST hishel-0.1.1.gh.tar.gz 877049 BLAKE2B 6ab40873065490a86810fca1f0c868cdf792f0dcaef9eaed245a08c53ac5cfb8de70278577f05703024f4dd333ab4c6b3566002a6c4f428488c10e39899ec52e SHA512 f4fdb17cd444318e8e3fab264e611fb18fae82030ab77bd09783aeb7756fe7a5aa8ac288a442ee737257f9db0ce8218aadaf4eca845e999d13928e46b7ddc44a
diff --git a/dev-python/hishel/hishel-0.1.1.ebuild b/dev-python/hishel/hishel-0.1.1.ebuild
new file mode 100644
index 000000000000..814da3040ba5
--- /dev/null
+++ b/dev-python/hishel/hishel-0.1.1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=hatchling
+PYTHON_COMPAT=( python3_{10..13} )
+inherit distutils-r1
+
+DESCRIPTION="An elegant HTTP Cache implementation for HTTPX and HTTP Core"
+HOMEPAGE="
+ https://github.com/karpetrosyan/hishel
+ https://pypi.org/project/hishel/
+"
+SRC_URI="https://github.com/karpetrosyan/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.gh.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+
+RDEPEND="
+ dev-python/httpx[${PYTHON_USEDEP}]
+"
+
+BDEPEND="
+ ${RDEPEND}
+ dev-python/hatch-fancy-pypi-readme[${PYTHON_USEDEP}]
+ test? (
+ dev-db/redis
+ dev-python/anyio[${PYTHON_USEDEP}]
+ dev-python/boto3[${PYTHON_USEDEP}]
+ dev-python/moto[${PYTHON_USEDEP}]
+ dev-python/redis[${PYTHON_USEDEP}]
+ dev-python/trio[${PYTHON_USEDEP}]
+ )
+"
+
+distutils_enable_tests pytest
+
+python_prepare_all() {
+ sed -e 's:mock_s3:mock_aws:g' \
+ -e '/import anysqlite/ d' \
+ -i tests/_async/test_storages.py \
+ tests/_sync/test_storages.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+src_test() {
+ local EPYTEST_DESELECT=(
+ # tests that need anysqlite
+ tests/_async/test_storages.py::test_sqlitestorage
+ tests/_async/test_storages.py::test_sqlite_expired
+ tests/_async/test_storages.py::test_sqlite_ttl_after_hits
+ )
+
+ local redis_pid="${T}"/redis.pid
+ local redis_port=6379
+
+ einfo "Starting Redis"
+ "${EPREFIX}"/usr/sbin/redis-server - <<- EOF
+ daemonize yes
+ pidfile ${redis_pid}
+ port ${redis_port}
+ bind 127.0.0.1 ::1
+ EOF
+
+ # Run the tests
+ distutils-r1_src_test
+
+ # Clean up afterwards
+ kill "$(<"${redis_pid}")" || die
+}