Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9c44657
chore(ci): change upload type
stainless-app[bot] Jul 2, 2025
f6b6595
chore(internal): codegen related update
stainless-app[bot] Jul 8, 2025
3938712
chore(internal): bump pinned h11 dep
stainless-app[bot] Jul 9, 2025
ca53a0e
chore(package): mark python 3.13 as supported
stainless-app[bot] Jul 9, 2025
2ba6e54
fix(parsing): correctly handle nested discriminated unions
stainless-app[bot] Jul 10, 2025
337d17e
chore(readme): fix version rendering on pypi
stainless-app[bot] Jul 11, 2025
288eb7d
fix(client): don't send Content-Type header on GET requests
stainless-app[bot] Jul 12, 2025
535e5ab
feat: clean up environment call outs
stainless-app[bot] Jul 15, 2025
6810653
fix(parsing): ignore empty metadata
stainless-app[bot] Jul 22, 2025
f952799
fix(parsing): parse extra field types
stainless-app[bot] Jul 23, 2025
36c1d48
chore(project): add settings file for vscode
stainless-app[bot] Jul 25, 2025
b3a0224
feat(client): support file upload requests
stainless-app[bot] Jul 31, 2025
bfb7eb6
chore(internal): fix ruff target version
stainless-app[bot] Aug 6, 2025
f365ac1
chore: update @stainless-api/prism-cli to v5.15.0
stainless-app[bot] Aug 9, 2025
da3e700
chore(internal): update comment in script
stainless-app[bot] Aug 9, 2025
281314a
chore(internal): codegen related update
stainless-app[bot] Aug 12, 2025
cc78ddf
chore: update github action
stainless-app[bot] Aug 22, 2025
94573cf
chore(internal): change ci workflow machines
stainless-app[bot] Aug 26, 2025
5b84026
fix: avoid newer type syntax
stainless-app[bot] Aug 27, 2025
e087e8a
chore(internal): update pyright exclude list
stainless-app[bot] Aug 27, 2025
9159c6d
chore(internal): add Sequence related utils
stainless-app[bot] Aug 30, 2025
3a6e9d2
feat(types): replace List[str] with SequenceNotStr in params
stainless-app[bot] Sep 3, 2025
1c2b2a0
feat: improve future compat with pydantic v3
stainless-app[bot] Sep 4, 2025
b0af041
chore(internal): codegen related update
stainless-app[bot] Sep 5, 2025
c354e32
chore(tests): simplify `get_platform` test
stainless-app[bot] Sep 6, 2025
6febfc0
chore(internal): update pydantic dependency
stainless-app[bot] Sep 17, 2025
037353e
chore(types): change optional parameter type from NotGiven to Omit
stainless-app[bot] Sep 19, 2025
fea8954
chore: do not install brew dependencies in ./scripts/bootstrap by def…
stainless-app[bot] Sep 20, 2025
8c6c43a
chore(internal): detect missing future annotations with ruff
stainless-app[bot] Oct 11, 2025
127bafc
chore: bump `httpx-aiohttp` version to 0.1.9
stainless-app[bot] Oct 18, 2025
5f08b58
fix(client): close streams without requiring full consumption
stainless-app[bot] Oct 30, 2025
81b1d27
chore(internal/tests): avoid race condition with implicit client cleanup
stainless-app[bot] Oct 31, 2025
5aa138a
chore(internal): grammar fix (it's -> its)
stainless-app[bot] Nov 4, 2025
dcd82c7
release: 0.1.0-alpha.2
stainless-app[bot] Nov 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,40 @@ jobs:
- name: Run lints
run: ./scripts/lint

upload:
if: github.repository == 'stainless-sdks/zbd-payments-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
timeout-minutes: 10
name: upload
name: build
permissions:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
runs-on: ${{ github.repository == 'stainless-sdks/zbd-payments-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- name: Install dependencies
run: rye sync --all-features

- name: Run build
run: rye build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/zbd-payments-python'
id: github-oidc
uses: actions/github-script@v6
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/zbd-payments-python'
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.prism.log
.vscode
_dev

__pycache__
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.1"
".": "0.1.0-alpha.2"
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.analysis.importFormat": "relative",
}
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
# Changelog

## 0.1.0-alpha.2 (2025-11-04)

Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/zbdpay/zbd-payments-python-sdk/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)

### Features

* clean up environment call outs ([535e5ab](https://github.com/zbdpay/zbd-payments-python-sdk/commit/535e5abe6894630fd12397c95e9fdcb0bdfcf658))
* **client:** support file upload requests ([b3a0224](https://github.com/zbdpay/zbd-payments-python-sdk/commit/b3a02242d357e96493899e6acb0f283b83060aef))
* improve future compat with pydantic v3 ([1c2b2a0](https://github.com/zbdpay/zbd-payments-python-sdk/commit/1c2b2a067518c006ed2ea1d5e3f3c28f2868b55e))
* **types:** replace List[str] with SequenceNotStr in params ([3a6e9d2](https://github.com/zbdpay/zbd-payments-python-sdk/commit/3a6e9d20ae545ee635cd86b7ae4b7b1f4705763f))


### Bug Fixes

* avoid newer type syntax ([5b84026](https://github.com/zbdpay/zbd-payments-python-sdk/commit/5b840269faac165f86335e1177eccbc3d47651c0))
* **client:** close streams without requiring full consumption ([5f08b58](https://github.com/zbdpay/zbd-payments-python-sdk/commit/5f08b58994542a3fb4b2f9a4a766f545b1c8d809))
* **client:** don't send Content-Type header on GET requests ([288eb7d](https://github.com/zbdpay/zbd-payments-python-sdk/commit/288eb7dbc10084e010006e07a0b6ae8bc31830f8))
* **parsing:** correctly handle nested discriminated unions ([2ba6e54](https://github.com/zbdpay/zbd-payments-python-sdk/commit/2ba6e54f3688d3606a32b54e67858a9c1121ed03))
* **parsing:** ignore empty metadata ([6810653](https://github.com/zbdpay/zbd-payments-python-sdk/commit/6810653d722e8eb4b5531d1a120035001942e039))
* **parsing:** parse extra field types ([f952799](https://github.com/zbdpay/zbd-payments-python-sdk/commit/f9527997050c628fee3f05b76420e1449238d13b))


### Chores

* bump `httpx-aiohttp` version to 0.1.9 ([127bafc](https://github.com/zbdpay/zbd-payments-python-sdk/commit/127bafcd8d74f9dffa1c574b9b3cccc92e7f18ef))
* **ci:** change upload type ([9c44657](https://github.com/zbdpay/zbd-payments-python-sdk/commit/9c4465773de134e1ecacb494a4f3f3c5f174146b))
* do not install brew dependencies in ./scripts/bootstrap by default ([fea8954](https://github.com/zbdpay/zbd-payments-python-sdk/commit/fea89541e9d5e4373720e0639d09d574b6b681be))
* **internal/tests:** avoid race condition with implicit client cleanup ([81b1d27](https://github.com/zbdpay/zbd-payments-python-sdk/commit/81b1d27d18635a5ee76009d44be19da36b3ccaf8))
* **internal:** add Sequence related utils ([9159c6d](https://github.com/zbdpay/zbd-payments-python-sdk/commit/9159c6d5474db3fb12ec5597b817c17c4151230a))
* **internal:** bump pinned h11 dep ([3938712](https://github.com/zbdpay/zbd-payments-python-sdk/commit/3938712b4835065e531e220a3e277bd84c0a6cf8))
* **internal:** change ci workflow machines ([94573cf](https://github.com/zbdpay/zbd-payments-python-sdk/commit/94573cffbdaaa47ea3c04c8c08594ef8bcf515a9))
* **internal:** codegen related update ([b0af041](https://github.com/zbdpay/zbd-payments-python-sdk/commit/b0af041c74a92ea2be802ba5470c1f76a6b6c22d))
* **internal:** codegen related update ([281314a](https://github.com/zbdpay/zbd-payments-python-sdk/commit/281314a9a7b24c8e61947df03ec796e162475447))
* **internal:** codegen related update ([f6b6595](https://github.com/zbdpay/zbd-payments-python-sdk/commit/f6b6595872a031ad6fa6dd2b48f3ed7259fcdd55))
* **internal:** detect missing future annotations with ruff ([8c6c43a](https://github.com/zbdpay/zbd-payments-python-sdk/commit/8c6c43a7f9ecb965948a2c0c4e45ede5929e3f2d))
* **internal:** fix ruff target version ([bfb7eb6](https://github.com/zbdpay/zbd-payments-python-sdk/commit/bfb7eb6f5f90f2eef5be4714c25d2335cd340956))
* **internal:** grammar fix (it's -> its) ([5aa138a](https://github.com/zbdpay/zbd-payments-python-sdk/commit/5aa138a2baca8ff95452be8dd90cb916d909a09d))
* **internal:** update comment in script ([da3e700](https://github.com/zbdpay/zbd-payments-python-sdk/commit/da3e7007adac9551b21b7525c895538b0072e3de))
* **internal:** update pydantic dependency ([6febfc0](https://github.com/zbdpay/zbd-payments-python-sdk/commit/6febfc07161f1678bd35a446b2fd618a7c08fc8d))
* **internal:** update pyright exclude list ([e087e8a](https://github.com/zbdpay/zbd-payments-python-sdk/commit/e087e8abacb81f209f9a9746ee4f5e666d21d36d))
* **package:** mark python 3.13 as supported ([ca53a0e](https://github.com/zbdpay/zbd-payments-python-sdk/commit/ca53a0eaa744e881b8d24a05f2d35049a9815682))
* **project:** add settings file for vscode ([36c1d48](https://github.com/zbdpay/zbd-payments-python-sdk/commit/36c1d48714b6c9750dd885ee93c5e041f4a6e59e))
* **readme:** fix version rendering on pypi ([337d17e](https://github.com/zbdpay/zbd-payments-python-sdk/commit/337d17e1d4ad645f55793d615ebd9f328fdef08a))
* **tests:** simplify `get_platform` test ([c354e32](https://github.com/zbdpay/zbd-payments-python-sdk/commit/c354e32d12201983196cde30acd370ee6e6c0941))
* **types:** change optional parameter type from NotGiven to Omit ([037353e](https://github.com/zbdpay/zbd-payments-python-sdk/commit/037353e3016446a51197a1dafdb9f50ca4156804))
* update @stainless-api/prism-cli to v5.15.0 ([f365ac1](https://github.com/zbdpay/zbd-payments-python-sdk/commit/f365ac1076dab4f1f57bb95878560a7eb94731a1))
* update github action ([cc78ddf](https://github.com/zbdpay/zbd-payments-python-sdk/commit/cc78ddff5b244d94a49e6558dfe665d156791c58))

## 0.1.0-alpha.1 (2025-06-30)

Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/zbdpay/zbd-payments-python-sdk/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ZBD Payments Python API library

[![PyPI version](<https://img.shields.io/pypi/v/zbdpay.svg?label=pypi%20(stable)>)](https://pypi.org/project/zbdpay/)
<!-- prettier-ignore -->
[![PyPI version](https://img.shields.io/pypi/v/zbdpay.svg?label=pypi%20(stable))](https://pypi.org/project/zbdpay/)

The ZBD Payments Python library provides convenient access to the ZBD Payments REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
Expand Down Expand Up @@ -82,15 +83,14 @@ pip install --pre zbdpay[aiohttp]
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:

```python
import os
import asyncio
from zbdpay import DefaultAioHttpClient
from zbdpay import AsyncZbdPayments


async def main() -> None:
async with AsyncZbdPayments(
apikey=os.environ.get("ZBD_PAYMENTS_API_KEY"), # This is the default and can be omitted
apikey="My Apikey",
http_client=DefaultAioHttpClient(),
) as client:
await client.lightning_address.send_payment(
Expand Down
50 changes: 0 additions & 50 deletions mypy.ini

This file was deleted.

65 changes: 61 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "zbdpay"
version = "0.1.0-alpha.1"
version = "0.1.0-alpha.2"
description = "The official Python library for the zbd-payments API"
dynamic = ["readme"]
license = "MIT"
Expand All @@ -24,6 +24,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: OS Independent",
"Operating System :: POSIX",
"Operating System :: MacOS",
Expand All @@ -38,7 +39,7 @@ Homepage = "https://github.com/zbdpay/zbd-payments-python-sdk"
Repository = "https://github.com/zbdpay/zbd-payments-python-sdk"

[project.optional-dependencies]
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"]
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"]

[tool.rye]
managed = true
Expand All @@ -55,7 +56,6 @@ dev-dependencies = [
"dirty-equals>=0.6.0",
"importlib-metadata>=6.7.0",
"rich>=13.7.1",
"nest_asyncio==1.6.0",
"pytest-xdist>=3.6.1",
]

Expand Down Expand Up @@ -147,6 +147,7 @@ exclude = [
"_dev",
".venv",
".nox",
".git",
]

reportImplicitOverride = true
Expand All @@ -155,10 +156,62 @@ reportOverlappingOverload = false
reportImportCycles = false
reportPrivateUsage = false

[tool.mypy]
pretty = true
show_error_codes = true

# Exclude _files.py because mypy isn't smart enough to apply
# the correct type narrowing and as this is an internal module
# it's fine to just use Pyright.
#
# We also exclude our `tests` as mypy doesn't always infer
# types correctly and Pyright will still catch any type errors.
exclude = ['src/zbdpay/_files.py', '_dev/.*.py', 'tests/.*']

strict_equality = true
implicit_reexport = true
check_untyped_defs = true
no_implicit_optional = true

warn_return_any = true
warn_unreachable = true
warn_unused_configs = true

# Turn these options off as it could cause conflicts
# with the Pyright options.
warn_unused_ignores = false
warn_redundant_casts = false

disallow_any_generics = true
disallow_untyped_defs = true
disallow_untyped_calls = true
disallow_subclassing_any = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
cache_fine_grained = true

# By default, mypy reports an error if you assign a value to the result
# of a function call that doesn't return anything. We do this in our test
# cases:
# ```
# result = ...
# assert result is None
# ```
# Changing this codegen to make mypy happy would increase complexity
# and would not be worth it.
disable_error_code = "func-returns-value,overload-cannot-match"

# https://github.com/python/mypy/issues/12162
[[tool.mypy.overrides]]
module = "black.files.*"
ignore_errors = true
ignore_missing_imports = true


[tool.ruff]
line-length = 120
output-format = "grouped"
target-version = "py37"
target-version = "py38"

[tool.ruff.format]
docstring-code-format = true
Expand All @@ -171,6 +224,8 @@ select = [
"B",
# remove unused imports
"F401",
# check for missing future annotations
"FA102",
# bare except statements
"E722",
# unused arguments
Expand All @@ -193,6 +248,8 @@ unfixable = [
"T203",
]

extend-safe-fixes = ["FA102"]

[tool.ruff.lint.flake8-tidy-imports.banned-api]
"functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead"

Expand Down
14 changes: 8 additions & 6 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ filelock==3.12.4
frozenlist==1.6.2
# via aiohttp
# via aiosignal
h11==0.14.0
h11==0.16.0
# via httpcore
httpcore==1.0.2
httpcore==1.0.9
# via httpx
httpx==0.28.1
# via httpx-aiohttp
# via respx
# via zbdpay
httpx-aiohttp==0.1.6
httpx-aiohttp==0.1.9
# via zbdpay
idna==3.4
# via anyio
Expand All @@ -75,7 +75,6 @@ multidict==6.4.4
mypy==1.14.1
mypy-extensions==1.0.0
# via mypy
nest-asyncio==1.6.0
nodeenv==1.8.0
# via pyright
nox==2023.4.22
Expand All @@ -89,9 +88,9 @@ pluggy==1.5.0
propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.10.3
pydantic==2.11.9
# via zbdpay
pydantic-core==2.27.1
pydantic-core==2.33.2
# via pydantic
pygments==2.18.0
# via rich
Expand Down Expand Up @@ -126,7 +125,10 @@ typing-extensions==4.12.2
# via pydantic
# via pydantic-core
# via pyright
# via typing-inspection
# via zbdpay
typing-inspection==0.4.1
# via pydantic
virtualenv==20.24.5
# via nox
yarl==1.20.0
Expand Down
Loading