Python: Ignore non-project workspace glob matches - #7509
Conversation
1cc6af3 to
6387c2b
Compare
There was a problem hiding this comment.
Pull request overview
Updates the Python workspace task utilities to avoid treating stale packages/* directories (without a pyproject.toml) as workspace projects, preventing FileNotFoundError failures during workspace-wide task execution.
Changes:
- Filter glob-expanded workspace members to only include paths that contain a
pyproject.toml. - Add a regression test covering a valid package directory alongside a stale directory match.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/scripts/task_runner.py | Filters globbed workspace member matches to only include directories that have a pyproject.toml. |
| python/scripts/tests/test_task_runner.py | Adds a regression test for ignoring stale glob matches without pyproject.toml. |
| def test_discover_projects_ignores_glob_matches_without_pyproject(tmp_path: Path) -> None: | ||
| workspace_pyproject = tmp_path / "pyproject.toml" | ||
| workspace_pyproject.write_text('[tool.uv.workspace]\nmembers = ["packages/*"]\n') |
|
@luisangelrod please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Motivation & Context
Workspace project discovery currently treats every directory matched by
packages/*as a project. After a package is removed or moved, a stale local directory can remain without apyproject.toml, causing contributor commands such asuv run poe syntaxto fail withFileNotFoundError.Description & Review Guide
pyproject.toml, and add a regression test with valid and stale package directories.Related Issue
Fixes #7508
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.