diff options
author | Michał Górny <mgorny@gentoo.org> | 2022-06-08 21:34:08 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2022-06-08 21:40:31 +0200 |
commit | 60dcbd5b490413562f92f7694caa030938a7820b (patch) | |
tree | 6b1662d14c652d30b8188edad8fe98281254bb47 /dev-python | |
parent | dev-python/keyring: Bump to 23.6.0 (diff) | |
download | gentoo-60dcbd5b490413562f92f7694caa030938a7820b.tar.gz gentoo-60dcbd5b490413562f92f7694caa030938a7820b.tar.bz2 gentoo-60dcbd5b490413562f92f7694caa030938a7820b.zip |
dev-python/stripe: Bump to 3.3.0
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python')
-rw-r--r-- | dev-python/stripe/Manifest | 1 | ||||
-rw-r--r-- | dev-python/stripe/stripe-3.3.0.ebuild | 71 |
2 files changed, 72 insertions, 0 deletions
diff --git a/dev-python/stripe/Manifest b/dev-python/stripe/Manifest index 42c119ce110b..68decf98053f 100644 --- a/dev-python/stripe/Manifest +++ b/dev-python/stripe/Manifest @@ -1 +1,2 @@ DIST stripe-3.2.0.tar.gz 245873 BLAKE2B c75864cebc4b62c116138bb3b9fcc7b521a7c89c7252bb2ad03520b0904ad701bab27fbe1a0ae500a2782bf737295218180991fe0d5f224038f7bdcfd2596598 SHA512 dbeb846294928fd608d547b8e4aedf188345ce68ce6e9b4c046e86e5a622d96281cf0507db4d1ba5834c68252bda573da7dac725aa1d7cbeb820c65e166f3a1a +DIST stripe-3.3.0.tar.gz 246317 BLAKE2B f734df83509b6c77f865d52b2ec17ac5ac271661478706787616afde1f85cb356f05c2fff63289b3bb180658abab546d39245563f18f4f7a3e8b72a0e578fb34 SHA512 4f00fd9901a5b4d873c4a9a00483f57f4cd9359f8a440b3d783e7aeed250e33400a7405ca8ea5af29fd1b44bc84c65fa59c8121e4ffb4852584ffd3fc2099910 diff --git a/dev-python/stripe/stripe-3.3.0.ebuild b/dev-python/stripe/stripe-3.3.0.ebuild new file mode 100644 index 000000000000..1dc081924988 --- /dev/null +++ b/dev-python/stripe/stripe-3.3.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..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.130.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" +} |