Joshua Ellisi · vi · mmxxvi

Blog

Writing

Posts
Rewriting jpellis.me in Leptos

A placeholder for a post about this very website.

Announcing: Pact Python v3

It’s been a couple of months since we released Pact Python v3, and after ironing out a couple of early issues, I think it’s finally time to reflect on this milestone and its implications. This post is a look back at the journey, some of the challenges, the people, and the future of this project within the Pact ecosystem.

↗ originally on pact-foundation.github.io
Integrating Rust FFI with Pact Python

In the forthcoming release of Pact Python version 3, we’re excited to be integrating our library with the ‘Rust core’, a Rust-based library that encapsulates Pact’s fundamental operations for both consumers and providers. Known for its high performance and safety guarantees, Rust enables us to enhance the robustness and efficiency of our implementation. This move also promises simplified maintenance and scalability for future iterations of both the Pact Python library, and the broader Pact ecosystem.

At its essence, this Rust-powered engine handles critical tasks such as parsing and serializing Pact files, matching requests with responses, and generating new Pact contracts. It provides mocking capabilities to simulate a provider when verifying a consumer, and equally acts in reverse when replaying consumer requests against a provider. By adopting this shared core logic from Rust, we will achieve uniformity across all languages implementing Pact while streamlining the integration of enhancements or bug fixes-benefits across our diverse ecosystem.

In this blog post, I will delve into how this is all achieved. From explaining how Hatch is used to compile a binary extension and generate wheels for all supported platforms, to the intricacies of interfacing with the binary library. This information is not required to use Pact Python, but hopes to provide a deeper understanding of the inner workings of the library.

↗ originally on pact-foundation.github.io