Skip to content

Conversation

@JP-Ellis
Copy link
Contributor

@JP-Ellis JP-Ellis commented Oct 7, 2025

📝 Summary

Rename the v2 extra/feature to compat-v2. As a result, to install Pact Python with v2 compatibility, you will need to now use:

pip install 'pact-python[compat-v2]`

🚨 Breaking Changes

Installing Pact Python with v2 compatibility requires pip install 'pact-python[compat-v2]', and the old pip install 'pact-python[v2]' is no longer supported.

🔥 Motivation

The v2 group of optional dependencies unfortunately results in an issue when Pact Python is installed using pip, as pip tries to parse the group name as if it were a version. To avoid this, the group has been renamed to compat-v2 which should bypass the version parsing.

While this is a bug in pip, pip comes pre-bundled in many situations and is rarely at the latest version; so it is impractical to wait for the upstream issue to be resolved.

🔨 Test Plan

🔗 Related issues/PRs

Fixes: #1275
Ref: pypa/packaging#938

The `v2` group of optional dependencies unfortunately results in an
issue when Pact Python is installed using `pip`, as `pip` tries to parse
the group name as if it were a version. To avoid this, the group has
been renamed to `compat-v2` which should bypass the version parsing.

While this is a bug in `pip`, pip comes pre-bundled in many situations
and is rarely at the latest version; so it is impractical to wait for
the upstream issue to be resolved.

BREAKING CHANGE: Installing Pact Python with v2 compatibility requires
    `pip install 'pact-python[compat-v2]'`, and the old `pip install
    'pact-python[v2]'` is no longer supported.

Fixes: #1275
Ref: pypa/packaging#938
Signed-off-by: JP-Ellis <[email protected]>
@JP-Ellis JP-Ellis self-assigned this Oct 7, 2025
Copilot AI review requested due to automatic review settings October 7, 2025 04:52
@JP-Ellis JP-Ellis added the type:fix Fix to an issue label Oct 7, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR renames the v2 optional dependency group to compat-v2 to resolve an issue where pip incorrectly parses the group name as a version specification, causing installation failures.

  • Renamed the optional dependency group from v2 to compat-v2 in pyproject.toml
  • Updated hatch environment configurations to use the new feature name
  • Updated installation documentation to reflect the new naming convention

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pyproject.toml Updated optional dependency group name and hatch environment configurations
MIGRATION.md Updated installation instructions to use new compat-v2 feature name

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link

codecov bot commented Oct 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52%. Comparing base (8223d8b) to head (6951d5b).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@         Coverage Diff          @@
##           main   #1280   +/-   ##
====================================
  Coverage    52%     52%           
====================================
  Files        32      32           
  Lines      3739    3739           
====================================
  Hits       1966    1966           
  Misses     1773    1773           
Flag Coverage Δ
tests 52% <ø> (ø)

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

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

@JP-Ellis JP-Ellis merged commit db041b6 into main Oct 7, 2025
60 checks passed
@JP-Ellis JP-Ellis deleted the fix/replace-v2-with-compat-v2 branch October 7, 2025 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:fix Fix to an issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error installing pact-python in Python 3.12 virtual environment: Invalid version string

2 participants