Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/requests-cache/files/, dev-python/requests-cache/
Date: Sat, 10 Apr 2021 09:00:25
Message-Id: 1618045196.56ec9b13978d1391edd8b7b9a3d9439d3c2ba6bc.mgorny@gentoo
1 commit: 56ec9b13978d1391edd8b7b9a3d9439d3c2ba6bc
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 10 08:00:50 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 10 08:59:56 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56ec9b13
7
8 dev-python/requests-cache: Bump to 0.6.0
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/requests-cache/Manifest | 1 +
13 .../files/requests-cache-0.6.0-test-install.patch | 25 ++++++++
14 .../requests-cache/requests-cache-0.6.0.ebuild | 69 ++++++++++++++++++++++
15 3 files changed, 95 insertions(+)
16
17 diff --git a/dev-python/requests-cache/Manifest b/dev-python/requests-cache/Manifest
18 index 8f1ffcb456e..858021548fd 100644
19 --- a/dev-python/requests-cache/Manifest
20 +++ b/dev-python/requests-cache/Manifest
21 @@ -1 +1,2 @@
22 DIST requests-cache-0.5.2.tar.gz 31159 BLAKE2B 4fca146a751064baf70954a71df64dbb7f8c9a4e27fec5dbea3620496ce78e7ccfb3785fb63705f513ff6fa938376b0c6acc4a2f584856060b1bc8388517df46 SHA512 355cc571a46b768615606a907a69ed065b3c4b5e74bb6c311abc7a28d9406f32fdea1db0dfd2b1c32dcdc82ed817ef7e0b30086c069de57307254617604c5177
23 +DIST requests-cache-0.6.0.tar.gz 52342 BLAKE2B 12af89721fcf1ae2e4ab14d7ac377f119ef312c64d3b9e5d80a36f26f3a9a798cf090835ee2c9bf886d0baa9b472f4c439d5a032573d442feecbbad930c239fd SHA512 b5b32b9cb99ec51cee67defde715df66b7c50a26f4124cbaf893685048fe188af0cf664232150e3b4fafe3b7a927716966efafadd711be01118d67ad802acef6
24
25 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
26 new file mode 100644
27 index 00000000000..3862716c301
28 --- /dev/null
29 +++ b/dev-python/requests-cache/files/requests-cache-0.6.0-test-install.patch
30 @@ -0,0 +1,25 @@
31 +From 430424bf43ad1f5979adbb2eabdbb23726465fde Mon Sep 17 00:00:00 2001
32 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
33 +Date: Sat, 10 Apr 2021 10:56:39 +0200
34 +Subject: [PATCH] Do not install "tests" package
35 +
36 +---
37 + setup.py | 2 +-
38 + 1 file changed, 1 insertion(+), 1 deletion(-)
39 +
40 +diff --git a/setup.py b/setup.py
41 +index 5ca5b80..58d8e89 100644
42 +--- a/setup.py
43 ++++ b/setup.py
44 +@@ -40,7 +40,7 @@ extras_require['dev'] = list(chain.from_iterable(extras_require.values()))
45 +
46 + setup(
47 + name='requests-cache',
48 +- packages=find_packages(),
49 ++ packages=find_packages(exclude=['tests*']),
50 + version=__version__,
51 + author='Roman Haritonov',
52 + author_email='reclosedev@×××××.com',
53 +--
54 +2.31.1
55 +
56
57 diff --git a/dev-python/requests-cache/requests-cache-0.6.0.ebuild b/dev-python/requests-cache/requests-cache-0.6.0.ebuild
58 new file mode 100644
59 index 00000000000..28591398044
60 --- /dev/null
61 +++ b/dev-python/requests-cache/requests-cache-0.6.0.ebuild
62 @@ -0,0 +1,69 @@
63 +# Copyright 1999-2021 Gentoo Authors
64 +# Distributed under the terms of the GNU General Public License v2
65 +
66 +EAPI=7
67 +
68 +PYTHON_COMPAT=( python3_{7..9} )
69 +PYTHON_REQ_USE="sqlite"
70 +
71 +inherit distutils-r1
72 +
73 +HOMEPAGE="https://pypi.org/project/requests-cache/"
74 +DESCRIPTION="Persistent cache for requests library"
75 +SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
76 +
77 +LICENSE="BSD"
78 +SLOT="0"
79 +KEYWORDS="~amd64 ~x86"
80 +
81 +RDEPEND="
82 + dev-python/itsdangerous[${PYTHON_USEDEP}]
83 + >=dev-python/requests-2.0.0[${PYTHON_USEDEP}]
84 + >=dev-python/url-normalize-1.4[${PYTHON_USEDEP}]"
85 +BDEPEND="
86 + test? (
87 + $(python_gen_any_dep '
88 + dev-python/httpbin[${PYTHON_USEDEP}]
89 + www-servers/gunicorn[${PYTHON_USEDEP}]
90 + ')
91 + )"
92 +
93 +distutils_enable_sphinx docs
94 +distutils_enable_tests pytest
95 +
96 +PATCHES=(
97 + "${FILESDIR}"/${P}-test-install.patch
98 +)
99 +
100 +python_check_deps() {
101 + use test || return 0
102 +
103 + has_version -b "dev-python/httpbin[${PYTHON_USEDEP}]" &&
104 + has_version -b "www-servers/gunicorn[${PYTHON_USEDEP}]"
105 +}
106 +
107 +src_test() {
108 + local hostport="127.0.0.1:23125"
109 + python_setup
110 + einfo "Starting httpbin on ${hostport}"
111 + gunicorn -b "${hostport}" -D -p gunicorn.pid httpbin:app || die
112 +
113 + local -x HTTPBIN_URL="http://${hostport}/"
114 + distutils-r1_src_test
115 + kill $(<gunicorn.pid) || die
116 +}
117 +
118 +python_test() {
119 + local skipped_tests=(
120 + # These require extra servers running
121 + tests/integration/test_dynamodb.py
122 + tests/integration/test_gridfs.py
123 + tests/integration/test_mongodb.py
124 + tests/integration/test_redis.py
125 +
126 + # TODO
127 + 'tests/integration/test_cache.py::test_all_response_formats[json]'
128 + )
129 +
130 + epytest ${skipped_tests[@]/#/--deselect }
131 +}