Skip to content

API

Locate and provide paths to bundled or system Pact CLI executables.

This module exists solely to bundle and distribute the Pact CLI tools as a Python package. It does not provide any substantive functionality beyond locating the Pact CLI executables and providing their paths for use in Python code.

The module exposes constants for the absolute paths to the Pact CLI executables (such as pact-broker, pact-message, pact-mock-service, and pact-provider-verifier).

By default, the module will use the binaries bundled with the package. If the environment variable PACT_USE_SYSTEM_BINS is set to TRUE or YES, or if the bundled binaries are unavailable, it will fall back to using the system-installed Pact CLI tools if found in the system PATH.

This package is intended for use as a dependency to ensure the Pact CLI is available in Python environments, such as CI pipelines or local development, without requiring a separate installation step.

For more information, see the project README or https://github.com/pact-foundation/pact-python.

Attributes

BROKER_CLIENT_PATH = _find_executable('pact-broker') module-attribute

Path to the Pact Broker executable

BROKER_PATH = _find_executable('pact-broker') module-attribute

Path to the Pact Broker executable

MESSAGE_PATH = _find_executable('pact-message') module-attribute

Path to the Pact Message executable

MOCK_SERVICE_PATH = _find_executable('pact-mock-service') module-attribute

Path to the Pact Mock Service executable

PACTFLOW_PATH = _find_executable('pactflow') module-attribute

Path to the PactFlow CLI executable

PACT_PATH = _find_executable('pact') module-attribute

Path to the Pact executable

PLUGIN_CLI_PATH = _find_executable('pact-plugin-cli') module-attribute

Path to the Pact Plugin CLI executable

STUB_SERVICE_PATH = _find_executable('pact-stub-service') module-attribute

Path to the Pact Stub Service executable

VERIFIER_PATH = _find_executable('pact-provider-verifier') module-attribute

Path to the Pact Provider Verifier executable