Skip to content

Check version compatibility without mutating specifiers - #106

Open
notatallshaw wants to merge 1 commit into
explosion:mainfrom
notatallshaw:fix/avoid-prereleases-setter-20261019
Open

notatallshaw wants to merge 1 commit into
explosion:mainfrom
notatallshaw:fix/avoid-prereleases-setter-20261019

Conversation

@notatallshaw

@notatallshaw notatallshaw commented Oct 19, 2026 •

Copy link
Copy Markdown

Description

I plan to deprecate mutability of packaging's core objects to improve performance and hashability. This PR removes specifier mutation from is_compatible_version() ahead of that change.

A new __replace__ API will cover callers that need a modified copy in future versions of packaging. This helper doesn't need a copy: it passes its existing prerelease argument to contains(), keeping explicit true and false behavior.

Types of change

Bug fix.

Checklist

  • I have the right to submit this contribution under the MIT license.
  • The focused version, validation, and schema checks pass; the full suite has failures reproduced on the base branch.
  • No documentation change is needed.

This branch has not been deployed

No deployments
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