commit:     ae2ab9f12b3a446937782407d35e0244f271e453
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May  4 07:33:53 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed May  4 08:19:41 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae2ab9f1

dev-python/stripe: Bump to 2.75.0

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/stripe/Manifest             |  1 +
 dev-python/stripe/stripe-2.75.0.ebuild | 71 ++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+)

diff --git a/dev-python/stripe/Manifest b/dev-python/stripe/Manifest
index 5bd3002993be..13f22820372e 100644
--- a/dev-python/stripe/Manifest
+++ b/dev-python/stripe/Manifest
@@ -1 +1,2 @@
 DIST stripe-2.74.0.tar.gz 240731 BLAKE2B 
68d80f0dab200087f454c98bfabf483ce7b6db06061d5dce81bc258e0425576b54a5e9c6a9134d59064ae978db4bdda407f12eaa8ac48b51a87722473732a8b9
 SHA512 
f7f549e5b5eec38248320f7852f0c5fa3476f3d68aab646f04f207e0d6be20cb54ed13e4093d40313502c9aed7b60392c20c1baded4bb845703647d8c022342b
+DIST stripe-2.75.0.tar.gz 240179 BLAKE2B 
db5c94bc21a584ab5241ebf639a7e78f8de56f46e9460dd00cecb8907fac701f4edae8adbdad249eb98921a3dc81ce670ad846784d7c5743b02eb28ee2f1c034
 SHA512 
e4ddc675cffa6b1fa087c8d68c9717f55b59016a22605d539a2c9f4d6b5746e166e7efb38d5a001b5c00d32678b3b263fce9a27537b6a3edcdd8c6f2a60eb5a5

diff --git a/dev-python/stripe/stripe-2.75.0.ebuild 
b/dev-python/stripe/stripe-2.75.0.ebuild
new file mode 100644
index 000000000000..a0b230f30493
--- /dev/null
+++ b/dev-python/stripe/stripe-2.75.0.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..10} pypy3 )
+
+inherit distutils-r1
+
+DESCRIPTION="Stripe python bindings"
+HOMEPAGE="
+       https://github.com/stripe/stripe-python/
+       https://pypi.org/project/stripe/
+"
+SRC_URI="mirror://pypi/s/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+       >=dev-python/requests-2.20[${PYTHON_USEDEP}]
+"
+BDEPEND="
+       test? (
+               >=dev-util/stripe-mock-0.124.0
+               dev-python/pytest-mock[${PYTHON_USEDEP}]
+               net-misc/curl
+       )
+"
+
+distutils_enable_tests pytest
+
+DOCS=( LONG_DESCRIPTION.rst CHANGELOG.md README.md )
+
+python_test() {
+       epytest tests
+}
+
+src_test() {
+       local stripe_mock_port=12111
+       local stripe_mock_max_port=12121
+       local stripe_mock_logfile="${T}/stripe_mock_${EPYTHON}.log"
+       # Try to start stripe-mock until we find a free port
+       while [[ "${stripe_mock_port}" -le "${stripe_mock_max_port}" ]]; do
+               ebegin "Trying to start stripe-mock on port ${stripe_mock_port}"
+               stripe-mock --http-port ${stripe_mock_port} &> 
"${stripe_mock_logfile}" &
+               local stripe_mock_pid=$!
+               sleep 2
+               # Did stripe-mock start?
+               curl --fail -u "sk_test_123:" \
+                       http://127.0.0.1:${stripe_mock_port}/v1/customers &> 
/dev/null
+               eend $? "Port ${stripe_mock_port} unavailable"
+               if [[ $? -eq 0 ]]; then
+                       einfo "stripe-mock running on port ${stripe_mock_port}"
+                       break
+               fi
+               (( stripe_mock_port++ ))
+       done
+       if [[ "${stripe_mock_port}" -gt "${stripe_mock_max_port}" ]]; then
+               eerror "Unable to start stripe-mock for tests"
+               die "Please see the logfile located at: ${stripe_mock_logfile}"
+       fi
+
+       local -x STRIPE_MOCK_PORT=${stripe_mock_port}
+       distutils-r1_src_test
+
+       # Tear down stripe-mock
+       kill "${stripe_mock_pid}" || die "Unable to stop stripe-mock"
+}

Reply via email to