Conversation
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]>
There was a problem hiding this comment.
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
v2tocompat-v2in 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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1280 +/- ##
====================================
Coverage 52% 52%
====================================
Files 32 32
Lines 3739 3739
====================================
Hits 1966 1966
Misses 1773 1773
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
📝 Summary
Rename the
v2extra/feature tocompat-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 oldpip install 'pact-python[v2]'is no longer supported.🔥 Motivation
The
v2group of optional dependencies unfortunately results in an issue when Pact Python is installed usingpip, aspiptries to parse the group name as if it were a version. To avoid this, the group has been renamed tocompat-v2which 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