diff options
author | Michał Górny <mgorny@gentoo.org> | 2023-02-03 07:47:25 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2023-02-03 08:19:16 +0100 |
commit | c4a6c4f74e3ef87684d7059bff9ebe082145e2e9 (patch) | |
tree | a10abd71277974f606478ac5791d261134750e8b /dev-python/stripe | |
parent | dev-util/stripe-mock: Bump to 0.151.0 (diff) | |
download | gentoo-c4a6c4f74e3ef87684d7059bff9ebe082145e2e9.tar.gz gentoo-c4a6c4f74e3ef87684d7059bff9ebe082145e2e9.tar.bz2 gentoo-c4a6c4f74e3ef87684d7059bff9ebe082145e2e9.zip |
dev-python/stripe: Bump to 5.1.0
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/stripe')
-rw-r--r-- | dev-python/stripe/Manifest | 1 | ||||
-rw-r--r-- | dev-python/stripe/stripe-5.1.0.ebuild | 71 |
2 files changed, 72 insertions, 0 deletions
diff --git a/dev-python/stripe/Manifest b/dev-python/stripe/Manifest index 64c65167e623..d4779584062e 100644 --- a/dev-python/stripe/Manifest +++ b/dev-python/stripe/Manifest @@ -1 +1,2 @@ DIST stripe-5.0.0.tar.gz 267241 BLAKE2B 6b4a58a355baf2d16d6de8667d1dff655c3334b58933c6172b25963f90bf072ebb5fae197faafd69285ceaaf06ba952c7012c35222df873d0453ec9fcee45cd5 SHA512 3d782abd3d6983734b6248fcb44cb69609475e14b820062882439c11ba8ba64e19f3db7984902157adaf0a80f9c26d18e7fbe414eb27bfeda95a7fae78a07577 +DIST stripe-5.1.0.tar.gz 267508 BLAKE2B 973f286c1a6a6703e903d65267465def0a99c15e65b034a690f12d51e6572412f1007eb8fa7ba9df41f4450e09c8b0584a1ce472d0815757ef1e402021daec67 SHA512 1afe76180922bfdd90c19d9a6326a98a9cc8e138fc9bb26c42f245373f8b4b93bc0144d3c41e0fd5f278fe425f6bb219cda7d4f993db845756de22c0047cb228 diff --git a/dev-python/stripe/stripe-5.1.0.ebuild b/dev-python/stripe/stripe-5.1.0.ebuild new file mode 100644 index 000000000000..25678121e96f --- /dev/null +++ b/dev-python/stripe/stripe-5.1.0.ebuild @@ -0,0 +1,71 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{9..11} 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.151.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" +} |