diff --git a/README.md b/README.md index b24cbd48c..d0b346854 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 99f55cb8d..bdc5bfcd0 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