Val Kolovos
02/27/2025, 6:20 PMpact-python
2.3.1, and I have a feature request. It would appear that neither the state_handler
nor the message_handler
functions in the v3 Verifier
can be async
functions. Is it possible to allow for that? Should I just create an issue in the github repo?Ruud Welling
03/05/2025, 8:05 AMpact.v3
:
We have our verifier configured with include_pending
enabled. When a consumer publishes a pact on a branch, a webhook triggers the verification and the CI output states
> This pact is in pending state for this version of ProviderName because a successful verification result for ProviderName has not yet been published. If this verification fails, it will not cause the overall build to fail. Read more at https://docs.pact.io/go/pending
It also shows that the test fails:
> has a matching body (FAILED)
2 questions:
• I see that the broker shows all results as green, even though some tests failed, is this a bug?
• After the change got merged, the pact on main was shown as NOT pending, and caused the build to fail. Why was the pact considered pending when it was still on the branch, but not on main? (there was a previous successful verification on main before for a different version of that pact)Adam Mitchell
04/22/2025, 8:21 AMVasyl
04/22/2025, 9:31 PMPendingDeprecationWarning: This class will be deprecated Pact Python v3 (see pact-foundation/pact-python#396)
messages make me try to find V3 release timeframe, but I don't have luck finding it so far.
Is there any estimation of when v3 might be available, End of 2025? middle of 2026? 🤔Jun Yi
04/28/2025, 3:36 AMverifier = Verifier().set_info(name=PROVIDER_NAME, url=PROVIDER_URL)
verifier.broker_source(url=URL(settings.pact_flow_url), token=settings.pact_broker_token)
verifier.set_state(url=PROVIDER_URL / "_pact" / "callback", teardown=True)
verifier.filter_consumers(consumer_name)
verifier.set_publish_options(version=str(version))
verifier.verify()
Thanks for your help!Patrick
04/28/2025, 12:39 PMLachlan Newman
05/01/2025, 11:13 PMset_publish_options
but what is the behaviour if that function is not called ?GitHub
05/07/2025, 3:33 AMThe signature of functional arguments must form a subset of the### 📚 Documentation • Replace commitizen with git cliff • Update blog post • Rename params -> parameters • (example) Elaborate on state handler ### ⚙️ Miscellaneous Tasks • Update pre-commit hooks • Update committed configuration • Add taplo • (ci) Update ubuntu runners • Reduce noise from taiki-e/install-action • (ci) Upload test results to codecov • Add apply_arg utility • (tests) Use consistent return value • (test) Tweak type signature • (examples) Fix state handler args ### Contributors • @JP-Ellis ## Pull Requests ## What's Changed • chore: update changelog by @JP-Ellis in #937 • chore: update pre-commit hooks by @JP-Ellis in #939 • chore: update committed configuration by @JP-Ellis in #940 • docs: replace commitizen with git cliff by @JP-Ellis in #938 • chore: add taplo by @JP-Ellis in #941 • chore(deps): update codecov/codecov-action action to v5.3.0 by @renovate in #944 • chore(deps): update taiki-e/install-action action to v2.47.24 by @renovate in #942 • fix(deps): update ruff to v0.9.3 by @renovate in #943 • chore(deps): update codecov/codecov-action action to v5.3.1 by @renovate in #946 • chore(deps): update taiki-e/install-action action to v2.47.25 by @renovate in #947 • chore(deps): update pre-commit hook igorshubovych/markdownlint-cli to v0.44.0 by @renovate in #948 • chore(deps): update pypa/gh-action-pypi-publish action to v1.12.4 by @renovate in #945 • chore(deps): update taiki-e/install-action action to v2.47.26 by @renovate in #949 • chore(deps): update taiki-e/install-action action to v2.47.28 by @renovate in #950 • chore(deps): update taiki-e/install-action action to v2.47.29 by @renovate in #951 • chore(deps): update taiki-e/install-action action to v2.47.30 by @renovate in #952 • fix(deps): update ruff to v0.9.4 by @renovate in #956 • chore(deps): update taiki-e/install-action action to v2.47.31 by @renovate in #954 • chore(deps): update astral-sh/setup-uv action to v5.2.2 by @renovate in #955 • chore(deps): update pre-commit hook crate-ci/typos to v1.29.5 by @renovate in #957 • chore(deps): update taiki-e/install-action action to v2.48.1 by @renovate in #958 • fix(deps): update dependency mypy to v1.15.0 by @renovate in #960 • chore(deps): update docker/setup-qemu-action action to v3.4.0 by @renovate in #962 • chore(deps): update pre-commit hook biomejs/pre-commit to v1 by @renovate in #961 • fix(deps): update ruff to v0.9.5 by @renovate in #963 • chore(deps): update tests/v3/compatibility_suite/definition digest to cc76eac by @renovate in #573 • chore(deps): update taiki-e/install-action action to v2.48.2 by @renovate in #964 • chore(deps): update taiki-e/install-action action to v2.48.4 by @renovate in #965 • chore(deps): update taiki-e/install-action action to v2.48.5 by @renovate in #966 • fix(deps): update ruff to v0.9.6 by @renovate in #969 • chore(deps): update taiki-e/install-action action to v2.48.6 by @renovate in #968 • chore(deps): update taiki-e/install-action action to v2.48.7 by @renovate in #970 • chore(deps): update taiki-e/install-action action to v2.48.9 by @renovate in #971 • chore(deps): update pre-commit hook crate-ci/typos to v1.29.7 by @renovate in #974 • chore(deps): update pactfoundation/pact-broker:latest docker digest to 1abd7da by @renovate in #973 • chore(deps): update taiki-e/install-action action to v2.48.10 by @renovate in #972 • chore(deps): update taiki-e/install-action action to v2.48.12 by @renovate in #976 • fix(deps): update dependency psutil to v7 by @renovate in #977 • chore(deps): update taiki-e/install-action action to v2.48.13 by @renovate in #978 • chore(deps): update taiki-e/install-action action to v2.48.14 by @renovate in #979 • chore(deps): update actions/cache action to v4.2.1 by @renovate in #980 • chore(deps): update taiki-e/install-action action to v2.48.15 by @renovate in #981 • chore(deps): update pre-commit hook crate-ci/typos to v1.29.8 by @renovate in <https://github.com/pact-foundation/pact-python/pull/982|#… pact-foundation/pact-pythonandMessageProducerArgs
typed dictionaries.StateHandlerArgs
Joshua Ellis
05/07/2025, 3:37 AMDilip Punna
06/19/2025, 5:02 PMAdriano Tanoue
06/23/2025, 8:43 AMquery_params = {"count": "1", "skip": "0"}
interaction.with_query_parameters(query_params)
...becomes:
"request": {
"query": {
"count": [
"1"
],
"skip": [
"0"
]
}
So the actual url path is something like: /status?count[0]=1&skip[0]=0
instead of /status?count=1&skip=0
. Is that by design? Doesn't it make a wrong contract?Zachary Lysobey
06/24/2025, 9:42 PMDavid Mason
07/09/2025, 2:41 PM@pytest.fixture(scope="module")
def sqs_pact_verifier(pact_dir: str, version: str) -> Verifier:
verifier = Verifier("my-provider")
if broker_url := os.environ.get("PACT_BROKER_BASE_URL"):
verifier = verifier.set_publish_options(version=version)
verifier = verifier.broker_source(broker_url, token=os.environ["PACT_BROKER_TOKEN"]).set_error_on_empty_pact()
return verifier
def test_verify_payment_network_request(sqs_pact_verifier: Verifier):
sqs_pact_verifier.message_handler(run_message_handler).verify()
I've double checked the versions match, any ideas?Patrick
07/14/2025, 10:41 AMverifier = (
Verifier(PROVIDER)
.add_transport(url=server)
.state_handler(provider_state_handler, teardown=False)
.broker_source(url=BROKER_URL, selector=True)
.consumer_versions('{"mainBranch": true}', '{"deployedOrReleased": true}')
.include_pending()
.include_wip_since("2025-07-11")
.build
)
if os.getenv("CI"):
verifier.set_publish_options(
version=os.getenv("VERSION")
branch=os.getenv("CI_COMMIT_REF_NAME")
)
verifier.verify()
GitHub
07/17/2025, 11:38 AMGitHub
07/22/2025, 6:17 AMGitHub
07/23/2025, 11:31 AMGitHub
07/29/2025, 10:29 AMGitHub
08/12/2025, 4:23 AM• [breaking] Prepare for v3 releaseis removed, and to be replaced bypact.v3.ffi
. That is,pact_ffi
should be replaced bypact.v3.ffi.$fn
.pact_ffi.$fn
This prepares for version 3. Pact Python v2 will be still accessible under• [breaking] Simplifyand all imports should be appropriate renamed. Everyone is encouraged to migrate to Pact Python v3.pact.v2
given
The signature of• [breaking] Deserialize metadata valueshas been updated. The following changes are required: - ChangeInteraction.given
togiven("state", key="user_id", value=123)
. This can take an arbitrary number of keyword arguments. If the key is not a valid Python keyword argument, use the dictionary input below. - Changegiven("state", user_id=123)
togiven("state", parameters={"user_id": 123})
.given("state", {"user_id": 123})
As the metadata values are now deserialised, the type of the metadata values may change. For example, setting metadata### 🐛 Bug Fixes • Matcher type variance • With metadata function signature • [breaking] Use correct datetime default formatwill now passuser_id=123
through to the function handler. Previously, this would have been{"user_id": 123}
.{"user_id": "123"}
If you relied on the previous default (undocumented) behaviour, prefer specifying the format explicitly now:• Handle empty state callback • (verifier) [breaking] Propagate branch.match.datetime(regex="%Y-%m-%dT%H:%M:%S.%f%z")
If a branch is set through either### 🚜 Refactor • Functional state handler ### 📚 Documentation • Update changelog for v2.3.3 • (blog) Fix v3 references • Fix v3 references • V3 review • Update git cliff configuration ### ⚙️ Miscellaneous Tasks • Update pre-commit hooks • Use the neworset_publish_options
, the value will be saved and used as a default for both in subsequent calls.provider_branch
pact_cli
package
• Remove packaging of pact cli
• (ci) Incorporate tests of pact cli
• (ci) Use new pact-python/*
tags
• (ci) Add build cli pipeline
• Exclude hatch_build from mypy checks
• (ci) Narrow token permissions
• Remove macosx deployment target
• (ci) Fix cli publish permissions
• Properly extract tag version
• Update gitignore
• (ci) Fix core package build
• Split out dependencies and tests
• (ci) Update labels
• (ci) Fix labels
• (tests) Re-organise tests
• Fix bad copy-paste in tests
• Log exceptions from apply_args
• Improve logging from apply_args
• (examples) Start examples overhaul
• (ci) Use new examples
• Update protobuf examples
• (ci) Cancel ci on PRs
• Add vscode settings and extensions
• Add envrc
• Replace yamlfix with yamlfmt
• Remove deptry config
• Support pre and post release tags
• Fix typo
### Contributors
• @JP-Ellis
• @kevinrvaz
## Pull Requests
## What's Changed
• docs: update ffi changelog by @JP-Ellis in #1131
• feat(v3)!: remove pact.v3.ffi module by @JP-Ellis in #1132
• docs(ffi): fix old references to pact.v3.ffi by @JP-Ellis in #1133
• chore(cli): cleanup build script by @JP-Ellis in #1136
• chore(ffi): cleanup build script by @JP-Ellis in #1135
• chore(cli): fix flakey test by @JP-Ellis in #1137
• chore(deps): update pypa/cibuildwheel action to v3.1.2 by @renovate[bot] in #1075
• chore(deps): update pre-commit hook biomejs/pre-commit to v2.1.3 by @renovate[bot] in #1138
• fix(deps): update ruff to v0.12.7 by @renovate[bot] in #1128
• feat!: prepare for v3 release by @JP-Ellis in #1139
• fix(deps): update dependency mypy to v1.17.1 by @renovate[bot] in #1141
• chore(ci): update labels by @JP-Ellis in #1140
• chore(ci): fix labels by @JP-Ellis in #1142
• chore(deps): update pypa/cibuildwheel action to v3.1.3 by @renovate[bot] in #1143
• chore(deps): update taiki-e/install-action action to v2.57.5 by @renovate[bot] in #1144
• chore(deps): update pre-commit hook crate-ci/typos to v1.35.1 by @renovate[bot] in #1145
• chore(deps): update actions/download-artifact action to v5 by @renovate[bot] in #1146
• docs: v3 review by @JP-Ellis in #1147
• chore(deps): fix optional dependencies by @JP-Ellis in #1148
• chore(deps): remove unused optional dependency by @JP-Ellis in #1149
• feat!: simplify given
by @JP-Ellis in #1150
• feat!: with_metadata by @JP-Ellis in #1151
• chore(deps): update actions/cache action to v4.2.4 by @renovate[bot] in #1152
• fix(deps): update ruff to v0.12.8 by @renovate[bot] in #1153
• chore(deps): update pre-commit hook crate-ci/typos to v1.35.2 by @renovate[bot] in #1155
• chore: log exceptions from apply_args by @JP-Ellis in #1157
• chore: improve logging from apply_args by @JP-Ellis in #1158
• fix: use correct datetime default format by @JP-Ellis in #1156
• refactor: functional state handler by @JP-Ellis in #1159
• chore(deps): update pre-commit hook biomejs/pre-commit to v2.1.4 by @renovate[bot] in #1160
• fix: handle empty state callback by @JP-Ellis in #1161
• chore(deps): update pre-commit …
pact-foundation/pact-pythonMatt (pactflow.io / pact-js / pact-go)
GitHub
08/26/2025, 10:26 AMGitHub
08/29/2025, 3:21 AMPaul
09/12/2025, 5:17 AMElson Ho
09/18/2025, 10:08 AMpactUrls
so you can verify directly from a URL. What will be the equivalent in Pact Python?
Any pointers or examples would be appreciated, Thank you.
Workshop step: https://docs.pactflow.io/docs/workshops/ci-cd/workshop/implementing-the-provider-changes
Workshop repo reference: https://github.com/pactflow/example-provider/blob/master/src/product/product.consumerChange.pact.test.js#L32
Pact JS core repo reference: https://github.com/pact-foundation/pact-js-core/blob/master/src/verifier/types.ts#L31GitHub
10/06/2025, 1:54 AMPact instances default to version 4 of the Pact specification (previously used version 3). This should be mostly backwards compatible, but can be reverted by using• Populate broker source from env ### 🚜 Refactor • (ci) If statement ### 🎨 Styling • (tests) Add sections ### 📚 Documentation • Update changelog for pact-python/3.0.0a1 • Add mascot • Give mascot outline • Set mascot width and height • (examples) Add requests and fastapi • Generate llms.txt • Update mkdocs material features • Fix CI badge links • Update matcher docs • Improve matchers • Improve generators • Update for v3 and add migration guide ### ⚙️ Miscellaneous Tasks • (ci) Remove spelling check • (examples) Minor improvements • Store hatch venv in .venv • Update mismatch repr • Save mismatches before exiting the server • (examples) Remove old http example • Fix sub-project git cliff config • Hide import from traceback • Fix flask integer coercion • Add v3 matching rules test • Add v4 matching rules tests • (ci) Add publish as completion dependency • (tests) Add generators to interaction defn • (tests) Test v3 generators • (test) Add v4 generators tests • Re-add pytest rerunfailrure • (tests) Add v3 http generators • Prefer prek over pre-commit • Disable reruns in vscode • (ci) Fix prek caching • (ci) Generate junit xml files • Move mascot file out of root • Update uuid format names • Fix import warning • Make Unset falsey • [breaking] Rename abstract matcher class.with_specification("V3")
The abstract• [breaking] Rename abstract generatorclass has been renamed topact.match.Matcher
.pact.match.AbstractMatcher
The abstract• Clarify explanation of given • [breaking] Drop python 3.9 add 3.14class has been renamed topact.generate.Generator
.pact.generate.AbstractGenerator
Python 3.9 is no longer supported.• (ci) Disable 3.14 tests using pydantic ### Contributors • @JP-Ellis ## Pull Requests ## What's Changed • docs: update ffi changelog by @JP-Ellis in #1212 • chore(deps): update ruff to v0.12.11 by @renovate[bot] in #1214 • chore(deps): update pre-commit hook crate-ci/typos to v1.35.6 by @renovate[bot] in #1213 • chore(ci): add publish as completion dependency by @JP-Ellis in #1215 • chore(tests): add generators to interaction defn by @JP-Ellis in #1217 • chore: re-add pytest rerunfailrure by @JP-Ellis in #1219 • chore(deps): update astral-sh/setup-uv action to v6.6.1 by @renovate[bot] in #1218 • chore(deps): update pre-commit hook crate-ci/typos to v1.36.1 by @renovate[bot] in #1216 • chore(tests): add v3 http generators by @JP-Ellis in #1221 • chore(deps): update codecov/codecov-action action to v5.5.1 by @renovate[bot] in #1223 • chore(deps): update ruff to v0.12.12 by @renovate[bot] in #1224 • chore(deps): update pre-commit hook crate-ci/typos to v1.36.2 by @renovate[bot] in #1225 • chore(deps): update pypa/gh-action-pypi-publish action to v1.13.0 by @renovate[bot] in #1220 • chore(deps): update pre-commit hook biomejs/pre-commit to v2.2.3 by @renovate[bot] in #1226 • chore(deps): update softprops/action-gh-release action to v2.3.3 by @renovate[bot] in #1227 • chore(deps): update taiki-e/install-action action to v2.59.1 by @renovate[bot] in #1228 • chore(deps): update dependency cffi to v2 by @renovate[bot] in #1229 • chore(deps): update dependency pytest-cov to v7 by @renovate[bot] in #1230 • chore: prefer prek over pre-commit by @JP-Ellis in #1232 • chore: disable reruns in vscode by @JP-Ellis in #1233 • chore(deps): update ruff to v0.13.0 by @renovate[bot] in #1231 • chore(deps): update pre-commit hook biomejs/pre-commit to v2.2.4 by @renovate[bot] in #1234 • chore(deps): update dependency mypy to v1.18.1 by @renovate[bot] in #1235 • chore(deps): update astral-sh/setup-uv action to v6.7.0 by @renovate[bot] in #1236 • chore(deps): update taiki-e/install-action action to v2.61.3 by @renovate[bot] in #1237 • docs: generate llms.txt by @JP-Ellis in #1244 • docs: update mkdocs material features by @JP-Ellis in #1243 • chore(cli): use new standalone repo path by @JP-Ellis in #1241 • chore(deps): update dependency mypy to v1.18.2 by @renovate[bot] in #1239 • chore(deps): update taiki-e/install-action action to v2.62.5 by @renovate[bot] in #1240 • chore(deps): update ruff to v0.13.1 by @renovate[bot] in #1238 • chore(deps): update pypa/cibuildwheel action to v3.2.0 by @renovate[bot] in #1242 • chore(ci): fix prek caching by @JP-Ellis in #1246 • chore(ci): generate junit xml files by @JP-Ellis in #1247 • chore(deps): update actions/cache action to v4.3.0 by @renovate[bot] in #1245 • chore(deps): update pre-commit hook crate-ci/typos to v1.36.3 by @renovate[bot] … pact-foundation/pact-python
GitHub
10/06/2025, 6:25 AMGitHub
10/06/2025, 6:27 AMGitHub
10/07/2025, 5:32 AMInstalling Pact Python with v2 compatibility requires### 📚 Documentation • Update changelogs ### ⚙️ Miscellaneous Tasks • (ci) Add area-core label • (ci) Fix labels workflow permissions • Remove no longer relevant todo • (docs) Use normalized project url keys ### Contributors • @JP-Ellis ## Pull Requests ## What's Changed • docs: update ffi changelog by @JP-Ellis in #1273 • chore(ci): add area-core label by @JP-Ellis in #1276 • chore(ci): fix labels workflow permissions by @JP-Ellis in #1277 • chore(deps): update pre-commit hook crate-ci/typos to v1.38.0 by @renovate[bot] in #1278 • chore: remove no longer relevant todo by @JP-Ellis in #1281 • chore(docs): use normalized project url keys by @JP-Ellis in #1282 • fix!: replace v2 extra with compat-v2 by @JP-Ellis in #1280 • chore(deps): update softprops/action-gh-release action to v2.4.0 by @renovate[bot] in #1279 Full Changelog: pact-python/3.0.1...pact-python/3.1.0 pact-foundation/pact-python, and the oldpip install 'pact-python[compat-v2]'
is no longer supported.pip install 'pact-python[v2]'
David Mason
10/09/2025, 8:22 AMpact.v3
to just pact
we are starting to see can-i-merge failures saying that there are no versions of any of our pacts.
We're using pactflow, but looking at the ui of pactflow shows everything is greena nd OK, can-i-merge success.
So I suspect this is either a pact-python issue, or a skill issue.
The only thing is we've not changed anything other than s/pact.v3/pact/
and have been running pact v3 for months without this problem...
I'm going to try blindly re-running the tests first, maybe overnight the issue has fixed itself!Kieran McCarthy
10/11/2025, 10:49 AM