feat: validate uv workspace members/excludes and discover parent workspaces (Fixes #290)#352
feat: validate uv workspace members/excludes and discover parent workspaces (Fixes #290)#352karthiknadig wants to merge 2 commits intomainfrom
Conversation
Performance Report (Linux) ➖
Legend
|
Test Coverage Report (Linux)
Coverage increased! Great work! |
Performance Report (Windows) ✅
Legend
|
Test Coverage Report (Windows)
Coverage increased! Great work! |
|
@zsol This is my attempt at addressing the TODOs in the |
Performance Report (macOS)
Legend
|
zsol
left a comment
There was a problem hiding this comment.
looks good to me, I had one comment
Address @zsol's review: find_workspace_for_project now iterates from project_path (not parent) so a project that also defines [tool.uv.workspace] is discovered. The workspace root is always considered a member of its own workspace (early return on empty relative path). Two new tests cover the self-workspace case.
There was a problem hiding this comment.
Pull request overview
This PR completes pet-uv’s uv workspace support by parsing and validating [tool.uv.workspace] members/exclude rules and by discovering workspace roots by walking up parent directories, improving correctness in monorepo/workspace layouts.
Changes:
- Parse
[tool.uv.workspace]into a structuredUvWorkspace(instead ofIgnoredAny) and add membership validation via glob matching. - Add parent-directory workspace discovery (
find_workspace_for_project) and factor workspace env construction intobuild_workspace_env. - Add the
globdependency and extend the test suite with coverage for matching/exclusion and parent discovery.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/pet-uv/src/lib.rs | Implements workspace member/exclude validation, parent workspace discovery, and adds tests for the new behavior. |
| crates/pet-uv/Cargo.toml | Adds the glob dependency needed for workspace glob matching. |
| Cargo.lock | Locks the new glob dependency for pet-uv. |
Addresses the TODO items in
pet-uvfor workspace member/exclude validation.Changes
[tool.uv.workspace]membersandexcludefields instead of usingIgnoredAnyis_workspace_member()with glob pattern matching (usingrequire_literal_separatorso*doesn't cross directory boundaries)find_workspace_for_project()to discover workspace rootsglobdependency topet-uvFixes #290
cc @zsol — would appreciate your input since you authored the original
pet-uvworkspace support in #263.