Skip to content

fix(dev): exclude pytest cache from the uv workspace - #48

Merged
ananjan-nandi-9 merged 1 commit into
mainfrom
fix/uv-workspace-pycache
Aug 9, 2026
Merged

ananjan-nandi-9 merged 1 commit into
mainfrom
fix/uv-workspace-pycache

Conversation

@ananjan-nandi-9

Copy link
Copy Markdown
Collaborator

Summary

  • Excludes shepherd/packages/__pycache__ from wildcard workspace-member discovery.
  • Keeps subsequent uv run, uv sync, and uv lock commands usable after package-wide pytest collection.
  • Documents the contributor-facing fix in the Unreleased changelog.

Motivation / Context

The workspace declares shepherd/packages/* as members. Package-wide pytest collection imports shepherd/packages/conftest.py, creating shepherd/packages/__pycache__. On the next command, uv matches that generated directory as a workspace member and refuses to continue because it has no pyproject.toml.

uv supports exclusion globs specifically for directories that should not be treated as members. This PR adds the narrow generated-directory exclusion without changing any real package membership.

Delta Breakdown

  1. Exclude the generated cache directory. The root workspace adds exclude = ["shepherd/packages/__pycache__"]. Reviewers should verify the exclusion is exact and leaves package globs unchanged.
  2. Document the repaired workflow. The Unreleased changelog records that package collection no longer poisons subsequent uv commands.

Entry Point

Root pyproject.toml workspace discovery → pytest creates shepherd/packages/__pycache__ → subsequent uv project discovery ignores that directory.

There is no runtime API entrypoint; this affects repository development commands.

Review Guide

The main risk is accidentally excluding a real workspace member. The path is the exact Python bytecode-cache directory created beside the aggregate conftest, and no package is located there. The existing member patterns and lock contents are unchanged.

Validation

  • Static checks: uv lock --check validates the workspace configuration; git diff --check passed.
  • Type checks: Not applicable; no Python source or type configuration changes.
  • Tests: 6,585 package tests collected successfully, creating the bytecode cache; a subsequent 26-test contexts run passed.
  • Targeted/manual validation: Confirmed the cache file existed, then confirmed uv lock --check and uv run pytest both succeeded while the cache directory remained present.
  • Not run: Full test execution; the affected behavior is workspace discovery before command execution.

Documentation / Changelog / Decisions

Added an Unreleased Fixed entry. No decision record is needed for the narrow workspace exclusion.

Risk / Rollback / Migration

Risk is very low and limited to workspace discovery. Rollback is removal of the one exclusion entry and changelog bullet. No migration is required.

Follow-ups

None.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Deploying shepherd-agents-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4671a62
Status: ✅  Deploy successful!
Preview URL: https://bc539d0e.shepherd-agents-docs.pages.dev
Branch Preview URL: https://fix-uv-workspace-pycache.shepherd-agents-docs.pages.dev

View logs

Exclude the bytecode cache generated beside shepherd/packages/conftest.py so uv does not treat it as a wildcard workspace member missing pyproject.toml.
@ananjan-nandi-9
ananjan-nandi-9 force-pushed the fix/uv-workspace-pycache branch from c5533d5 to 4671a62 Compare August 9, 2026 20:36
@ananjan-nandi-9
ananjan-nandi-9 merged commit a6b141c into main Aug 9, 2026
5 checks passed
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.

1 participant