Skip to content

Conversation

matteius
Copy link
Member

@matteius matteius commented Apr 22, 2025

The issue

Fixes #6370

The checklist

  • Associated issue
  • A news fragment in the news/ directory to describe this fix with the extension .bugfix.rst, .feature.rst, .behavior.rst, .doc.rst. .vendor.rst. or .trivial.rst (this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.

@matteius matteius marked this pull request as ready for review April 22, 2025 11:59
@matteius matteius requested review from Copilot and oz123 April 22, 2025 11:59
Copy link
Contributor

@Copilot 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 fixes the KeyError encountered when a package’s version specifier contains a major version that is not present in MAX_VERSIONS.

  • Added an integration test for installing a package with an invalid Python version specifier (typedb-driver 3.0.5).
  • Modified the version comparison logic in pipenv/utils/markers.py to handle cases where the major version is not listed in MAX_VERSIONS.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/integration/test_install_markers.py Added a new integration test for handling an invalid Python version specifier.
pipenv/utils/markers.py Updated version comparison logic in _format_pyspec and fix_version_tuple functions.
Files not reviewed (1)
  • news/6380.bugfix.rst: Language not supported
Comments suppressed due to low confidence (1)

pipenv/utils/markers.py:127

  • [nitpick] The composite condition checking for 'next_tuple[0] not in MAX_VERSIONS or not next_tuple[1] <= MAX_VERSIONS[next_tuple[0]]' is complex; consider refactoring it into descriptive boolean variables to improve readability.
if (

matteius and others added 3 commits April 22, 2025 08:01
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@oz123 oz123 merged commit f885934 into main Apr 23, 2025
19 checks passed
@oz123 oz123 deleted the issue-6370 branch April 23, 2025 16:51
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.

Locking fails with a KeyError in MAX_VERSIONS[next_tuple[0]]
2 participants