summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-07-14 06:42:04 +0200
committerMichał Górny <mgorny@gentoo.org>2023-07-14 07:33:41 +0200
commit9276de77cd05780f2eb909dbecc1fba43f08e516 (patch)
tree3f85fe80a762f96b1db5c1a4a0797ae67199d560 /dev-python/stripe
parentdev-util/stripe-mock: Bump to 0.166.0 (diff)
downloadgentoo-9276de77cd05780f2eb909dbecc1fba43f08e516.tar.gz
gentoo-9276de77cd05780f2eb909dbecc1fba43f08e516.tar.bz2
gentoo-9276de77cd05780f2eb909dbecc1fba43f08e516.zip
dev-python/stripe: Bump to 5.5.0
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/stripe')
-rw-r--r--dev-python/stripe/Manifest1
-rw-r--r--dev-python/stripe/stripe-5.5.0.ebuild71
2 files changed, 72 insertions, 0 deletions
diff --git a/dev-python/stripe/Manifest b/dev-python/stripe/Manifest
index c88f7c1dd874..a1e9910ac341 100644
--- a/dev-python/stripe/Manifest
+++ b/dev-python/stripe/Manifest
@@ -1 +1,2 @@
DIST stripe-5.4.0.tar.gz 268711 BLAKE2B 2417174ceed571a7b8483992ac15ef9d19a037e5745118c2eec3094f8e848ec49b384f62bd4a136ed046b695bd753efc6064109c30a50aca539a1085b1e056fe SHA512 55351171184672ab55f38ed483078dbbb85216bf80d07726d1bb8848d24ff829a3d464d543182afafedfcaabdb516a5868bc4ac7d16f64f2dc2dc7c1ab2e152a
+DIST stripe-5.5.0.tar.gz 270144 BLAKE2B aab1f824f0b9e27b80e23ecc9267c4cfc9e4b952b14fa30e642587935d6a60076cb913e06d43ee5ee981e3d9603d73050ee92a8dd4dce7f0014839409cad1b7d SHA512 3023574e6b7e3037cb10ff20bf22e6b689f4fdf2f4ad04102b80e8dbe530a4d3f1c179dd9af1dab77f8a7d9da03573665ee22628b8ed35dbd655148b5621fc19
diff --git a/dev-python/stripe/stripe-5.5.0.ebuild b/dev-python/stripe/stripe-5.5.0.ebuild
new file mode 100644
index 000000000000..786a0183fe81
--- /dev/null
+++ b/dev-python/stripe/stripe-5.5.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_{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 ~x86"
+
+RDEPEND="
+ >=dev-python/requests-2.20[${PYTHON_USEDEP}]
+"
+# please bump dev-util/stripe-mock dep to the latest version on every bump
+BDEPEND="
+ test? (
+ >=dev-util/stripe-mock-0.166.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"
+}