Skip to content

Commit 0f3c93e

Browse files
⚠️ drop support for Python 3.6 & clarify version policy (#1606)
* drop support for python 3.6 and clarify version policy * remove some docs * update docs * update example * fix typo * update example
1 parent cc9631e commit 0f3c93e

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ jobs:
7777
fail-fast: false
7878
matrix:
7979
python_version:
80+
# The last ~5 versions, once we're on schedule
81+
# https://docs.stripe.com/sdks/versioning?server=python#stripe-sdk-language-version-support-policy
8082
- "3.7"
8183
- "3.8"
8284
- "3.9"
@@ -88,6 +90,7 @@ jobs:
8890
- "pypy-3.8"
8991
- "pypy-3.9"
9092
- "pypy-3.10"
93+
- "pypy-3.11"
9194
name: Test (${{ matrix.python_version }})
9295
steps:
9396
- uses: extractions/setup-just@v2

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,31 @@ classes for API resources that initialize themselves dynamically from API
99
responses which makes it compatible with a wide range of versions of the Stripe
1010
API.
1111

12-
## Documentation
12+
## API Documentation
1313

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

1616
## Installation
1717

18-
You don't need this source code unless you want to modify the package. If you just
19-
want to use the package, just run:
18+
This package is available on PyPI:
2019

2120
```sh
2221
pip install --upgrade stripe
2322
```
2423

25-
Install from source with:
24+
Alternatively, install from source with:
2625

2726
```sh
2827
python -m pip install .
2928
```
3029

3130
### Requirements
3231

33-
- Python 3.6+ (PyPy supported)
32+
Per our [Language Version Support Policy](https://docs.stripe.com/sdks/versioning?server=python#stripe-sdk-language-version-support-policy), we currently support **Python 3.7+**.
33+
34+
Support for Python 3.7 and 3.8 is deprecated and will be removed in an upcoming major version. Read more and see the full schedule in the docs: https://docs.stripe.com/sdks/versioning?server=python#stripe-sdk-language-version-support-policy
35+
36+
#### Extended Support
3437

3538
#### Python 2.7 deprecation
3639

examples/webhooks.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
import os
22

3-
from stripe import StripeClient, Webhook, SignatureVerificationError
4-
3+
from stripe import Webhook, SignatureVerificationError
54
from flask import Flask, request
65

7-
8-
client = StripeClient(
9-
api_key=os.environ["STRIPE_SECRET_KEY"],
10-
client_id=os.environ.get("STRIPE_CLIENT_ID"),
11-
)
6+
# this is for handling v1-style Snapshot Events.
7+
# To handle v2-style Events, see `event_notification_webhook_handler.py`
128

139
webhook_secret = os.environ.get("WEBHOOK_SECRET")
1410

@@ -21,7 +17,9 @@ def webhooks():
2117
received_sig = request.headers.get("Stripe-Signature", None)
2218

2319
try:
24-
event = Webhook.construct_event(payload, received_sig, webhook_secret)
20+
event = Webhook.construct_event(
21+
payload, received_sig, webhook_secret, api_key="sk_test_..."
22+
)
2523
except ValueError:
2624
print("Error while decoding event!")
2725
return "Bad payload", 400

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description = "Python bindings for the Stripe API"
66
authors = [{ name = "Stripe", email = "[email protected]" }]
77
license-files = ["LICENSE"]
88
keywords = ["stripe", "api", "payments"]
9-
requires-python = ">=3.6"
9+
requires-python = ">=3.7"
1010
dependencies = [
1111
"typing_extensions <= 4.2.0, > 3.7.2; python_version < '3.7'",
1212
# The best typing support comes from 4.5.0+ but we can support down to
@@ -22,7 +22,6 @@ classifiers = [
2222
"Programming Language :: Python",
2323
"Programming Language :: Python :: 3",
2424
"Programming Language :: Python :: 3 :: Only",
25-
"Programming Language :: Python :: 3.6",
2625
"Programming Language :: Python :: 3.7",
2726
"Programming Language :: Python :: 3.8",
2827
"Programming Language :: Python :: 3.9",

0 commit comments

Comments
 (0)