KEMBAR78
⚠️ Remove deprecated compatibility exports by xavdid-stripe · Pull Request #1603 · stripe/stripe-python · GitHub
Skip to content

Conversation

@xavdid-stripe
Copy link
Member

@xavdid-stripe xavdid-stripe commented Sep 28, 2025

Why?

Back in version 7.8.0 (released Dec 2023), we moved a bunch of classes from a submodule into the root namespace. For example, stripe.error.APIError became stripe.APIError. We also added backwards-compatibility shims that printed deprecation warnings saying they'd be removed in a future version.

That time has come! The root stripe module is the place to get nearly all of these imports now. See below for the full list.

What?

  • (codegen) removed most compatibility shims
  • updated/fixed many tests to import from the real module, not root stripe
  • updated some examples, removed outdated ones

See Also

Changelog

  • ⚠️ Removed deprecated module shims. They've long been available in the stripe module directly; now that's the only place to import them. Specifically, we removed:
    • stripe.stripe_response
    • stripe.stripe_object
    • stripe.error_object
    • stripe.error
    • stripe.http_client
    • stripe.util
    • stripe.oauth
    • stripe.webhook
    • stripe.multipart_data_generator
    • stripe.request_metrics
    • stripe.api_resources.abstract
    • stripe.api_resources

To update your code, follow this pattern:

-from stripe.<MODULE> import SomeClass
+from stripe import SomeClass

-stripe.<MODULE>.SomeClass
+stripe.SomeClass
  • ⚠️ Removed the FileUpload alias

To update your code:

-from stripe import FileUpload
-from stripe.api_resources import FileUpload
+from stripe import File
  • ⚠️ Removed the io import from stripe._util. If you had code relying on stripe.util.io, you'll need to import the io package directly yourself.
  • added UrllibClient to stripe to make creating your own HTTP client easier.

@xavdid-stripe xavdid-stripe changed the title remove many deprecated backcompat exports Remove deprecated compatibility exports Sep 29, 2025
@xavdid-stripe xavdid-stripe changed the title Remove deprecated compatibility exports ⚠️ Remove deprecated compatibility exports Sep 29, 2025
@xavdid-stripe xavdid-stripe marked this pull request as ready for review September 29, 2025 02:48
@xavdid-stripe xavdid-stripe requested a review from a team as a code owner September 29, 2025 02:48
@xavdid-stripe xavdid-stripe requested review from prathmesh-stripe and removed request for a team September 29, 2025 02:48
@xavdid-stripe xavdid-stripe enabled auto-merge (squash) September 29, 2025 02:48
@xavdid-stripe xavdid-stripe merged commit 20df48f into master Sep 29, 2025
14 checks passed
@xavdid-stripe xavdid-stripe deleted the DEVSDK-1706 branch September 29, 2025 19:55
WhyNotHugo added a commit to jazzband/django-payments that referenced this pull request Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants