summaryrefslogtreecommitdiff
diff options
authorDavid Brownman <109395161+xavdid-stripe@users.noreply.github.com>2025-10-03 10:57:00 -0700
committerGitHub <noreply@github.com>2025-10-03 10:57:00 -0700
commit01168850979d0bdf5119aed87ea111711dc8b0cb (patch)
tree8f59e2cb369d17fca6b571e9f2887aaa1b1d01bc
parentc70d785aafdeddf59e4b4950904cf8a7f19336a6 (diff)
add httpx to optional deps and only ship tests in sdist (#1633)
* add httpx to optional deps and only ship tests in sdist * fix toml ordering
-rw-r--r--README.md2
-rw-r--r--pyproject.toml22
2 files changed, 16 insertions, 8 deletions
diff --git a/README.md b/README.md
index b24cbd48..d0b34685 100644
--- a/README.md
+++ b/README.md
@@ -313,6 +313,8 @@ The default HTTP client uses `requests` for making synchronous requests but
you to explicitly initialize your own http client and pass it to StripeClient
or set it as the global default.
+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`).
+
```python
# By default, an explicitly initialized HTTPXClient will raise an exception if you
# attempt to call a sync method. If you intend to only use async, this is useful to
diff --git a/pyproject.toml b/pyproject.toml
index 99f55cb8..bdc5bfcd 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -7,13 +7,6 @@ authors = [{ name = "Stripe", email = "support@stripe.com" }]
license-files = ["LICENSE"]
keywords = ["stripe", "api", "payments"]
requires-python = ">=3.7"
-dependencies = [
- "typing_extensions <= 4.2.0, > 3.7.2; python_version < '3.7'",
- # The best typing support comes from 4.5.0+ but we can support down to
- # 3.7.2 without throwing exceptions.
- "typing_extensions >= 4.5.0; python_version >= '3.7'",
- "requests >= 2.20; python_version >= '3.0'",
-]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
@@ -33,6 +26,18 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
]
+dependencies = [
+ "typing_extensions <= 4.2.0, > 3.7.2; python_version < '3.7'",
+ # The best typing support comes from 4.5.0+ but we can support down to
+ # 3.7.2 without throwing exceptions.
+ "typing_extensions >= 4.5.0; python_version >= '3.7'",
+ "requests >= 2.20; python_version >= '3.0'",
+]
+
+[project.optional-dependencies]
+# `pip install stripe[async]` gets you everything + `httpx`, so our async stuff works out of the box
+async = ["httpx"]
+
[project.urls]
homepage = "https://stripe.com/"
source = "https://github.com/stripe/stripe-python"
@@ -45,7 +50,8 @@ requires = ["flit_core >=3.11, <4"]
build-backend = "flit_core.buildapi"
[tool.flit.sdist]
-include = ["tests/", "justfile", "examples/", "CHANGELOG.md", "deps/"]
+# see: https://github.com/stripe/stripe-python/issues/1616
+include = ["tests/"]
[tool.ruff]
# same as our black config