From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1619389-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id DD991158041
	for <garchives@archives.gentoo.org>; Thu, 11 Apr 2024 04:25:22 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 1D736E29FE;
	Thu, 11 Apr 2024 04:25:20 +0000 (UTC)
Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id B8F3AE29FD
	for <gentoo-commits@lists.gentoo.org>; Thu, 11 Apr 2024 04:25:19 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 08F8E3430A3
	for <gentoo-commits@lists.gentoo.org>; Thu, 11 Apr 2024 04:25:19 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 0923C16BA
	for <gentoo-commits@lists.gentoo.org>; Thu, 11 Apr 2024 04:25:16 +0000 (UTC)
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Message-ID: <1712809204.d8860969dd4d89a8e8a20d67a0edc75864f48d6f.mgorny@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/stripe/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-python/stripe/Manifest dev-python/stripe/stripe-9.0.0.ebuild
X-VCS-Directories: dev-python/stripe/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: d8860969dd4d89a8e8a20d67a0edc75864f48d6f
X-VCS-Branch: master
Date: Thu, 11 Apr 2024 04:25:16 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 99eb4cf5-4665-45c1-825f-11e40a02c754
X-Archives-Hash: 4498311814770fcbf289c4afaf80a9e3

commit:     d8860969dd4d89a8e8a20d67a0edc75864f48d6f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 11 03:55:58 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Apr 11 04:20:04 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8860969

dev-python/stripe: Bump to 9.0.0

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

 dev-python/stripe/Manifest            |  1 +
 dev-python/stripe/stripe-9.0.0.ebuild | 88 +++++++++++++++++++++++++++++++++++
 2 files changed, 89 insertions(+)

diff --git a/dev-python/stripe/Manifest b/dev-python/stripe/Manifest
index 0675e097a85c..b6e77e4b41b7 100644
--- a/dev-python/stripe/Manifest
+++ b/dev-python/stripe/Manifest
@@ -2,3 +2,4 @@ DIST stripe-8.10.0.tar.gz 1208587 BLAKE2B 844f220b8d7a5c53fda9d5d11418098dada870
 DIST stripe-8.11.0.tar.gz 1215071 BLAKE2B 7e3eec2008582a7ba52bf6c9a9676f5886cb3a52aed06302f2a21c572db01c759f5a48a743ee32d76cd54d28acb507b46ee556a10b277c6727e0737f055506bf SHA512 9d53ed3e253f18de36dfaf3c28fbcba7ef957f35b6f117c0dcb50040e0484f6fde1f3deb816d51aac62ddad64a20ae344acd25d680ec10c7fa7ddde1cf16c0ec
 DIST stripe-8.7.0.tar.gz 1080685 BLAKE2B 0d91f852ad88cf09fb5230a421f9b9b5ade3e7617e95f6f0b5ff3bb14e307d272c1d8600a2673d63a408ca24501e71383fa18f527433e9fbc816f6a48fb9c576 SHA512 977c57a4bad1b572dbee566609f28a9b7e3bffea6516ac48b1f69c51a8ee8fb44d342ce886e2809f6c18b633c30f57e35c565817f2dd67d82c23048dc47d66e5
 DIST stripe-8.9.0.tar.gz 1124248 BLAKE2B 158b070256404dfa7f5d2a13f076c08834fc0ec5c3f0564912bcd461276d790faf0530260f291f8681c357de727465ab900339b4d53ddf93972ace7411748ff8 SHA512 e4505262720eaccffd5b5e12858df1ca81117bdb9103ac7f9425ae50f93ac621b13587a314edc80546f1f6c4b28c5908fcd34f31dacc8e2c80b4532bf56fb63e
+DIST stripe-9.0.0.tar.gz 1214282 BLAKE2B b96e5dc11eebbd5222bcc21f8767b0ea37d92b72c02a96f1bf368839c03dd4ef7e6844c90c124bb0f921da12718e3ec7246e75b4371a84a89a1ce1fcb25b6b48 SHA512 1af49ac3d9e3c7a041c035ac7766191f7b2aac39afd173a2e5ffdb4678e535dbdad5cfe1ef70f241296740329d75af5a8096d35e85c422bdb3266fa7f49459c9

diff --git a/dev-python/stripe/stripe-9.0.0.ebuild b/dev-python/stripe/stripe-9.0.0.ebuild
new file mode 100644
index 000000000000..eb4a5aa2c699
--- /dev/null
+++ b/dev-python/stripe/stripe-9.0.0.ebuild
@@ -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.183.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"
+}