dev-python/stripe: Bump to 9.11.0

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2024-06-14 03:28:35 +02:00
parent b3d4c12891
commit 5ce767ea7d
2 changed files with 89 additions and 0 deletions

View File

@@ -1,2 +1,3 @@
DIST stripe-9.10.0.tar.gz 1273670 BLAKE2B ebe42096846a124dea93744b26103dfc0a82f51191be612962258d7ab8c903e3da707dad3e35bafaa7431dd65a08234d9df5f9a614ff1959d86dc2d992ae7ad0 SHA512 f2a22534703add04512fa5ee124bd0ac48dd8a69dd19438260e9fce2cd00b659b9b014f76e325b6b0e51c79c157d15acb775d4ee4e1401a837d7e7dd81e81191
DIST stripe-9.11.0.tar.gz 1276871 BLAKE2B 82d02301e4e08c98593631c16b44de5b8481f918839f2839575c8fb8a89a4245436950406e1cf13cb78999a965e8f085bd49821f5214341928be1d3cadd40563 SHA512 2f4878c704ef7b1e782b8264a47c7151d6bd9e7ad4b2799f97a753c00e3ae18c7f4425bdab7d58443bf0111e9da90eb577e047551682132f0682782556c5c1fa
DIST stripe-9.8.0.tar.gz 1268721 BLAKE2B 12eeb333a51e71f39c366dda1a4bf82c15f7c3673fc4d27c0e25b978a19902b722d44d5b0f17c017638740cb95f353a024f5012ad70b13c0ac7f7b420df4b082 SHA512 3b19ba9709818af12ba2110b32232c9a33f3a43ce33dfeb8a1e0a7c8a2d643f96795ef474ccdef9e780c1ab58bfa3e687105311cc1d5d24c2984d442d539706b

View File

@@ -0,0 +1,88 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{10..12} pypy3 )
inherit distutils-r1 pypi
DESCRIPTION="Stripe python bindings"
HOMEPAGE="
https://github.com/stripe/stripe-python/
https://pypi.org/project/stripe/
"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~x86"
IUSE="telemetry"
RDEPEND="
>=dev-python/requests-2.20[${PYTHON_USEDEP}]
>=dev-python/typing-extensions-4.5.0[${PYTHON_USEDEP}]
"
# please bump dev-util/stripe-mock dep to the latest version on every bump
BDEPEND="
test? (
>=dev-util/stripe-mock-0.186.0
dev-python/aiohttp[${PYTHON_USEDEP}]
dev-python/anyio[${PYTHON_USEDEP}]
dev-python/httpx[${PYTHON_USEDEP}]
dev-python/pytest-mock[${PYTHON_USEDEP}]
dev-python/trio[${PYTHON_USEDEP}]
net-misc/curl
)
"
distutils_enable_tests pytest
DOCS=( LONG_DESCRIPTION.rst CHANGELOG.md README.md )
src_prepare() {
if ! use telemetry; then
sed -i -e '/enable_telemetry/s:True:False:' stripe/__init__.py || die
fi
# https://github.com/stripe/stripe-python/pull/1297
sed -e 's:from mock:from unittest.mock:' \
-i tests/test_http_client.py || die
distutils-r1_src_prepare
}
python_test() {
local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
epytest tests -p anyio -p pytest_mock
}
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"
}