Episode

#540: Modern Python monorepo with uv and prek

Podcast
Talk Python To Me
Published
Mar 13, 2026
Duration seconds
3733
Processing state
processed
Canonical source
https://talkpython.fm/episodes/show/540/modern-python-monorepo-with-uv-and-prek
Audio
https://talkpython.fm/episodes/download/540/modern-python-monorepo-with-uv-and-prek.mp3
JSON
/v1/public/podcasts/talk-python-to-me/episodes/540-modern-python-monorepo-with-uv-and-prek
Markdown
/podcast/talk-python-to-me/540-modern-python-monorepo-with-uv-and-prek.md

Actions

  • POST https://stenobird.com/v1/public/podcasts/talk-python-to-me/episodes/540-modern-python-monorepo-with-uv-and-prek/transcription-requests
    Idempotently request low-priority transcript generation for this episode.
  • GET https://stenobird.com/podcast/talk-python-to-me/540-modern-python-monorepo-with-uv-and-prek.md
    Read the agent-friendly Markdown representation of this episode resource.

Summary

Learn how the Apache Airflow team manages a massive Python monorepo containing over a million lines of code and 100+ sub-packages. Discover how modern tooling like uv and pre-commit has eliminated the traditional friction of monorepo maintenance.

Topics

  • Python
  • Monorepo
  • Apache Airflow
  • uv
  • Software Architecture
  • Package Management
  • DevOps
  • Python Packaging

Highlights

  • Main idea: Modern Python packaging standards (PEPs) and tools like uv have made monorepos viable by simplifying dependency management
  • Practical takeaway: Use uv workspaces to ensure sub-packages are isolated and cross-imports are caught easily during development
  • Practical takeaway: Leverage inline script metadata and dependency groups to simplify pre-commit configurations and environment setup
  • Failure mode: Avoid the old 'multi-repo' complexity; the benefits of testing everything together in one place now outweigh the overhead of a monorepo
  • Main idea: The shift toward standardized, tool-agnostic metadata allows for better interoperability between tools like uv, hatch, and pre-commit

Chapters

  1. 1:00 Introduction to Airflow's Monorepo: An introduction to the scale of the Apache Airflow codebase and the challenges of managing hundreds of interconnected sub-packages.
  2. 10:25 Monolith vs. Sub-packages: Discussing the architectural decision to use a monorepo structure rather than a single monolithic repository or fragmented separate repos.
  3. 24:35 The Role of uv and Astral: How the uv toolchain and collaboration with the Astral team enabled better integration for large-scale Python projects.
  4. 33:45 Modern Packaging Standards: Deep dive into how PEPs regarding dependency groups and inline script metadata simplify development and pre-commit hooks.
  5. 43:00 Pre-commit and Rust-based Tooling: The synergy between uv and Rust-based tools like pre-commit in maintaining high-quality code in a large-scale environment.
  6. 52:40 Automated Vendoring and Distribution: How modern standards allow for automatic vendoring of shared libraries during the build process.
  7. 1:02:10 Final Verdict: Just Do It: A concluding recommendation for developers to adopt monorepos now that the tooling has matured.