chore: update dependencies#10848
Merged
radoering merged 1 commit intopython-poetry:mainfrom Apr 19, 2026
Merged
Conversation
Member
radoering
commented
Apr 18, 2026
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Consider adding an explicit return type annotation to
get_embedded_wheel(e.g.-> Path) now that theWheeltype import has been removed, to keep the function signature clear and help static analysis. - When
get_embed_wheelreturnsNone, raising a more specific exception type (or reusing an existing Poetry-specific error) instead of a bareRuntimeErrorwould make the failure mode easier to distinguish and handle.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider adding an explicit return type annotation to `get_embedded_wheel` (e.g. `-> Path`) now that the `Wheel` type import has been removed, to keep the function signature clear and help static analysis.
- When `get_embed_wheel` returns `None`, raising a more specific exception type (or reusing an existing Poetry-specific error) instead of a bare `RuntimeError` would make the failure mode easier to distinguish and handle.
## Individual Comments
### Comment 1
<location path="src/poetry/utils/env/base_env.py" line_range="164-169" />
<code_context>
+ wheel = get_embed_wheel(
distribution, f"{self.version_info[0]}.{self.version_info[1]}"
)
+ if not wheel:
+ raise RuntimeError(f"embedded {distribution} wheel not found")
path: Path = wheel.path
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Use an explicit `is None` check instead of relying on `wheel` truthiness.
If `Wheel` can ever be falsy (via `__bool__`, `__len__`, or future changes), `if not wheel:` may raise this error even when a wheel is present. Using `if wheel is None:` decouples this check from `Wheel`’s truthiness and makes the intent explicit.
```suggestion
wheel = get_embed_wheel(
distribution, f"{self.version_info[0]}.{self.version_info[1]}"
)
if wheel is None:
raise RuntimeError(f"embedded {distribution} wheel not found")
path: Path = wheel.path
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
0ad2bdc to
07c5381
Compare
07c5381 to
61016ab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.