FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: validate uv workspace members/excludes and discover parent workspaces (Fixes #290) by karthiknadig · Pull Request #352 · microsoft/python-environment-tools · GitHub

feat: validate uv workspace members/excludes and discover parent workspaces (Fixes #290) - #352

Merged
Karthik Nadig (karthiknadig) merged 2 commits into
mainfrom
feature/issue-290
Mar 27, 2026
Merged

feat: validate uv workspace members/excludes and discover parent workspaces (Fixes #290)#352
Karthik Nadig (karthiknadig) merged 2 commits into
mainfrom
feature/issue-290

Conversation

Copy link
Copy Markdown
Member

Addresses the TODO items in pet-uv for workspace member/exclude validation.

Changes

  • Parse [tool.uv.workspace] members and exclude fields instead of using IgnoredAny
  • Add is_workspace_member() with glob pattern matching (using require_literal_separator so * doesn't cross directory boundaries)
  • Walk up parent directories via find_workspace_for_project() to discover workspace roots
  • Stop at the first workspace found — if the project isn't a member of it, it's not part of any workspace
  • Add glob dependency to pet-uv
  • 9 new tests covering member matching, exclusion, implicit members, parent discovery, and deserialization

Fixes #290

cc Zsolt Dollenstein (@zsol) — would appreciate your input since you authored the original pet-uv workspace support in #263.

github-actions Bot commented Feb 24, 2026
edited
Loading

Copy link
Copy Markdown

Performance Report (Linux) ➖

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 1ms 1ms 1ms 0ms 0%
Full Refresh 97ms 311ms 97ms 0ms 0%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

github-actions Bot commented Feb 24, 2026
edited
Loading

Copy link
Copy Markdown

Test Coverage Report (Linux)

Metric Value
Current Coverage 64.8%
Base Branch Coverage 64.0%
Delta .8% ✅

Coverage increased! Great work!

github-actions Bot commented Feb 24, 2026
edited
Loading

Copy link
Copy Markdown

Performance Report (Windows) ✅

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 9ms 12ms 11ms -2ms -18.2%
Full Refresh 150ms 1606ms 229ms -79ms -34.5%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

github-actions Bot commented Feb 24, 2026
edited
Loading

Copy link
Copy Markdown

Test Coverage Report (Windows)

Metric Value
Current Coverage 61.09%
Base Branch Coverage 60.21%
Delta 0.88% ✅

Coverage increased! Great work!

Copy link
Copy Markdown
Member Author

Zsolt Dollenstein (@zsol) This is my attempt at addressing the TODOs in the uv crate. Let me know what you think.

github-actions Bot commented Feb 24, 2026
edited
Loading

Copy link
Copy Markdown

Performance Report (macOS)

Metric PR (P50) PR (P95) Baseline (P50) Delta
Server Startup 78ms 781ms 47ms 31ms
Full Refresh 154ms 34236ms 101ms 53ms

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

Zsolt Dollenstein (zsol) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

looks good to me, I had one comment

Comment thread crates/pet-uv/src/lib.rs
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 structured UvWorkspace (instead of IgnoredAny) and add membership validation via glob matching.
  • Add parent-directory workspace discovery (find_workspace_for_project) and factor workspace env construction into build_workspace_env.
  • Add the glob dependency 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.

Karthik Nadig (karthiknadig) merged commit 80b4574 into main Mar 27, 2026
34 checks passed
Karthik Nadig (karthiknadig) deleted the feature/issue-290 branch March 27, 2026 17:56
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Complete TODO items in pet-uv for workspace support

4 participants


Back | FazBrowse Home | New Git URL