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