Episode
#540: Modern Python monorepo with uv and prek
- Podcast
- Talk Python To Me
- Published
- Mar 13, 2026
- Duration seconds
- 3733
- Processing state
processed
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:00Introduction to Airflow's Monorepo: An introduction to the scale of the Apache Airflow codebase and the challenges of managing hundreds of interconnected sub-packages.10:25Monolith vs. Sub-packages: Discussing the architectural decision to use a monorepo structure rather than a single monolithic repository or fragmented separate repos.24:35The Role of uv and Astral: How the uv toolchain and collaboration with the Astral team enabled better integration for large-scale Python projects.33:45Modern Packaging Standards: Deep dive into how PEPs regarding dependency groups and inline script metadata simplify development and pre-commit hooks.43:00Pre-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.52:40Automated Vendoring and Distribution: How modern standards allow for automatic vendoring of shared libraries during the build process.1:02:10Final Verdict: Just Do It: A concluding recommendation for developers to adopt monorepos now that the tooling has matured.