pydevtools.com blog

Sync with uv: Eliminate Pre-commit Version Drift

Managing tool versions across multiple configuration files creates persistent headaches in Python development. When you upgrade ruff in your pyproject.toml, you must remember to manually update the pre-commit hook version in .pre-commit-config.yaml. This version drift causes inconsistent behavior between local development and pre-commit checks. The sync-with-uv library solves this by automatically synchronizing tool versions between uv.lock and .pre-commit-config.yaml. The Problem Consider this common scenario: # pyproject.toml [dependency-groups] lint = ["ruff>=0.1.0", "mypy>=1.0.0"] # .pre-commit-config.yaml repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.5 # Must manually sync with pyproject.toml hooks: - id: ruff When uv lock --upgrade updates ruff to 0.1.8, the pre-commit hook stays pinned to 0.1.5. This creates confusing behavior where local checks differ from pre-commit results.

Read more →

September 26, 2025

Analysis of the New Wave of Python Type Checkers

If you’re following Python’s typing ecosystem, Rob Hand’s deep dive into emerging type checkers deserves your attention. He provides the first comprehensive comparison of three new Rust-based type checkers: ty (Astral), pyrefly (Meta), and zuban (David Halter). Key Findings Performance is the new battleground: All three tools abandon Python implementations in favor of Rust, targeting the performance bottlenecks that plague large codebases with existing checkers. Conformance scores don’t predict real-world utility: Hand’s analysis reveals a surprising disconnect: ty passes only 15% of the typing conformance suite’s tests, yet proves surprisingly effective for everyday Python development. This suggests the suite focuses on edge cases that most developers rarely encounter.

Read more →

September 17, 2025

prek: pre-commit, but fast

pre-commit is an essential tool in my development workflow for running ruff and [other tools. However, nobody wants to wait for their commits to be saved, and pre-commit isn’t always the fastest. prek is a Rust-based drop-in replacement that runs 10x faster while using half the disk space. Replacing pre-commit with prek is painless: Install with uv tool install prek Run pre-commit uninstall && prek install That’s it. No configuration changes, no compatibility issues.

Read more →

September 16, 2025

uv format: Code Formatting Comes to uv (experimentally!)

The latest uv release (0.8.13) quietly introduced an experimental new command that Python developers have been waiting for: uv format. This addition brings code formatting directly into uv’s toolkit, eliminating the need to juggle multiple tools for basic Python development workflows. What is uv format? The uv format command provides Python code formatting through uv’s interface. Under the hood, it calls Ruff’s formatter to automatically style your code according to consistent standards.

Read more →

August 21, 2025

Google Sunsets Pytype: The End of an Era for Python Type Checking

Google announced that Pytype, their Python static type checker, will end support with Python 3.12. After 13 years of development, Google is shifting resources toward “new typing approaches” rather than continuing to maintain their bytecode-based analyzer. Pytype’s fundamental architecture became its limitation. Built on bytecode analysis, the tool struggled with Python’s evolving type system. As Google noted, “bytecode’s inherent instability and propensity to change” made implementing new typing PEPs increasingly difficult.

Read more →

August 21, 2025

ty's Breakthrough: Why Incremental Analysis Matters for Python

In a recent PyBytes podcast interview, Astral’s Charlie Marsh shared insights into what makes their new type checker ty unique and how it aims to address longstanding challenges in Python type checking. What is ty? ty serves dual purposes: it functions as a standalone command-line type checker (similar to mypy) and as a language server that powers IDE features like go-to-definition, code completion, and real-time diagnostics. “We wanted to build a great type checker and a great language server, and they have things that are in common but they also have very different requirements,” Marsh explained. “If you don’t think about both of those from the start, you end up in a little bit of trouble.”

Read more →

August 11, 2025

How Python's RFC Process Paved the Way for uv, Ruff, and Ty

Astral, an independent startup, has taken the Python world by storm over the last few years with three fast, robust Python developer tools: ruff (linter and formatter) uv (packaging and project management) ty (static type checker, still under development) These tools came from the mind of Charlie Marsh, who is neither a Python core developer nor directed by the Python Steering Council. While being independently developed, these tools work seamlessly within the established Python ecosystem. This success is in part due to Astral’s attention to the guidelines extablished by the Python Enhancement Proposal (PEP) process over the last twenty-five years

Read more →

August 1, 2025

Interview with the Pybites podcast

Bob Belderbos invited me on the Pybites podcast where I talked about the handbook, uv, and more. I hope you enjoy it.

Read more →

July 30, 2025

Use Interceptors to teach Claude Code to use uv

AI coding agents like Claude Code, Cursor, or GitHub Copilot often default to using system Python interpreters instead of using uv. Armin Ronacher, creator of Flask and Jinja, shared an elegant solution to this problem: creating dummy Python interpreter that actively redirect AI agents toward better tooling choices. Tip

Read more →

July 28, 2025

uvhow: Get uv upgrade instructions for your uv install

I’ve released uvhow, a simple command-line tool that detects how uv was installed on your system and provides the correct upgrade instructions. uv can be installed through multiple methods. When it’s time to upgrade, users often struggle to remember which installation method they used, leading to confusion about the correct upgrade command. uvhow automatically detects your uv installation method and tells you exactly how to upgrade: uvx uvhow The tool works across Windows, macOS, and Linux and supports all major installation methods including:

Read more →

July 22, 2025