Skip to content

chore: update dependencies#10848

Merged
radoering merged 1 commit intopython-poetry:mainfrom
radoering:chore-update-dependencies
Apr 19, 2026
Merged

chore: update dependencies#10848
radoering merged 1 commit intopython-poetry:mainfrom
radoering:chore-update-dependencies

Conversation

@radoering
Copy link
Copy Markdown
Member

Source (PyPI): The following package versions were ignored due to solver.min-release-age=7
Source (PyPI): filelock: 3.28.0
Source (PyPI): identify: 2.6.19
Source (PyPI): mypy: 1.20.1
Source (PyPI): packaging: 26.1
Source (PyPI): virtualenv: 21.2.2, 21.2.3, 21.2.4
Source (PyPI): zipp: 3.23.1

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 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.
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>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/poetry/utils/env/base_env.py Outdated
@radoering radoering force-pushed the chore-update-dependencies branch from 0ad2bdc to 07c5381 Compare April 18, 2026 15:23
@radoering radoering force-pushed the chore-update-dependencies branch from 07c5381 to 61016ab Compare April 18, 2026 15:24
@radoering radoering merged commit bee7c10 into python-poetry:main Apr 19, 2026
54 checks passed
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.

1 participant