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: Wed, 04 May 2022 08:19:56
Message-Id: 1651652381.ae2ab9f12b3a446937782407d35e0244f271e453.mgorny@gentoo
1 commit: ae2ab9f12b3a446937782407d35e0244f271e453
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 4 07:33:53 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed May 4 08:19:41 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae2ab9f1
7
8 dev-python/stripe: Bump to 2.75.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.75.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 5bd3002993be..13f22820372e 100644
18 --- a/dev-python/stripe/Manifest
19 +++ b/dev-python/stripe/Manifest
20 @@ -1 +1,2 @@
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
24 diff --git a/dev-python/stripe/stripe-2.75.0.ebuild b/dev-python/stripe/stripe-2.75.0.ebuild
25 new file mode 100644
26 index 000000000000..a0b230f30493
27 --- /dev/null
28 +++ b/dev-python/stripe/stripe-2.75.0.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..10} 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.124.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 +}