How You Can Build Python Code with Bazel, and Why You (Probably) Should

Ohad Ravid Ohad Ravid
Language: Hebrew
The presentation was given on 2025.09.09 at PyCon Israel 2025 - Conference.

Python might not have a compilation step, but shipping a service still requires some build process (even if only to copy code somewhere). Let’s explore problems that arise in this situation, and how using a build system like Bazel can solve them.

Shipping a Python service can be as simple as cloning a repository and running a command. But as projects and teams grow, bespoke build processes start to form: README files with instructions on how to install external dependencies for different operating systems, scripts for building native extensions, and custom logic for choosing which tests to execute when running CI pipelines.

This leads to a poor developer experience: brittle environments, long CI cycles, slow builds, and huge container images (when using Docker).

In this talk, we’ll explore how a build system like Bazel approaches these problems and show how a minimal monorepo-style build configuration can be fast, efficient, and still remain developer-friendly.

Bad developer experience isn’t a given - it improves when developers, junior and senior alike, take charge. With a clear understanding of when Bazel can be a boon for Python projects, you’ll know if it’s the right fit for your project and how to approach integrating Bazel for reduced CI times, image sizes, and more hermetic builds.