Skip to content

Conversation

@thisishaykins
Copy link
Owner

Refactored the PaystackClient and tool functions to be asynchronous using async/await and httpx. This improves performance by allowing non-blocking I/O operations.

  • Replaced the synchronous paystack library with an asynchronous httpx client in app/paystack_client.py.
  • Updated all methods in app/paystack_client.py and app/tools.py to be async def.
  • Updated the tests in tests/test_tools.py to be asynchronous using pytest-asyncio and AsyncMock.
  • Updated project dependencies in pyproject.toml to include pytest-asyncio and remove unused libraries.
  • Added lazy instantiation for the PaystackClient to avoid initialization errors during test collection.

Refactored the `PaystackClient` and tool functions to be asynchronous using `async/await` and `httpx`. This improves performance by allowing non-blocking I/O operations.

- Replaced the synchronous `paystack` library with an asynchronous `httpx` client in `app/paystack_client.py`.
- Updated all methods in `app/paystack_client.py` and `app/tools.py` to be `async def`.
- Updated the tests in `tests/test_tools.py` to be asynchronous using `pytest-asyncio` and `AsyncMock`.
- Updated project dependencies in `pyproject.toml` to include `pytest-asyncio` and remove unused libraries.
- Added lazy instantiation for the `PaystackClient` to avoid initialization errors during test collection.
@thisishaykins thisishaykins self-assigned this Sep 30, 2025
@thisishaykins thisishaykins added the enhancement New feature or request label Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactored all functions to be asynchronous for improved performance.

2 participants