Skip to content

Solve case when the the version is not in the MAX_VERSIONS #6380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 23, 2025
Merged

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 (

@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