Skip to content

Fix on Poetry add, add more tests#88

Merged
sbrunner merged 1 commit intomasterfrom
poetry
Aug 13, 2025
Merged

Fix on Poetry add, add more tests#88
sbrunner merged 1 commit intomasterfrom
poetry

Conversation

@sbrunner
Copy link
Copy Markdown
Owner

No description provided.

@sbrunner sbrunner force-pushed the poetry branch 5 times, most recently from 6892e92 to 0481f67 Compare July 30, 2025 13:56
@sbrunner sbrunner marked this pull request as ready for review July 30, 2025 13:58
@sbrunner sbrunner requested a review from Copilot July 30, 2025 13:58

This comment was marked as outdated.

Copy link
Copy Markdown

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 Poetry add functionality and adds comprehensive test coverage for the dependency version tweaking logic. The fix addresses an issue where dependencies added by poetry add with version constraints were not being properly integrated into the Poetry configuration.

  • Adds logic to detect dependencies added by Poetry with specific version patterns and fetch their latest compatible versions from PyPI
  • Introduces comprehensive test coverage for all version modifiers and edge cases
  • Adds test data file to support the new testing scenarios

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

File Description
python_versions_hook/__init__.py Implements the Poetry add fix by detecting version-constrained dependencies and fetching compatible versions from PyPI
tests/test_tweak_dependency_version.py Adds extensive test coverage for all functionality including version modifiers, edge cases, and the new Poetry add fix
tests/test_data/test_pyproject_no_project.toml Provides test data for scenarios where project dependencies start empty
pyproject.toml Updates project configuration to include new dependencies and test tools
Comments suppressed due to low confidence (1)

tests/test_tweak_dependency_version.py:9

  • [nitpick] The function name test_tweak_dependency_version_add is confusing given that a new function test_tweak_dependency_version_replace was added. The original function should be renamed to better reflect its purpose, such as test_tweak_dependency_version_empty_project to distinguish it from the replace scenario.
def test_tweak_dependency_version_add():

@sbrunner sbrunner merged commit 81e3f20 into master Aug 13, 2025
7 checks passed
@sbrunner sbrunner deleted the poetry branch August 13, 2025 08:05
@geo-ghci-int geo-ghci-int bot added this to the 1.2.0 milestone Nov 7, 2025
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.

2 participants