Skip to content

Commit 271bc67

Browse files
committed
Merge branch 'master' into sdk-release/next-major
2 parents 77c0f53 + 4c53c6d commit 271bc67

File tree

189 files changed

+14795
-9666
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+14795
-9666
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,14 @@ jobs:
6868
path: dist/
6969

7070
test:
71-
# Specific ubuntu version to support python 3.6 testing
72-
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 for details
73-
# move to ubuntu-latest when we drop 3.6
74-
runs-on: ubuntu-20.04
71+
# Specific ubuntu version to support python 3.7 testing
72+
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 for list of supported versions
73+
# move to ubuntu-latest when we drop 3.7
74+
runs-on: ubuntu-22.04
7575
strategy:
7676
fail-fast: false
7777
matrix:
7878
python_version:
79-
- "3.6"
8079
- "3.7"
8180
- "3.8"
8281
- "3.9"

.github/workflows/rules.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
name: rules
3+
4+
on:
5+
workflow_dispatch: {}
6+
pull_request:
7+
types:
8+
- auto_merge_enabled
9+
10+
jobs:
11+
require_merge_commit_on_merge_script_pr:
12+
name: Merge script PRs must create merge commits
13+
if: ${{ contains(github.head_ref, '/merge-') }}
14+
runs-on: ubuntu-latest
15+
steps:
16+
- run: |
17+
if ${{ github.event.pull_request.auto_merge.merge_method != 'merge' }}; then
18+
echo "Auto-merge method must be 'merge' instead of '${{github.event.pull_request.auto_merge.merge_method}}'"
19+
exit 1
20+
fi
21+

API_VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-06-30.basil

CHANGELOG.md

Lines changed: 216 additions & 7 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
# Contributing
3+
4+
We welcome bug reports, feature requests, and code contributions in a pull request.
5+
6+
For most pull requests, we request that you identify or create an associated issue that has the necessary context. We use these issues to reach agreement on an approach and save the PR author from having to redo work. Fixing typos or documentation issues likely do not need an issue; for any issue that introduces substantial code changes, changes the public interface, or if you aren't sure, please find or [create an issue](https://www.github.com/stripe/stripe-python/issues/new/choose).
7+
8+
## Contributor License Agreement
9+
10+
All contributors must sign the Contributor License Agreement (CLA) before we can accept their contribution. If you have not yet signed the agreement, you will be given an option to do so when you open a pull request. You can then sign by clicking on the badge in the comment from @CLAassistant.
11+
12+
## Generated code
13+
14+
This project has a combination of manually maintained code and code generated from our private code generator. If your contribution involves changes to generated code, please call this out in the issue or pull request as we will likely need to make a change to our code generator before accepting the contribution.
15+
16+
To identify files with purely generated code, look for the comment `File generated from our OpenAPI spec.` at the start of the file. Generated blocks of code within hand-written files will be between comments that say `The beginning of the section generated from our OpenAPI spec` and `The end of the section generated from our OpenAPI spec`.
17+
18+
## Compatibility with supported language and runtime versions
19+
20+
This project supports [many different langauge and runtime versions](README.md#requirements) and we are unable to accept any contribution that does not work on _all_ supported versions. If, after discussing the approach in the associated issue, your change must use an API / feature that isn't available in all supported versions, please call this out explicitly in the issue or pull request so we can help figure out the best way forward.
21+
22+
## Set up your dev environment
23+
24+
Please refer to this project's [README.md](README.md#development) for instructions on how to set up your development environment.
25+

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1505
1+
v1819

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ API.
1313

1414
See the [Python API docs](https://stripe.com/docs/api?lang=python).
1515

16-
See [video demonstrations][youtube-playlist] covering how to use the library.
17-
1816
## Installation
1917

2018
You don't need this source code unless you want to modify the package. If you just
@@ -65,6 +63,12 @@ customer = client.customers.retrieve("cus_123456789")
6563
print(customer.email)
6664
```
6765

66+
### StripeClient vs legacy pattern
67+
68+
We introduced the `StripeClient` class in v8 of the Python SDK. The legacy pattern used prior to that version is still available to use but will be marked as deprecated soon. Review the [migration guide to use StripeClient](https://github.com/stripe/stripe-python/wiki/Migration-guide-for-v8-(StripeClient)) to move from the legacy pattern.
69+
70+
Once the legacy pattern is deprecated, new API endpoints will only be accessible in the StripeClient. While there are no current plans to remove the legacy pattern for existing API endpoints, this may change in the future.
71+
6872
### Handling exceptions
6973

7074
Unsuccessful requests raise exceptions. The class of the exception will reflect
@@ -242,22 +246,21 @@ sends by default. If you are overriding `stripe.api_version` / `stripe_version`
242246
[webhook endpoint](https://stripe.com/docs/webhooks#api-versions) tied to an older version,
243247
be aware that the data you see at runtime may not match the types.
244248

245-
## Beta SDKs
249+
### Public Preview SDKs
250+
251+
Stripe has features in the [public preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-bX` suffix like `12.2.0b2`.
252+
We would love for you to try these as we incrementally release new features and improve them based on your feedback.
246253

247-
Stripe has features in the beta phase that can be accessed via the beta version of this package.
248-
We would love for you to try these and share feedback with us before these features reach the stable phase.
249-
To install a beta version use `pip install` with the exact version you'd like to use:
254+
To install, choose the version that includes support for the preview feature you are interested in by reviewing the [releases page](https://github.com/stripe/stripe-python/releases/) and then use it in the `pip install` command:
250255

251256
```
252-
pip install --pre stripe
257+
pip install stripe==<replace-with-the-version-of-your-choice>
253258
```
254259

255260
> **Note**
256-
> There can be breaking changes between beta versions. Therefore we recommend pinning the package version to a specific beta version in your [requirements file](https://pip.pypa.io/en/stable/user_guide/#requirements-files) or `setup.py`. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest beta version.
257-
258-
We highly recommend keeping an eye on when the beta feature you are interested in goes from beta to stable so that you can move from using a beta version of the SDK to the stable version.
261+
> There can be breaking changes between two versions of the public preview SDKs without a bump in the major version. Therefore we recommend pinning the package version to a specific version in your [requirements file](https://pip.pypa.io/en/stable/user_guide/#requirements-files) or `setup.py`. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest public preview SDK.
259262

260-
If your beta feature requires a `Stripe-Version` header to be sent, set the `stripe.api_version` field using the `stripe.add_beta_version` function:
263+
Some preview features require a name and version to be set in the `Stripe-Version` header like `feature_beta=v3`. If your preview feature has this requirement, use the `stripe.add_beta_version` function (available only in the public preview SDKs):
261264

262265
```python
263266
stripe.add_beta_version("feature_beta", "v3")
@@ -401,7 +404,6 @@ just format
401404
[poetry]: https://github.com/sdispater/poetry
402405
[stripe-mock]: https://github.com/stripe/stripe-mock
403406
[idempotency-keys]: https://stripe.com/docs/api/idempotent_requests?lang=python
404-
[youtube-playlist]: https://www.youtube.com/playlist?list=PLy1nL-pvL2M55YVn0mGoQ5r-39A1-ZypO
405407
406408
<!--
407409
# vim: set tw=79:

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
11.6.0
1+
12.3.0

deps/build-requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# packages needed to package & release
22

3-
twine
4-
setuptools
3+
# pinned to latest as of 2025-04-08; nothing special about these versions
4+
twine == 6.1.0
5+
build == 1.2.2

deps/dev-requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ mypy == 1.7.0
1111
# formatting
1212
ruff == 0.9.6
1313
# linting
14-
flake8
14+
# flake8 7.2.0 bumped to pyflakes 3.3.0, which adds a new lint error around global usage which will need to be manually fixed
15+
flake8==7.1.2

0 commit comments

Comments
 (0)