Skip to content

Commit 0ffbd7d

Browse files
authored
Merge pull request #1638 from stripe/jar/merge-python-private-preview
Merge python-private-preview
2 parents 5fceb44 + 51c60b0 commit 0ffbd7d

File tree

28 files changed

+3595
-119
lines changed

28 files changed

+3595
-119
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
matrix:
8080
python_version:
8181
# The last ~5 versions, once we're on schedule
82-
# https://docs.stripe.com/sdks/versioning?server=python#stripe-sdk-language-version-support-policy
82+
# https://docs.stripe.com/sdks/versioning?lang=python#stripe-sdk-language-version-support-policy
8383
- "3.7"
8484
- "3.8"
8585
- "3.9"
@@ -126,30 +126,19 @@ jobs:
126126
with:
127127
python-version: "3.10"
128128

129-
- name: Configure GPG Key
130-
run: |
131-
set -ex
132-
echo $GPG_SIGNING_PRIVKEY | base64 --decode | gpg --import --batch --yes --pinentry-mode loopback --passphrase "$GPG_SIGNING_PASSPHRASE"
133-
env:
134-
GPG_SIGNING_PRIVKEY: ${{ secrets.GPG_SIGNING_PRIVKEY }}
135-
GPG_SIGNING_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSPHRASE }}
136129
- name: Install tools
137130
run: just install-build-deps
131+
138132
- name: Publish packages to PyPI
139133
# could probably move this into a just recipe too?
140134
run: |
141135
set -ex
142136
source .venv/bin/activate
143-
export VERSION=$(cat VERSION)
144-
gpg --detach-sign --local-user $GPG_SIGNING_KEYID --pinentry-mode loopback --passphrase $GPG_SIGNING_PASSPHRASE -a dist/stripe-$VERSION.tar.gz
145-
gpg --detach-sign --local-user $GPG_SIGNING_KEYID --pinentry-mode loopback --passphrase $GPG_SIGNING_PASSPHRASE -a dist/stripe-$VERSION-py3-none-any.whl
146137
147-
python -m twine upload --verbose dist/stripe-$VERSION.tar.gz dist/stripe-$VERSION-py3-none-any.whl dist/stripe-$VERSION.tar.gz.asc dist/stripe-$VERSION-py3-none-any.whl.asc
138+
python -m twine upload --verbose dist/*
148139
env:
149-
GPG_SIGNING_KEYID: ${{ secrets.GPG_SIGNING_KEYID }}
150140
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
151141
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
152-
GPG_SIGNING_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSPHRASE }}
153142
- uses: stripe/openapi/actions/notify-release@master
154143
if: always()
155144
with:

CHANGELOG.md

Lines changed: 50 additions & 38 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ python -m pip install .
2929

3030
### Requirements
3131

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+**.
32+
Per our [Language Version Support Policy](https://docs.stripe.com/sdks/versioning?lang=python#stripe-sdk-language-version-support-policy), we currently support **Python 3.7+**.
3333

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
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?lang=python#stripe-sdk-language-version-support-policy
3535

3636
#### Extended Support
3737

@@ -313,6 +313,8 @@ The default HTTP client uses `requests` for making synchronous requests but
313313
you to explicitly initialize your own http client and pass it to StripeClient
314314
or set it as the global default.
315315
316+
If you don't already have a dependency on an async-compatible HTTP library, `pip install stripe[async]` will install one for you (new in `v13.0.1`).
317+
316318
```python
317319
# By default, an explicitly initialized HTTPXClient will raise an exception if you
318320
# attempt to call a sync method. If you intend to only use async, this is useful to

pyproject.toml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@ authors = [{ name = "Stripe", email = "[email protected]" }]
77
license-files = ["LICENSE"]
88
keywords = ["stripe", "api", "payments"]
99
requires-python = ">=3.7"
10-
dependencies = [
11-
"typing_extensions <= 4.2.0, > 3.7.2; python_version < '3.7'",
12-
# The best typing support comes from 4.5.0+ but we can support down to
13-
# 3.7.2 without throwing exceptions.
14-
"typing_extensions >= 4.5.0; python_version >= '3.7'",
15-
"requests >= 2.20; python_version >= '3.0'",
16-
]
1710
classifiers = [
1811
"Development Status :: 5 - Production/Stable",
1912
"Intended Audience :: Developers",
@@ -33,6 +26,18 @@ classifiers = [
3326
"Topic :: Software Development :: Libraries :: Python Modules",
3427
]
3528

29+
dependencies = [
30+
"typing_extensions <= 4.2.0, > 3.7.2; python_version < '3.7'",
31+
# The best typing support comes from 4.5.0+ but we can support down to
32+
# 3.7.2 without throwing exceptions.
33+
"typing_extensions >= 4.5.0; python_version >= '3.7'",
34+
"requests >= 2.20; python_version >= '3.0'",
35+
]
36+
37+
[project.optional-dependencies]
38+
# `pip install stripe[async]` gets you everything + `httpx`, so our async stuff works out of the box
39+
async = ["httpx"]
40+
3641
[project.urls]
3742
homepage = "https://stripe.com/"
3843
source = "https://github.com/stripe/stripe-python"
@@ -44,6 +49,10 @@ documentation = "https://stripe.com/docs/api/?lang=python"
4449
requires = ["flit_core >=3.11, <4"]
4550
build-backend = "flit_core.buildapi"
4651

52+
[tool.flit.sdist]
53+
# see: https://github.com/stripe/stripe-python/issues/1616
54+
include = ["tests/"]
55+
4756
[tool.ruff]
4857
# same as our black config
4958
line-length = 79

0 commit comments

Comments
 (0)