Skip to content

Conversation

joe-p
Copy link
Collaborator

@joe-p joe-p commented Sep 28, 2025

Creates an algod_client package for Python. The main driver for this is to give the Python utils package proper algod methods and types.

It should be noted that I initially wanted to make algokit_http_client its own package as well, but that lead to some problems documented here: https://github.com/algorandfoundation/algokit-core/blob/debug/ext_foreign_pointer_not_set/packages/python/algod_client/tests/test_algod.py#L10

The main problem with not having a separate HttpClient package is that all of the API client packages will need their own HttpClient that will be incompatible with others. For now this is fine because we will use a default implementation as seen in this PR anyways. Even without using the default client a user can still make a custom http client implementation, they will just need to make a separate one for each API client (which might be desirable anyway)

@joe-p joe-p requested a review from a team as a code owner September 28, 2025 13:06
@joe-p joe-p requested review from Copilot and neilcampbell and removed request for a team September 28, 2025 13:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR creates a new algod_client Python package to provide proper algod methods and types for the Python utils package. The implementation uses Rust-based FFI bindings through UniFFI to expose algod client functionality to Python users.

Key changes:

  • Added a new Python package structure with FFI bindings for algod client functionality
  • Updated build tooling to support building the new package with specific cargo features
  • Corrected documentation comments by removing backslash escapes from field annotations

Reviewed Changes

Copilot reviewed 65 out of 69 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/build_pkgs/src/python.rs Added support for package-specific cargo build flags
tools/build_pkgs/src/main.rs Added AlgodClient package configuration and build flags
packages/python/algod_client/ Created new Python package with FFI bindings, tests, and configuration
crates/algod_client/src/apis/client.rs Moved network-specific constructors to non-FFI implementation block
crates/indexer_client/src/apis/client.rs Moved network-specific constructors to non-FFI implementation block
crates/algokit_http_client/src/lib.rs Updated parameter name for consistency
api/oas_generator/ Updated templates to fix documentation and constructor placement

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


@pytest.mark.asyncio
async def test_algod_client():
client = AlgodClient(host="http://localhost:4001", token="a" * 64)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the end we get an intuitive way to instantiate the AlgodClient wihthout the developer needing to touch HttpClient at all

joe-p and others added 3 commits September 28, 2025 09:08
@joe-p joe-p marked this pull request as draft September 29, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant