summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-04-10 10:00:50 +0200
committerMichał Górny <mgorny@gentoo.org>2021-04-10 10:59:56 +0200
commit56ec9b13978d1391edd8b7b9a3d9439d3c2ba6bc (patch)
tree96115046ebe369d4a4da6e1d1d62ee9f6e7b63f4
parentdev-python/url-normalize: New dep of dev-python/requests-cache (diff)
downloadgentoo-56ec9b13978d1391edd8b7b9a3d9439d3c2ba6bc.tar.gz
gentoo-56ec9b13978d1391edd8b7b9a3d9439d3c2ba6bc.tar.bz2
gentoo-56ec9b13978d1391edd8b7b9a3d9439d3c2ba6bc.zip
dev-python/requests-cache: Bump to 0.6.0
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--dev-python/requests-cache/Manifest1
-rw-r--r--dev-python/requests-cache/files/requests-cache-0.6.0-test-install.patch25
-rw-r--r--dev-python/requests-cache/requests-cache-0.6.0.ebuild69
3 files changed, 95 insertions, 0 deletions
diff --git a/dev-python/requests-cache/Manifest b/dev-python/requests-cache/Manifest
index 8f1ffcb456ee..858021548fd4 100644
--- a/dev-python/requests-cache/Manifest
+++ b/dev-python/requests-cache/Manifest
@@ -1 +1,2 @@
DIST requests-cache-0.5.2.tar.gz 31159 BLAKE2B 4fca146a751064baf70954a71df64dbb7f8c9a4e27fec5dbea3620496ce78e7ccfb3785fb63705f513ff6fa938376b0c6acc4a2f584856060b1bc8388517df46 SHA512 355cc571a46b768615606a907a69ed065b3c4b5e74bb6c311abc7a28d9406f32fdea1db0dfd2b1c32dcdc82ed817ef7e0b30086c069de57307254617604c5177
+DIST requests-cache-0.6.0.tar.gz 52342 BLAKE2B 12af89721fcf1ae2e4ab14d7ac377f119ef312c64d3b9e5d80a36f26f3a9a798cf090835ee2c9bf886d0baa9b472f4c439d5a032573d442feecbbad930c239fd SHA512 b5b32b9cb99ec51cee67defde715df66b7c50a26f4124cbaf893685048fe188af0cf664232150e3b4fafe3b7a927716966efafadd711be01118d67ad802acef6
diff --git a/dev-python/requests-cache/files/requests-cache-0.6.0-test-install.patch b/dev-python/requests-cache/files/requests-cache-0.6.0-test-install.patch
new file mode 100644
index 000000000000..3862716c3016
--- /dev/null
+++ b/dev-python/requests-cache/files/requests-cache-0.6.0-test-install.patch
@@ -0,0 +1,25 @@
+From 430424bf43ad1f5979adbb2eabdbb23726465fde Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 10 Apr 2021 10:56:39 +0200
+Subject: [PATCH] Do not install "tests" package
+
+---
+ setup.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 5ca5b80..58d8e89 100644
+--- a/setup.py
++++ b/setup.py
+@@ -40,7 +40,7 @@ extras_require['dev'] = list(chain.from_iterable(extras_require.values()))
+
+ setup(
+ name='requests-cache',
+- packages=find_packages(),
++ packages=find_packages(exclude=['tests*']),
+ version=__version__,
+ author='Roman Haritonov',
+ author_email='reclosedev@gmail.com',
+--
+2.31.1
+
diff --git a/dev-python/requests-cache/requests-cache-0.6.0.ebuild b/dev-python/requests-cache/requests-cache-0.6.0.ebuild
new file mode 100644
index 000000000000..28591398044e
--- /dev/null
+++ b/dev-python/requests-cache/requests-cache-0.6.0.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7..9} )
+PYTHON_REQ_USE="sqlite"
+
+inherit distutils-r1
+
+HOMEPAGE="https://pypi.org/project/requests-cache/"
+DESCRIPTION="Persistent cache for requests library"
+SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+ dev-python/itsdangerous[${PYTHON_USEDEP}]
+ >=dev-python/requests-2.0.0[${PYTHON_USEDEP}]
+ >=dev-python/url-normalize-1.4[${PYTHON_USEDEP}]"
+BDEPEND="
+ test? (
+ $(python_gen_any_dep '
+ dev-python/httpbin[${PYTHON_USEDEP}]
+ www-servers/gunicorn[${PYTHON_USEDEP}]
+ ')
+ )"
+
+distutils_enable_sphinx docs
+distutils_enable_tests pytest
+
+PATCHES=(
+ "${FILESDIR}"/${P}-test-install.patch
+)
+
+python_check_deps() {
+ use test || return 0
+
+ has_version -b "dev-python/httpbin[${PYTHON_USEDEP}]" &&
+ has_version -b "www-servers/gunicorn[${PYTHON_USEDEP}]"
+}
+
+src_test() {
+ local hostport="127.0.0.1:23125"
+ python_setup
+ einfo "Starting httpbin on ${hostport}"
+ gunicorn -b "${hostport}" -D -p gunicorn.pid httpbin:app || die
+
+ local -x HTTPBIN_URL="http://${hostport}/"
+ distutils-r1_src_test
+ kill $(<gunicorn.pid) || die
+}
+
+python_test() {
+ local skipped_tests=(
+ # These require extra servers running
+ tests/integration/test_dynamodb.py
+ tests/integration/test_gridfs.py
+ tests/integration/test_mongodb.py
+ tests/integration/test_redis.py
+
+ # TODO
+ 'tests/integration/test_cache.py::test_all_response_formats[json]'
+ )
+
+ epytest ${skipped_tests[@]/#/--deselect }
+}