Skip to content

fix(quick-action): fix an issue where poistion wrongly calculated#48

Merged
benbenbang merged 1 commit into
mainfrom
fix/quick_action
Sep 6, 2025
Merged

fix(quick-action): fix an issue where poistion wrongly calculated#48
benbenbang merged 1 commit into
mainfrom
fix/quick_action

Conversation

@benbenbang

Copy link
Copy Markdown
Owner

This pull request refines the logic for identifying and replacing version constraints for Python packages in TOML files, with a focus on more accurate detection and manipulation of version ranges and constraint operators. The changes improve how version ranges are calculated, enhance operator handling for different package formats, and ensure that code actions for changing constraints are only shown when appropriate.

Improvements to version and operator range calculation:

  • Enhanced the calculation of version ranges for package constraints to more accurately identify the start and end positions, especially for complex patterns such as package = "version" and package>=1.0.0. This includes better handling of whitespace and quote characters. [1] [2] [3]

Operator handling and replacement logic:

  • Improved logic for extracting constraint operators from lines, ensuring that only valid constraint changes are suggested and that replacements cover both the operator and version when editing. [1] [2]
  • Updated the formatVersionForReplacement method to better preserve or add constraint operators based on the context, ensuring correct formatting for both PEP 621 and traditional TOML formats.

@github-actions github-actions Bot added enhancement New feature or request triage labels Sep 6, 2025
@benbenbang
benbenbang enabled auto-merge (squash) September 6, 2025 18:47
@benbenbang
benbenbang merged commit 66ca5ad into main Sep 6, 2025
2 checks passed
@benbenbang
benbenbang deleted the fix/quick_action branch September 6, 2025 18:47
@ptah-technical-app

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant