From ca3bd9f1dbb28cc0f2759bed3c940ea2796b564f8044663ced85ede9175cc6fd Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 5 Feb 2025 05:12:11 +0000 Subject: [PATCH 1/2] - Update to 11.5.0: * Fix regression when using httpx HTTP client * Change the pinned API version to 2024-12-18.acacia. * Deserialize into correct v2 EventData types * update object tags for meter-related classes * Update the class for ThinEvent to include livemode * Add method to list invoice line items * Bump aiohttp from 3.9.0 to 3.9.4 * Use stdlib AsyncMock when available * Add TaxIds API * Remove http client base * Testing: unify http client mock * Remove broken child methods * Move StripeClient usage collection onto StripeService * Measure StripeClient usage * Introduce StripeClient and a service-based call pattern. - Do not run stripe-mock during check, the testsuite handles it for us. - Drop patch use-sys-executable.patch, included upstream. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-stripe?expand=0&rev=10 --- .gitattributes | 23 ++++++ .gitignore | 1 + python-stripe.changes | 148 +++++++++++++++++++++++++++++++++++++++ python-stripe.spec | 72 +++++++++++++++++++ stripe-11.5.0.tar.gz | 3 + stripe-7.12.0.tar.gz | 3 + use-sys-executable.patch | 31 ++++++++ 7 files changed, 281 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 python-stripe.changes create mode 100644 python-stripe.spec create mode 100644 stripe-11.5.0.tar.gz create mode 100644 stripe-7.12.0.tar.gz create mode 100644 use-sys-executable.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/python-stripe.changes b/python-stripe.changes new file mode 100644 index 0000000..24c89cc --- /dev/null +++ b/python-stripe.changes @@ -0,0 +1,148 @@ +------------------------------------------------------------------- +Wed Feb 5 05:11:47 UTC 2025 - Steve Kowalik + +- Update to 11.5.0: + * Fix regression when using httpx HTTP client + * Change the pinned API version to 2024-12-18.acacia. + * Deserialize into correct v2 EventData types + * update object tags for meter-related classes + * Update the class for ThinEvent to include livemode + * Add method to list invoice line items + * Bump aiohttp from 3.9.0 to 3.9.4 + * Use stdlib AsyncMock when available + * Add TaxIds API + * Remove http client base + * Testing: unify http client mock + * Remove broken child methods + * Move StripeClient usage collection onto StripeService + * Measure StripeClient usage + * Introduce StripeClient and a service-based call pattern. +- Do not run stripe-mock during check, the testsuite handles it for us. +- Drop patch use-sys-executable.patch, included upstream. + +------------------------------------------------------------------- +Fri Jan 19 03:23:20 UTC 2024 - Steve Kowalik + +- Drop patch also-skip-streaming.patch: + * No longer needed. +- Add BuildRequires on new stripe-mock service, and run it during the + check phase. + +------------------------------------------------------------------- +Wed Jan 17 03:12:47 UTC 2024 - Steve Kowalik + +- Update to 7.12.0: + * Add support for new resource `CustomerSession` + * Add support for `create` method on resource `CustomerSession` + * Remove support for values `obligation_inbound`, + `obligation_payout_failure`, `obligation_payout`, and + `obligation_reversal_outbound` from enum `BalanceTransaction.type` + * Remove support for value `obligation` from enum + `Reporting.ReportRunCreateParams.parameters.reporting_category` + * Mark defunct and internal methods as deprecated + * Do not raise a DeprecationWarning in `stripe.app_info` + * Fix __getattr__ to raise AttributeError rather than returning None. + * Add missing explicit reexport for `OAuth`, `Webhook`, `WebhookSignature` + * `stripe.api_version`, `stripe.multipart_data_generator`, + `stripe.request_metrics` are deprecated. + * Move resource type exports to stripe. + * Add support for new resources `Climate.Order`, `Climate.Product`, and + `Climate.Supplier` + * Add support for `cancel`, `create`, `list`, `modify`, and `retrieve` + methods on resource `Order` + * Add support for `exemption_indicator` on resource class + `Charge.PaymentMethodDetails.Card.ThreeDSecure` + * Add support for `Paypal` on `Checkout.Session.PaymentMethodOptions` + * Add support for Python 3.11/3.12 + * Include `py.typed` and enable type annotations for the package + * Behavior change: nested json objects will now deserialize into + instances of specific classes that subclass `StripeObject`. + * Behavior change: `PromotionCode.restrictions.currency_options` will now + deserialize into `dict` and not `StripeObject`. + * This release changes the pinned API version to `2023-10-16`. Please read + https://stripe.com/docs/upgrades#2023-10-16 and carefully review the API + changes. + * Require typing_extensions >= 4.0.0 + * Remove support for Python 2. + * https://github.com/stripe/stripe-python/wiki/Migration-guide-for-v6 for + more detailed instructions for 6.0.0+. + * Dropped support for Python version 3.4 and 3.5. + * Add `upcoming_lines` method to the `Invoice` resource. + * Add support for new resource `CustomerCashBalanceTransaction` + * Fix incorrect handling of additional request parameters + * Removed deprecated `AlipayAccount`, `BitcoinReceiver`, + `BitcoinTransaction`, `IssuerFraudRecord`, `Recipient`, + `RecipientTransfer`, and `ThreeDSecure` classes. + * Removed deprecated `Charge.update_dispute` and `Charge.close_dispute` + methods that were using legacy REST API endpoint. + * https://github.com/stripe/stripe-python/wiki/Migration-Guide-for-v3 + contains more information for 3.0.0+. +- Add patch use-sys-executable.patch: + * Use sys.executable when checking exports. +- Add patch also-skip-streaming.patch: + * Also skip streaming tests. +* Switch to autosetup and pyproject macros. + +------------------------------------------------------------------- +Sat Dec 11 16:24:22 UTC 2021 - Axel Braun + +- version 2.63.0 + * skip python2 + * API Updates + ** Add support for new resource ShippingRate + ** Add support for expire method on resource Checkout.Session + ** Add support for list_payment_methods method on resource Customer + * Stop sending raw exception message as part of Stripe user agent. + +------------------------------------------------------------------- +Fri Aug 13 08:34:39 UTC 2021 - Danilo Spinella + +- Update to v2.60.0 + * Add support for list_computed_upfront_line_items method on resource Quote + * Add support for new Quote API. + * Add support for new TaxCode API. + * Add support for Identity VerificationSession and VerificationReport APIs + * Add support for the Billing Portal Configuration API + +------------------------------------------------------------------- +Sat Feb 6 05:47:20 UTC 2021 - John Vandenberg + +- Add examples to packaged docs +- Update to v2.55.2 + * Fix CA bundle path +- from v2.55.1 + * Fix issue where StripeObjects in lists would not be converted to dicts + * Start testing Python 3.9 + * Include the examples in the built sources + +------------------------------------------------------------------- +Mon Nov 23 13:45:46 UTC 2020 - John Vandenberg + +- Activate tests on all platforms +- Update to v2.55 + +------------------------------------------------------------------- +Thu Aug 6 05:25:55 UTC 2020 - John Vandenberg + +- Activate tests on x86_64 +- Update to v2.50 + +------------------------------------------------------------------- +Sat Jul 25 08:17:10 UTC 2020 - John Vandenberg + +- Update to v2.49 + +------------------------------------------------------------------- +Sun May 17 08:32:11 UTC 2020 - John Vandenberg + +- Update to v2.48 + +------------------------------------------------------------------- +Tue Apr 7 11:13:06 UTC 2020 - John Vandenberg + +- Update to v2.45 + +------------------------------------------------------------------- +Tue Apr 7 11:13:06 UTC 2020 - John Vandenberg + +- Initial spec for v2.23 diff --git a/python-stripe.spec b/python-stripe.spec new file mode 100644 index 0000000..5e89f19 --- /dev/null +++ b/python-stripe.spec @@ -0,0 +1,72 @@ +# +# spec file for package python-stripe +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: python-stripe +Version: 11.5.0 +Release: 0 +Summary: Python bindings for the Stripe API +License: MIT +URL: https://github.com/stripe/stripe-python +Source: https://files.pythonhosted.org/packages/source/s/stripe/stripe-%{version}.tar.gz +BuildRequires: %{python_module aiohttp >= 3.9.4} +BuildRequires: %{python_module anyio} +BuildRequires: %{python_module httpx} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest >= 6.0} +BuildRequires: %{python_module pytest-mock >= 2.0} +BuildRequires: %{python_module pytest-xdist} +BuildRequires: %{python_module requests >= 2.20} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module trio} +BuildRequires: %{python_module typing_extensions >= 4.5.0} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildRequires: stripe-mock +Requires: python-requests >= 2.20 +Requires: python-typing_extensions >= 4.5.0 +Conflicts: python-stripe-api +BuildArch: noarch +%python_subpackages + +%description +Python bindings for the Stripe API. + +%prep +%autosetup -p1 -n stripe-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +# Raises invalid request +donttest="test_terminal_readers_process_setup_intent_post " +# Requires network +donttest+="or TestLiveHTTPClients or test_async_raw_request_timeout" +%pytest -k "not ($donttest)" + +%files %{python_files} +%doc CHANGELOG.md README.md examples/ +%license LICENSE +%{python_sitelib}/stripe +%{python_sitelib}/stripe-%{version}.dist-info + +%changelog diff --git a/stripe-11.5.0.tar.gz b/stripe-11.5.0.tar.gz new file mode 100644 index 0000000..a34c5b1 --- /dev/null +++ b/stripe-11.5.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc3e0358ffc23d5ecfa8aafec1fa4f048ee8107c3237bcb00003e68c8c96fa02 +size 1386601 diff --git a/stripe-7.12.0.tar.gz b/stripe-7.12.0.tar.gz new file mode 100644 index 0000000..91599cc --- /dev/null +++ b/stripe-7.12.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:121971bef27a79a20c3f0676f4d4ccf1207d04b7758327b3725e694bf53106b6 +size 783948 diff --git a/use-sys-executable.patch b/use-sys-executable.patch new file mode 100644 index 0000000..b871f33 --- /dev/null +++ b/use-sys-executable.patch @@ -0,0 +1,31 @@ +From 46b7f4b2facac4a73828a736d69101828dda71e0 Mon Sep 17 00:00:00 2001 +From: Steve Kowalik +Date: Wed, 17 Jan 2024 11:52:06 +1100 +Subject: [PATCH] Use sys.executable in test_exports + +Not all systems will have 'python' in the path to execute to check +exports -- and indeed, it may not even be the interpreter that is under +test and can import the module. Since we are already running under the +test suite, use sys.executable to check. +--- + tests/test_exports.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tests/test_exports.py b/tests/test_exports.py +index 9c7d9b980..149032109 100644 +--- a/tests/test_exports.py ++++ b/tests/test_exports.py +@@ -3,11 +3,12 @@ + from typing import Any + import stripe + import subprocess ++import sys + + + def assert_output(code: str, expected: str) -> None: + process = subprocess.Popen( +- ["python", "-c", f"import stripe; print({code})"], ++ [sys.executable, "-c", f"import stripe; print({code})"], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) From f9fad7015bc871f0456f29e836e7d8af106e4b5ced2a304f69ace4dbf423b5cb Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 12 Feb 2025 03:27:50 +0000 Subject: [PATCH 2/2] - We must run stripe-mock during check. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-stripe?expand=0&rev=11 --- python-stripe.changes | 5 +++++ python-stripe.spec | 3 +++ 2 files changed, 8 insertions(+) diff --git a/python-stripe.changes b/python-stripe.changes index 24c89cc..da2d97e 100644 --- a/python-stripe.changes +++ b/python-stripe.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Feb 12 03:27:26 UTC 2025 - Steve Kowalik + +- We must run stripe-mock during check. + ------------------------------------------------------------------- Wed Feb 5 05:11:47 UTC 2025 - Steve Kowalik diff --git a/python-stripe.spec b/python-stripe.spec index 5e89f19..f0c24f8 100644 --- a/python-stripe.spec +++ b/python-stripe.spec @@ -57,11 +57,14 @@ Python bindings for the Stripe API. %python_expand %fdupes %{buildroot}%{$python_sitelib} %check +stripe-mock & +pid=$! # Raises invalid request donttest="test_terminal_readers_process_setup_intent_post " # Requires network donttest+="or TestLiveHTTPClients or test_async_raw_request_timeout" %pytest -k "not ($donttest)" +kill $pid %files %{python_files} %doc CHANGELOG.md README.md examples/