1 |
commit: c2a3fa6ff1c51224afff746f911e821ec91f8c33 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Aug 7 08:37:07 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Aug 7 08:49:36 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2a3fa6f |
7 |
|
8 |
dev-python/stripe: Bump to 4.0.2 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
dev-python/stripe/Manifest | 1 + |
13 |
dev-python/stripe/stripe-4.0.2.ebuild | 71 +++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 72 insertions(+) |
15 |
|
16 |
diff --git a/dev-python/stripe/Manifest b/dev-python/stripe/Manifest |
17 |
index 337fc5ba0841..909474eb2b5d 100644 |
18 |
--- a/dev-python/stripe/Manifest |
19 |
+++ b/dev-python/stripe/Manifest |
20 |
@@ -1 +1,2 @@ |
21 |
DIST stripe-3.5.0.tar.gz 247698 BLAKE2B 8c47b3f4af21934d4dddea2d95831d5d4772c0cf42f8a5d3cff90dbd2dfd51a37c34f92b6df30ddcafbb1ccbde766744ec63fe62881acabbf1437a626ec0ef6c SHA512 67e63f95b489e049d81d9b3929342a8cc2bc3638060d9f278752459d32408bfe8d5f09c4c047a1ed0deedce875b0a84873a3b120f6bb5f30c0668eda5129e4ee |
22 |
+DIST stripe-4.0.2.tar.gz 252436 BLAKE2B d05153e4ddc58b5cbb9f42202a5b8dbcaeff39fab51b5415c59bbbfd615003b4d76881a408fd067a0e17d275a663e7ac8d574af6ead90f9c51e677617ef6117b SHA512 b13ace2419555e21a93f37a328bd59d9ac8af69787dc89ed4851ce5a5a616a34e63d5667b9981f43c486dafee18186a9dc32524c047c9db204dc8ba831198c91 |
23 |
|
24 |
diff --git a/dev-python/stripe/stripe-4.0.2.ebuild b/dev-python/stripe/stripe-4.0.2.ebuild |
25 |
new file mode 100644 |
26 |
index 000000000000..85f74b80fdad |
27 |
--- /dev/null |
28 |
+++ b/dev-python/stripe/stripe-4.0.2.ebuild |
29 |
@@ -0,0 +1,71 @@ |
30 |
+# Copyright 1999-2022 Gentoo Authors |
31 |
+# Distributed under the terms of the GNU General Public License v2 |
32 |
+ |
33 |
+EAPI=8 |
34 |
+ |
35 |
+DISTUTILS_USE_PEP517=setuptools |
36 |
+PYTHON_COMPAT=( python3_{8..11} pypy3 ) |
37 |
+ |
38 |
+inherit distutils-r1 |
39 |
+ |
40 |
+DESCRIPTION="Stripe python bindings" |
41 |
+HOMEPAGE=" |
42 |
+ https://github.com/stripe/stripe-python/ |
43 |
+ https://pypi.org/project/stripe/ |
44 |
+" |
45 |
+SRC_URI="mirror://pypi/s/${PN}/${P}.tar.gz" |
46 |
+ |
47 |
+LICENSE="MIT" |
48 |
+SLOT="0" |
49 |
+KEYWORDS="~amd64 ~x86" |
50 |
+ |
51 |
+RDEPEND=" |
52 |
+ >=dev-python/requests-2.20[${PYTHON_USEDEP}] |
53 |
+" |
54 |
+BDEPEND=" |
55 |
+ test? ( |
56 |
+ >=dev-util/stripe-mock-0.141.0 |
57 |
+ dev-python/pytest-mock[${PYTHON_USEDEP}] |
58 |
+ net-misc/curl |
59 |
+ ) |
60 |
+" |
61 |
+ |
62 |
+distutils_enable_tests pytest |
63 |
+ |
64 |
+DOCS=( LONG_DESCRIPTION.rst CHANGELOG.md README.md ) |
65 |
+ |
66 |
+python_test() { |
67 |
+ epytest tests |
68 |
+} |
69 |
+ |
70 |
+src_test() { |
71 |
+ local stripe_mock_port=12111 |
72 |
+ local stripe_mock_max_port=12121 |
73 |
+ local stripe_mock_logfile="${T}/stripe_mock_${EPYTHON}.log" |
74 |
+ # Try to start stripe-mock until we find a free port |
75 |
+ while [[ "${stripe_mock_port}" -le "${stripe_mock_max_port}" ]]; do |
76 |
+ ebegin "Trying to start stripe-mock on port ${stripe_mock_port}" |
77 |
+ stripe-mock --http-port ${stripe_mock_port} &> "${stripe_mock_logfile}" & |
78 |
+ local stripe_mock_pid=$! |
79 |
+ sleep 2 |
80 |
+ # Did stripe-mock start? |
81 |
+ curl --fail -u "sk_test_123:" \ |
82 |
+ http://127.0.0.1:${stripe_mock_port}/v1/customers &> /dev/null |
83 |
+ eend $? "Port ${stripe_mock_port} unavailable" |
84 |
+ if [[ $? -eq 0 ]]; then |
85 |
+ einfo "stripe-mock running on port ${stripe_mock_port}" |
86 |
+ break |
87 |
+ fi |
88 |
+ (( stripe_mock_port++ )) |
89 |
+ done |
90 |
+ if [[ "${stripe_mock_port}" -gt "${stripe_mock_max_port}" ]]; then |
91 |
+ eerror "Unable to start stripe-mock for tests" |
92 |
+ die "Please see the logfile located at: ${stripe_mock_logfile}" |
93 |
+ fi |
94 |
+ |
95 |
+ local -x STRIPE_MOCK_PORT=${stripe_mock_port} |
96 |
+ distutils-r1_src_test |
97 |
+ |
98 |
+ # Tear down stripe-mock |
99 |
+ kill "${stripe_mock_pid}" || die "Unable to stop stripe-mock" |
100 |
+} |