Conversation
Add a pluggable HTTP transport layer so callers can inject custom HTTP clients. Introduces src/multisafepay/transport (HTTP transport interface, RequestsTransport and underlying http transport), updates SDK and client to accept/select a transport, and adds example transports for httpx, requests.Session and urllib3 (including a response adapter). Includes new unit/e2e tests and test helpers for transport selection and mocks, plus minor README/pyproject tweaks.
Annotate client methods' context parameter as Optional[dict[str, Any]] and standardize parameter/type annotations in HTTPTransport and RequestsTransport docstrings (consistently use parenthetical param types and shorter, PEP-484-like type expressions). These edits improve typing clarity and make the transport docs consistent and easier to read.
Add copyright, Open Software License (OSL) v3.0 and disclaimer header comments to several test and support modules for legal/attribution purposes. Affected files: tests/multisafepay/e2e/examples/transport/test_custom_httpx_transport.py, tests/multisafepay/e2e/examples/transport/test_custom_requests_session_transport.py, tests/multisafepay/e2e/examples/transport/test_custom_urllib3_transport.py, tests/multisafepay/unit/transport/test_unit_transport_selection.py, tests/support/alt_http_transports.py, tests/support/mock_transport.py. No functional code changes.
Expand README with an optional HTTP transport section detailing the transport abstraction, how to use the built-in RequestsTransport (multisafepay[requests]) or provide a custom transport, and a small example. Update example import to use from multisafepay import Sdk. Tweak RequestsTransport's ModuleNotFoundError message to also suggest installing requests directly. Update poetry.lock to reflect the new optional extra and lockfile checksum.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #49 +/- ##
=======================================
Coverage 90.81% 90.81%
=======================================
Files 147 147
Lines 2579 2579
=======================================
Hits 2342 2342
Misses 237 237 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR prepares the 3.0.0 major release of the MultiSafepay Python SDK by bumping the version number and adding the corresponding changelog entry. The actual code changes (transport abstraction layer, PEP 585 generics, README updates) were presumably merged in prior PRs.
Changes:
- Version bumped from
2.2.0to3.0.0inpyproject.toml - Added a
[3.0.0] - 2026-03-05changelog entry documenting the transport abstraction layer, PEP 585 generics adoption, and SDK refactoring
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pyproject.toml | Version bump from 2.2.0 to 3.0.0 |
| CHANGELOG.md | New changelog entry for 3.0.0 documenting added transport abstraction, PEP 585 generics, and SDK refactoring |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This pull request prepares for the 3.0.0 major release, introducing a transport abstraction layer and updating dependency and documentation to support customizable HTTP transports. The changes also include a version bump and adoption of modern Python typing.
New features and transport abstraction:
HTTPTransportandRequestsTransportclasses, enabling users to inject custom HTTP transports.httpx,requests.Session, andurllib3) to demonstrate transport customization.requestsextra in dependency metadata to support transport usage.SDK and typing improvements:
Sdkclass and client request flow to support custom transport injection.Documentation and release:
3.0.0inpyproject.tomlto reflect breaking changes.