Charlie Marsh: Accelerating Python Tooling With Ruff and uv
Feb 7, 2025
auto_awesome
Charlie Marsh, founder of Astral and creator of the tools Ruff and UV, discusses the exciting advances in Python tooling. He shares how Ruff evolved from a simple linter to a comprehensive tool with over 800 rules for better code quality. UV, designed in Rust, simplifies project management, replacing multiple tools with one efficient solution. Charlie also touches on building a community around open-source software and the importance of sustaining such projects, all while navigating the challenges of his professional journey.
Ruff significantly enhances Python linting speed by achieving 10 to 1000 times faster performance, supporting over 800 built-in linting rules.
UV consolidates various Python project management tools into a single command structure, simplifying dependency management and automatic virtual environment handling.
Astral emphasizes community involvement and sustainable funding for its open-source projects, ensuring a user-driven development approach and long-term tool support.
Deep dives
Introduction to Ruff and Its Speed Improvements
Ruff is a tool designed to significantly enhance the speed of Python linting and code formatting. Initially created as a proof of concept, Ruff started with basic linting functionalities and has expanded to include over 800 built-in linting rules. It aims to provide faster feedback to developers by achieving speeds 10 to 1000 times faster than traditional tools, allowing for immediate code analysis and fixes. The tool's performance improvements have led it to be adopted by major projects in the Python ecosystem, demonstrating a high demand for faster linting solutions.
The Development of UV, a Comprehensive Python Package Manager
UV is developed as a robust alternative to Python's existing project management tools, consolidating functionalities from tools like PIP, PIPX, and Poetry. It simplifies the process of managing Python installations, dependencies, and virtual environments through an intuitive command structure, allowing quick commands like 'UV run' to handle multiple tasks. With UV, users can work without worrying about setting up virtual environments manually, as it automatically creates and manages these environments based on project requirements. This ease-of-use encourages a more seamless development experience, particularly for those new to Python.
Emphasizing User Experience and Community Engagement
The growth of Ruff and UV underscores the philosophy of prioritizing user experience and community involvement in development. The team at Astral strives to maintain a positive relationship with users by addressing feedback in a constructive manner, ensuring users feel heard and valued. Engaging with the community is critical, and the tools are designed to accommodate feedback, making continual improvements based on user interactions. This approach fosters a welcoming environment, encouraging user adoption and contribution to both tools.
The Sustainable Open Source Model of Astral
Astral operates under a sustainable business model that funds its open-source initiatives while avoiding monetization of the core tools themselves. The company employs a business strategy that focuses on developing software that complements its open-source projects, such as potential paid integrations or services for enterprise users. This allows the team to dedicate resources to creating high-quality open-source tools while also exploring new funding avenues without compromising the philosophy of accessibility and community support. By adopting this approach, Astral aims to ensure longevity and continuous improvement of Ruff and UV.
Innovations in Programming with Type Checkers
The Astral team is actively developing a new static type checker for Python, aiming to provide an alternative to existing tools like MyPy. This type checker is being built from scratch in Rust, focusing on both performance and compatibility with Python. The development of the type checker reflects a broader trend of optimizing Python tooling and exploring systems programming concepts, which are increasingly important in enhancing developer workflows. Early contributions and community engagement will play a significant role as the type checker moves toward an alpha release for more comprehensive testing and feedback.
Community and Ecosystem Benefits of Rust Integration
The integration of Rust into Python tooling, as seen with Ruff and UV, represents a significant advancement for the Python ecosystem. By leveraging Rust's performance capabilities, these tools enable faster linting, project management, and better overall user experiences. This transition fosters not only individual productivity but also encourages innovation and modernization within the Python community. As more tools are developed with Rust, it paves the way for a broader acceptance of performance-focused Python utilities, ultimately benefiting the entire ecosystem.
Are you looking for fast tools to lint your code and manage your projects? How is the Rust programming language being used to speed up Python tools? This week on the show, we speak with Charlie Marsh about his company, Astral, and their tools, uv and Ruff.
Charlie started working on Ruff as a proof of concept, stating that Python tooling could be much faster. He had seen similar gains in JavaScript tools written in Rust. The project started as a speedy linter with a small ruleset. It’s grown to include code formatting and over 800 built-in linting rules.
Last year, the team at Astral started working on a Python package and project manager written in Rust. As a single tool, uv can replace pip, pip-tools, pipx, poetry, pyenv, and more. We discuss how uv can install and manage versions of Python and run scripts without thinking about virtual environments or dependencies.
Charlie talks about growing the team at Astral over the past couple of years. We also discuss the funding model Astral has adopted and sustaining open-source software.
Python’s standard library includes a whole buffet of useful packages, but sometimes you need to reach for a third-party library. That’s where pip comes in handy. In this video course, you’ll learn how to pip install packages.
Topics:
00:00:00 – Introduction
00:03:37 – How did you get involved in open source?
00:07:01 – Fostering a community around a project
00:11:32 – Python tooling could be much, much faster
00:15:45 – Changing the ergonomics of tooling
00:19:59 – What is ruff and what jobs can it do?
00:22:23 – How do you configure ruff?
00:26:02 – Where do the linting rules come from?
00:29:29 – Can you build your own rules?
00:31:28 – Performance difference for ruff
00:36:25 – Installing ruff
00:37:34 – The rustification of Python
00:40:52 – The initial features and release of uv
00:45:07 – Installing Python
00:47:50 – Taking over the python-build-standalone project
00:53:02 – Installation methods and suggestions
00:55:37 – Video Course Spotlight
00:57:07 – The project API
01:01:57 – Inline script metadata and PEP 723
01:06:49 – Installing tools with uvx
01:09:37 – Project management
01:11:20 – Astral as company and VC funding
01:19:23 – New static type checker
01:26:15 – What are you excited about in the world of Python?
01:27:12 – What do you want to learn next?
01:28:52 – How can people follow your work online?