Skip to content

feat!: remove pact.v2 compatibility module - #1722

Merged
JP-Ellis merged 2 commits into
mainfrom
remove-pact-v2
Oct 14, 2026
Merged

JP-Ellis merged 2 commits into
mainfrom
remove-pact-v2

Conversation

@JP-Ellis

@JP-Ellis JP-Ellis commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

📝 Summary

Removes the pact.v2 compatibility module. It has kept the Pact Python 2.x API importable for the whole 3.x series.

Removed:

  • src/pact/v2/, tests/v2/, examples/v2/, and the v2 Copilot instructions.
  • The compat-v2 extra and the pact-verifier console script.
  • The example-v2/test-v2 dependency groups and the v2-test/v2-example hatch environments.
  • The v2 CI step and the v2 coverage upload.
  • The v2 excludes in the mypy, ruff and prek hook configuration. The CLI and FFI pyproject.toml files set exclude only to undo the root's v2 exclusions, so those overrides are removed too.

tests/compatibility_suite/test_v2_*.py stay. They test version 2 of the Pact specification, which is unrelated to pact.v2.

MIGRATION.md gains a "Migrating from 3.x to 4.x" section, and its compat-module walkthrough is replaced by a pointer to that section. Each major-version section has its own "Key Changes" heading, so the file disables no-duplicate-heading.

🚨 Breaking Changes

  • pact.v2, the compat-v2 extra and the pact-verifier console script no longer exist.
  • To migrate, move to the pact API using the 2.x → 3.x guide in MIGRATION.md. Projects that can't migrate yet can pin pact-python<4.
  • The commit carries a BREAKING CHANGE: footer, so git-cliff proposes 4.0.0 for the core release.

🔥 Motivation

  • pact.v2 has been deprecated for over a year and receives no new features.
  • It is the only code in the package that depends on the Ruby standalone CLI. Removing it lets pact-python-cli leave this repository in chore(cli): remove pact-python-cli #1723.
  • The compat-v2 extra pins pact-python-cli~=2.5 while the uv workspace builds the local CLI package, so the CLI couldn't change independently while it existed.

🔨 Test Plan

  • ruff check, ruff format --check and mypy on examples/, src/ and tests/ pass. mypy needed no v2 excludes.
  • The core test suite passes: 528 passed, 14 skipped.
  • uv lock succeeds. It drops psutil, which only compat-v2 used.

🔗 Related issues/PRs

Stack: #1721 → #1722 → #1723. Merge after pact-python-cli 2.6.4.0 is released from #1609.

@JP-Ellis
JP-Ellis added this pull request to stack #1724 October 14, 2026 21:57
Base automatically changed from fix-cli-macos-assets to main October 14, 2026 22:16
The `pact.v2` module kept the Pact Python 2.x API importable during the
3.x series so larger codebases could migrate incrementally. It has been
available for over a year, receives no new features, and is the only
part of the package that relies on the Ruby standalone CLI.

Removes `pact.v2`, its tests and examples, the `compat-v2` extra, the
`pact-verifier` console script, the `v2-test`/`v2-example` hatch
environments and the v2 CI step. The sub-package mypy and ruff overrides
existed only to undo the root's v2 exclusions, so they go too.

MIGRATION.md gains a 3.x to 4.x section pointing users who cannot move
yet at `pact-python<4`.

BREAKING CHANGE: `pact.v2`, the `compat-v2` extra and the
`pact-verifier` console script are removed. Migrate to the `pact` API
(see MIGRATION.md) or pin `pact-python<4`.

Assisted-by: Claude Code:claude-opus-5-5
@JP-Ellis
JP-Ellis marked this pull request as ready for review October 14, 2026 22:30
@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69%. Comparing base (75e4c55) to head (d5ed29f).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@          Coverage Diff          @@
##           main   #1722    +/-   ##
=====================================
- Coverage    74%     69%    -6%     
=====================================
  Files        36      22    -14     
  Lines      4109    3355   -754     
=====================================
- Hits       3063    2333   -730     
+ Misses     1046    1022    -24     
Flag Coverage Δ
examples 52% <ø> (+15%) ⬆️
tests 68% <ø> (-6%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Assisted-by: Claude Code:claude-opus-5-5
@JP-Ellis
JP-Ellis merged commit ea3ad2d into main Oct 14, 2026
40 of 41 checks passed
@JP-Ellis
JP-Ellis deleted the remove-pact-v2 branch October 14, 2026 23:05
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