Skip to content

Hoist WorkspacePython resolution out of ProjectInterpreter::discover#19103

Merged
zanieb merged 1 commit intomainfrom
zb/workspace-python
Apr 21, 2026
Merged

Hoist WorkspacePython resolution out of ProjectInterpreter::discover#19103
zanieb merged 1 commit intomainfrom
zb/workspace-python

Conversation

@zanieb
Copy link
Copy Markdown
Member

@zanieb zanieb commented Apr 21, 2026

Claude actually did fine on the commit here ("hoist" is my new favorite refactor term)

ProjectInterpreter::discover previously called WorkspacePython::from_request
internally, so ProjectEnvironment::get_or_init had to either resolve the
request a second time to decide upgradeability or accept a stale check against
the CLI argument only.

Make callers resolve WorkspacePython once and pass it in. discover now takes
the resolved struct directly and no longer needs project_dir or no_config.

Needed for #19102 (comment)

`ProjectInterpreter::discover` previously called `WorkspacePython::from_request`
internally, so `ProjectEnvironment::get_or_init` had to either resolve the
request a second time to decide upgradeability or accept a stale check against
the CLI argument only.

Make callers resolve `WorkspacePython` once and pass it in. `discover` now takes
the resolved struct directly and no longer needs `project_dir` or `no_config`.
@zanieb zanieb marked this pull request as ready for review April 21, 2026 17:36
@zanieb zanieb added the internal A refactor or improvement that is not user-facing label Apr 21, 2026
@zanieb zanieb enabled auto-merge (squash) April 21, 2026 17:36
@zanieb zanieb merged commit 95cbb99 into main Apr 21, 2026
54 checks passed
@zanieb zanieb deleted the zb/workspace-python branch April 21, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal A refactor or improvement that is not user-facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants