Python Bytes

#472 Monorepos

9 snips
Mar 9, 2026
A deep dive into managing a Python monorepo with uv workspaces and practical tips for local package workflows. A tour of cattrs for flexible serialization, validation, and converter support. Discussion on learning to program in the AI age and using AI as a tutor. Highlights of a VS Code extension that boosts FastAPI development and deployment.
Ask episode
AI Snips
Chapters
Transcript
Episode notes
ADVICE

Name Root Project Uniquely For UV Workspaces

  • Do give the root workspace a distinct project name and mark inter-package deps so UV resolves them locally.
  • Brian explains using a top-level pyproject.toml with a different name and tool.uv entries to avoid PyPI lookups for internal packages.
ADVICE

Avoid Test Name Collisions In Monorepos

  • Try running pytest in importlib mode or add init files to avoid test name collisions across packages in a monorepo.
  • Brian warns duplicate test filenames like test_helpers can silently conflict and recommends importlib mode as a fix.
INSIGHT

Keep Validation Separate With Cattrs

  • cattrs separates serialization/validation from data classes, letting you parse/unstructure between classes and dicts without coupling models to I/O rules.
  • Michael highlights converters for JSON, msgpack, YAML, msgspec, and decorators for custom hooks and validation.
Get the Snipd Podcast app to discover more snips from this episode
Get the app