Skip to content

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

@karthiknadig

Description

@karthiknadig

Summary

The pet-uv crate has incomplete TODO items related to workspace handling that should be addressed for complete uv environment support.

TODO Items

1. crates/pet-uv/src/lib.rs line 142

// TODO: maybe check for workspace in parent folders?

Context: When identifying uv environments, the code doesn't currently look for workspaces in parent directories. This could miss environments that are part of a parent workspace.

2. crates/pet-uv/src/lib.rs line 162

// TODO: check for workspace members/excludes

Context: uv workspaces can have members and excludes patterns. Currently these are not being checked, which could lead to incorrect environment association.

uv Workspace Configuration Reference

From uv documentation, pyproject.toml can contain:

[tool.uv.workspace]
members = ["packages/*"]
exclude = ["packages/excluded"]

Recommended Implementation

  1. When identifying a uv environment, walk up parent directories looking for pyproject.toml with [tool.uv.workspace]
  2. Parse workspace members and exclude globs
  3. Check if current project matches member patterns and doesn't match exclude patterns
  4. Associate environment with the workspace root if applicable

Priority

Medium - Improves accuracy of uv environment detection in monorepo/workspace setups.

Metadata

Metadata

Assignees

Labels

debtCode quality issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions