Skip to content

Demonstration usage of the Pact FFI Library with Python.

Notifications You must be signed in to change notification settings

YOU54F/pact-python-ffi

Repository files navigation

Pact Python FFI Demonstration

Demonstration usage of the Pact FFI Library with Python.

Available to try out as a Killercoda example https://killercoda.com/safdotdev/course/safacoda/grpc_plugins_quick_start_python

Based on some of the original work done by Elliot Murray and Mike Geeves

Uses the same examples as demonstrated here

Pre Requisities

  • Python 3.8 / 3.9 / 3.10
  • Pact FFI Library for OS
    • (install with make setup)
  • Pact FFI Header file
    • (install with make setup)
  • CFFI
    • (install with make install)

How to use

  1. make setup
  2. make install
  3. make run_hello_ffi

Steps

  1. Retrieve Pact Ruby Standalone
  2. Retrieve Pact FFI Binary for Platform
  3. Retrieve Pact FFI Header file
  4. Parse Pact FFI Header File
  5. Print out Pact FFI Version

Developer notes

CFFI

We need to remove these lines in order to load the full header file

#ifndef pact_ffi_h
#define pact_ffi_h
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#endif /* pact_ffi_h */

About

Demonstration usage of the Pact FFI Library with Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published