<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: astral</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/astral.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2026-03-19T16:45:15+00:00</updated><author><name>Simon Willison</name></author><entry><title>Thoughts on OpenAI acquiring Astral and uv/ruff/ty</title><link href="https://simonwillison.net/2026/Mar/19/openai-acquiring-astral/#atom-tag" rel="alternate"/><published>2026-03-19T16:45:15+00:00</published><updated>2026-03-19T16:45:15+00:00</updated><id>https://simonwillison.net/2026/Mar/19/openai-acquiring-astral/#atom-tag</id><summary type="html">
    &lt;p&gt;The big news this morning: &lt;a href="https://astral.sh/blog/openai"&gt;Astral to join OpenAI&lt;/a&gt; (on the Astral blog) and &lt;a href="https://openai.com/index/openai-to-acquire-astral/"&gt;OpenAI to acquire Astral&lt;/a&gt; (the OpenAI announcement). Astral are the company behind &lt;a href="https://simonwillison.net/tags/uv/"&gt;uv&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ruff/"&gt;ruff&lt;/a&gt;, and &lt;a href="https://simonwillison.net/tags/ty/"&gt;ty&lt;/a&gt; - three increasingly load-bearing open source projects in the Python ecosystem. I have thoughts!&lt;/p&gt;
&lt;h4 id="the-official-line-from-openai-and-astral"&gt;The official line from OpenAI and Astral&lt;/h4&gt;
&lt;p&gt;The Astral team will become part of the Codex team at OpenAI.&lt;/p&gt;
&lt;p&gt;Charlie Marsh &lt;a href="https://astral.sh/blog/openai"&gt;has this to say&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Open source is at the heart of that impact and the heart of that story; it sits at the center of everything we do. In line with our philosophy and &lt;a href="https://openai.com/index/openai-to-acquire-astral/"&gt;OpenAI's own announcement&lt;/a&gt;, OpenAI will continue supporting our open source tools after the deal closes. We'll keep building in the open, alongside our community -- and for the broader Python ecosystem -- just as we have from the start. [...]&lt;/p&gt;
&lt;p&gt;After joining the Codex team, we'll continue building our open source tools, explore ways they can work more seamlessly with Codex, and expand our reach to think more broadly about the future of software development.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;OpenAI's message &lt;a href="https://openai.com/index/openai-to-acquire-astral/"&gt;has a slightly different focus&lt;/a&gt; (highlights mine):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;As part of our developer-first philosophy, after closing OpenAI plans to support Astral’s open source products. &lt;strong&gt;By bringing Astral’s tooling and engineering expertise to OpenAI, we will accelerate our work on Codex&lt;/strong&gt; and expand what AI can do across the software development lifecycle.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is a slightly confusing message. The &lt;a href="https://github.com/openai/codex"&gt;Codex CLI&lt;/a&gt; is a Rust application, and Astral have some of the best Rust engineers in the industry - &lt;a href="https://github.com/burntsushi"&gt;BurntSushi&lt;/a&gt; alone (&lt;a href="https://github.com/rust-lang/regex"&gt;Rust regex&lt;/a&gt;, &lt;a href="https://github.com/BurntSushi/ripgrep"&gt;ripgrep&lt;/a&gt;, &lt;a href="https://github.com/BurntSushi/jiff"&gt;jiff&lt;/a&gt;) may be worth the price of acquisition!&lt;/p&gt;
&lt;p&gt;So is this about the talent or about the product? I expect both, but I know from past experience that a product+talent acquisition can turn into a talent-only acquisition later on.&lt;/p&gt;
&lt;h4 id="uv-is-the-big-one"&gt;uv is the big one&lt;/h4&gt;
&lt;p&gt;Of Astral's projects the most impactful is &lt;a href="https://github.com/astral-sh/uv"&gt;uv&lt;/a&gt;. If you're not familiar with it, &lt;code&gt;uv&lt;/code&gt; is by far the most convincing solution to Python's environment management problems, best illustrated by &lt;a href="https://xkcd.com/1987/"&gt;this classic XKCD&lt;/a&gt;:&lt;/p&gt;
&lt;p style="text-align: center"&gt;&lt;img src="https://imgs.xkcd.com/comics/python_environment.png" alt="xkcd comic showing a tangled, chaotic flowchart of Python environment paths and installations. Nodes include &amp;quot;PIP&amp;quot;, &amp;quot;EASY_INSTALL&amp;quot;, &amp;quot;$PYTHONPATH&amp;quot;, &amp;quot;ANACONDA PYTHON&amp;quot;, &amp;quot;ANOTHER PIP??&amp;quot;, &amp;quot;HOMEBREW PYTHON (2.7)&amp;quot;, &amp;quot;OS PYTHON&amp;quot;, &amp;quot;HOMEBREW PYTHON (3.6)&amp;quot;, &amp;quot;PYTHON.ORG BINARY (2.6)&amp;quot;, and &amp;quot;(MISC FOLDERS OWNED BY ROOT)&amp;quot; connected by a mess of overlapping arrows. A stick figure with a &amp;quot;?&amp;quot; stands at the top left. Paths at the bottom include &amp;quot;/usr/local/Cellar&amp;quot;, &amp;quot;/usr/local/opt&amp;quot;, &amp;quot;/usr/local/lib/python3.6&amp;quot;, &amp;quot;/usr/local/lib/python2.7&amp;quot;, &amp;quot;/python/&amp;quot;, &amp;quot;/newenv/&amp;quot;, &amp;quot;$PATH&amp;quot;, &amp;quot;????&amp;quot;, and &amp;quot;/(A BUNCH OF PATHS WITH &amp;quot;FRAMEWORKS&amp;quot; IN THEM SOMEWHERE)/&amp;quot;. Caption reads: &amp;quot;MY PYTHON ENVIRONMENT HAS BECOME SO DEGRADED THAT MY LAPTOP HAS BEEN DECLARED A SUPERFUND SITE.&amp;quot;" style="max-width: 100%;" /&gt;&lt;/p&gt;
&lt;p&gt;Switch from &lt;code&gt;python&lt;/code&gt; to &lt;code&gt;uv run&lt;/code&gt; and most of these problems go away. I've been using it extensively for the past couple of years and it's become an essential part of my workflow.&lt;/p&gt;
&lt;p&gt;I'm not alone in this. According to PyPI Stats &lt;a href="https://pypistats.org/packages/uv"&gt;uv was downloaded&lt;/a&gt; more than 126 million times last month! Since its release in February 2024 - just two years ago - it's become one of the most popular tools for running Python code.&lt;/p&gt;
&lt;h4 id="ruff-and-ty"&gt;Ruff and ty&lt;/h4&gt;
&lt;p&gt;Astral's two other big projects are &lt;a href="https://github.com/astral-sh/ruff"&gt;ruff&lt;/a&gt; - a Python linter and formatter - and &lt;a href="https://github.com/astral-sh/ty"&gt;ty&lt;/a&gt; - a fast Python type checker.&lt;/p&gt;
&lt;p&gt;These are popular tools that provide a great developer experience but they aren't load-bearing in the same way that &lt;code&gt;uv&lt;/code&gt; is.&lt;/p&gt;
&lt;p&gt;They do however resonate well with coding agent tools like Codex - giving an agent access to fast linting and type checking tools can help improve the quality of the code they generate.&lt;/p&gt;
&lt;p&gt;I'm not convinced that integrating them &lt;em&gt;into&lt;/em&gt; the coding agent itself as opposed to telling it when to run them will make a meaningful difference, but I may just not be imaginative enough here.&lt;/p&gt;
&lt;h4 id="what-of-pyx-"&gt;What of pyx?&lt;/h4&gt;
&lt;p&gt;Ever since &lt;code&gt;uv&lt;/code&gt; started to gain traction the Python community has been worrying about the strategic risk of a single VC-backed company owning a key piece of Python infrastructure. I &lt;a href="https://simonwillison.net/2024/Sep/8/uv-under-discussion-on-mastodon/"&gt;wrote about&lt;/a&gt; one of those conversations in detail back in September 2024.&lt;/p&gt;
&lt;p&gt;The conversation back then focused on what Astral's business plan could be, which started to take form &lt;a href="https://simonwillison.net/2025/Aug/13/pyx/"&gt;in August 2025&lt;/a&gt; when they announced &lt;a href="https://astral.sh/pyx"&gt;pyx&lt;/a&gt;, their private PyPI-style package registry for organizations.&lt;/p&gt;
&lt;p&gt;I'm less convinced that pyx makes sense within OpenAI, and it's notably absent from both the Astral and OpenAI announcement posts.&lt;/p&gt;
&lt;h4 id="competitive-dynamics"&gt;Competitive dynamics&lt;/h4&gt;
&lt;p&gt;An interesting aspect of this deal is how it might impact the competition between Anthropic and OpenAI.&lt;/p&gt;
&lt;p&gt;Both companies spent most of 2025 focused on improving the coding ability of their models, resulting in the &lt;a href="https://simonwillison.net/tags/november-2025-inflection/"&gt;November 2025 inflection point&lt;/a&gt; when coding agents went from often-useful to almost-indispensable tools for software development.&lt;/p&gt;
&lt;p&gt;The competition between Anthropic's Claude Code and OpenAI's Codex is &lt;em&gt;fierce&lt;/em&gt;. Those $200/month subscriptions add up to billions of dollars a year in revenue, for companies that very much need that money.&lt;/p&gt;
&lt;p&gt;Anthropic &lt;a href="https://www.anthropic.com/news/anthropic-acquires-bun-as-claude-code-reaches-usd1b-milestone"&gt;acquired the Bun JavaScript runtime&lt;/a&gt; in December 2025, an acquisition that looks somewhat similar in shape to Astral.&lt;/p&gt;
&lt;p&gt;Bun was already a core component of Claude Code and that acquisition looked to mainly be about ensuring that a crucial dependency stayed actively maintained. Claude Code's performance has increased significantly since then thanks to the efforts of Bun's Jarred Sumner.&lt;/p&gt;
&lt;p&gt;One bad version of this deal would be if OpenAI start using their ownership of &lt;code&gt;uv&lt;/code&gt; as leverage in their competition with Anthropic.&lt;/p&gt;
&lt;h4 id="astral-s-quiet-series-a-and-b"&gt;Astral's quiet series A and B&lt;/h4&gt;
&lt;p&gt;One detail that caught my eye from Astral's announcement, in the section thanking the team, investors, and community:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Second, to our investors, especially &lt;a href="https://www.accel.com/team/casey-aylward#bay-area"&gt;Casey Aylward&lt;/a&gt; from Accel, who led our Seed and Series A, and &lt;a href="https://a16z.com/author/jennifer-li/"&gt;Jennifer Li&lt;/a&gt; from Andreessen Horowitz, who led our Series B. As a first-time, technical, solo founder, you showed far more belief in me than I ever showed in myself, and I will never forget that.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As far as I can tell neither the Series A nor the Series B were previously announced - I've only been able to find coverage of the original seed round &lt;a href="https://astral.sh/blog/announcing-astral-the-company-behind-ruff"&gt;from April 2023&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Those investors presumably now get to exchange their stake in Astral for a piece of OpenAI. I wonder how much influence they had on Astral's decision to sell.&lt;/p&gt;
&lt;h4 id="forking-as-a-credible-exit-"&gt;Forking as a credible exit?&lt;/h4&gt;
&lt;p&gt;Armin Ronacher built &lt;a href="https://til.simonwillison.net/python/rye"&gt;Rye&lt;/a&gt;, which was later taken over by Astral and effectively merged with uv. In &lt;a href="https://lucumr.pocoo.org/2024/8/21/harvest-season/"&gt;August 2024&lt;/a&gt; he wrote about the risk involved in a VC-backed company owning a key piece of open source infrastructure and said the following (highlight mine):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;However having seen the code and what uv is doing, &lt;strong&gt;even in the worst possible future this is a very forkable and maintainable thing&lt;/strong&gt;. I believe that even in case Astral shuts down or were to do something incredibly dodgy licensing wise, the community would be better off than before uv existed.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Astral's own Douglas Creager &lt;a href="https://news.ycombinator.com/item?id=47438723#47439974"&gt;emphasized this angle on Hacker News today&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;All I can say is that &lt;em&gt;right now&lt;/em&gt;, we're committed to maintaining our open-source tools with the same level of effort, care, and attention to detail as before. That does not change with this acquisition. No one can guarantee how motives, incentives, and decisions might change years down the line. But that's why we bake optionality into it with the tools being permissively licensed. That makes the worst-case scenarios have the shape of "fork and move on", and not "software disappears forever".&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I like and trust the Astral team and I'm optimistic that their projects will be well-maintained in their new home.&lt;/p&gt;
&lt;p&gt;OpenAI don't yet have much of a track record with respect to acquiring and maintaining open source projects. They've been on a bit of an acquisition spree over the past three months though, snapping up &lt;a href="https://openai.com/index/openai-to-acquire-promptfoo/"&gt;Promptfoo&lt;/a&gt; and &lt;a href="https://steipete.me/posts/2026/openclaw"&gt;OpenClaw&lt;/a&gt; (sort-of, they hired creator Peter Steinberger and are spinning OpenClaw off to a foundation), plus closed source LaTeX platform &lt;a href="https://openai.com/index/introducing-prism/"&gt;Crixet (now Prism)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If things do go south for &lt;code&gt;uv&lt;/code&gt; and the other Astral projects we'll get to see how credible the forking exit strategy turns out to be.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ai"&gt;ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rust"&gt;rust&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/openai"&gt;openai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ruff"&gt;ruff&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/uv"&gt;uv&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/astral"&gt;astral&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/charlie-marsh"&gt;charlie-marsh&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/coding-agents"&gt;coding-agents&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/codex-cli"&gt;codex-cli&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ty"&gt;ty&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="python"/><category term="ai"/><category term="rust"/><category term="openai"/><category term="ruff"/><category term="uv"/><category term="astral"/><category term="charlie-marsh"/><category term="coding-agents"/><category term="codex-cli"/><category term="ty"/></entry><entry><title>ty: An extremely fast Python type checker and LSP</title><link href="https://simonwillison.net/2025/Dec/16/ty/#atom-tag" rel="alternate"/><published>2025-12-16T23:35:33+00:00</published><updated>2025-12-16T23:35:33+00:00</updated><id>https://simonwillison.net/2025/Dec/16/ty/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://astral.sh/blog/ty"&gt;ty: An extremely fast Python type checker and LSP&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
The team at Astral have been working on this for quite a long time, and are finally releasing the first beta.  They have some big performance claims:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Without caching, ty is consistently between 10x and 60x faster than mypy and Pyright. When run in an editor, the gap is even more dramatic. As an example, after editing a load-bearing file in the PyTorch repository, ty recomputes diagnostics in 4.7ms: 80x faster than Pyright (386ms) and 500x faster than Pyrefly (2.38 seconds). ty is very fast!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The easiest way to try it out is via &lt;code&gt;uvx&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cd my-python-project/
uvx ty check
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I &lt;a href="https://gistpreview.github.io/?a3aff6768e85168d89d4515e3dbcb7d2"&gt;tried it&lt;/a&gt; against &lt;a href="https://sqlite-utils.datasette.io/"&gt;sqlite-utils&lt;/a&gt; and it turns out I have quite a lot of work to do!&lt;/p&gt;
&lt;p&gt;Astral also released a new &lt;a href="https://marketplace.visualstudio.com/items?itemName=astral-sh.ty"&gt;VS Code extension&lt;/a&gt; adding ty-powered language server features like go to definition. I'm still getting my head around how this works and what it can do.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=46294289"&gt;Hacker News&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/vs-code"&gt;vs-code&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/astral"&gt;astral&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ty"&gt;ty&lt;/a&gt;&lt;/p&gt;



</summary><category term="python"/><category term="vs-code"/><category term="astral"/><category term="ty"/></entry><entry><title>pyx: a Python-native package registry, now in Beta</title><link href="https://simonwillison.net/2025/Aug/13/pyx/#atom-tag" rel="alternate"/><published>2025-08-13T18:36:51+00:00</published><updated>2025-08-13T18:36:51+00:00</updated><id>https://simonwillison.net/2025/Aug/13/pyx/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://astral.sh/blog/introducing-pyx"&gt;pyx: a Python-native package registry, now in Beta&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Since its first release, the single biggest question around the &lt;a href="https://github.com/astral-sh/uv"&gt;uv&lt;/a&gt; Python environment management tool has been around Astral's business model: Astral are a VC-backed company and at some point they need to start making real revenue.&lt;/p&gt;
&lt;p&gt;Back in September Astral founder Charlie Marsh &lt;a href="https://simonwillison.net/2024/Sep/8/uv-under-discussion-on-mastodon/"&gt;said the following&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I don't want to charge people money to use our tools, and I don't want to create an incentive structure whereby our open source offerings are competing with any commercial offerings (which is what you see with a lost of hosted-open-source-SaaS business models).&lt;/p&gt;
&lt;p&gt;What I want to do is build software that vertically integrates with our open source tools, and sell that software to companies that are already using Ruff, uv, etc. Alternatives to things that companies already pay for today.&lt;/p&gt;
&lt;p&gt;An example of what this might look like (we may not do this, but it's helpful to have a concrete example of the strategy) would be something like an enterprise-focused private package registry. [...]&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It looks like those plans have become concrete now! From today's announcement:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; &lt;a href="https://astral.sh/pyx"&gt;pyx&lt;/a&gt; is a Python-native package registry --- and the first piece of the Astral platform, our next-generation infrastructure for the Python ecosystem.&lt;/p&gt;
&lt;p&gt;We think of &lt;a href="https://astral.sh/pyx"&gt;pyx&lt;/a&gt; as an optimized backend for &lt;a href="https://github.com/astral-sh/uv"&gt;uv&lt;/a&gt;: it's a package registry, but it also solves problems that go beyond the scope of a traditional "package registry", making your Python experience faster, more secure, and even GPU-aware, both for private packages and public sources (like PyPI and the PyTorch index).&lt;/p&gt;
&lt;p&gt;&lt;a href="https://astral.sh/pyx"&gt;pyx&lt;/a&gt; is live with our early partners, including &lt;a href="https://ramp.com/"&gt;Ramp&lt;/a&gt;, &lt;a href="https://www.intercom.com/"&gt;Intercom&lt;/a&gt;, and &lt;a href="https://fal.ai/"&gt;fal&lt;/a&gt; [...]&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This looks like a sensible direction to me, and one that stays true to Charlie's promises to carefully design the incentive structure to avoid corrupting the core open source project that the Python community is coming to depend on.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://x.com/charliermarsh/status/1955695947716985241"&gt;@charliermarsh&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/open-source"&gt;open-source&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/packaging"&gt;packaging&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/uv"&gt;uv&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/astral"&gt;astral&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/charlie-marsh"&gt;charlie-marsh&lt;/a&gt;&lt;/p&gt;



</summary><category term="open-source"/><category term="packaging"/><category term="python"/><category term="uv"/><category term="astral"/><category term="charlie-marsh"/></entry><entry><title>astral-sh/ty</title><link href="https://simonwillison.net/2025/May/7/ty/#atom-tag" rel="alternate"/><published>2025-05-07T18:37:33+00:00</published><updated>2025-05-07T18:37:33+00:00</updated><id>https://simonwillison.net/2025/May/7/ty/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/astral-sh/ty"&gt;astral-sh/ty&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Astral have been working on this "extremely fast Python type checker and language server, written in Rust" &lt;a href="https://simonwillison.net/2025/Jan/29/charlie-marsh/"&gt;quietly but in-the-open&lt;/a&gt; for a while now. Here's the first alpha public release - albeit &lt;a href="https://news.ycombinator.com/item?id=43918484#43919354"&gt;not yet announced&lt;/a&gt; - as &lt;a href="https://pypi.org/project/ty/"&gt;ty&lt;/a&gt; on PyPI (nice &lt;a href="https://news.ycombinator.com/item?id=43918484#43920112"&gt;donated&lt;/a&gt; two-letter name!)&lt;/p&gt;
&lt;p&gt;You can try it out via &lt;a href="https://docs.astral.sh/uv/guides/tools/#running-tools"&gt;uvx&lt;/a&gt; like this - run the command in a folder full of Python code and see what comes back:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uvx ty check
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I got zero errors for my recent, simple &lt;a href="https://github.com/simonw/condense-json"&gt;condense-json&lt;/a&gt; library and a &lt;em&gt;ton&lt;/em&gt; of errors for my more mature &lt;a href="https://sqlite-utils.datasette.io/"&gt;sqlite-utils&lt;/a&gt; library - &lt;a href="https://gist.github.com/simonw/a13e1720b03e23783ae668eca7f6f12a"&gt;output here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It really is &lt;em&gt;fast&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cd /tmp
git clone https://github.com/simonw/sqlite-utils
cd sqlite-utils
time uvx ty check
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Reports it running in around a tenth of a second (0.109 total wall time) using multiple CPU cores:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uvx ty check  0.18s user 0.07s system 228% cpu 0.109 total
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Running &lt;code&gt;time uvx mypy .&lt;/code&gt; in the same folder (both after first ensuring the underlying tools had been cached) took around 7x longer:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uvx mypy .  0.46s user 0.09s system 74% cpu 0.740 total
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This isn't a fair comparison yet as ty still isn't feature complete in comparison to mypy.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=43918484"&gt;Hacker News&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/pypi"&gt;pypi&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rust"&gt;rust&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mypy"&gt;mypy&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/uv"&gt;uv&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/astral"&gt;astral&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ty"&gt;ty&lt;/a&gt;&lt;/p&gt;



</summary><category term="pypi"/><category term="python"/><category term="rust"/><category term="mypy"/><category term="uv"/><category term="astral"/><category term="ty"/></entry><entry><title>Quoting Kevin Samuel</title><link href="https://simonwillison.net/2025/Feb/15/kevin-samuel/#atom-tag" rel="alternate"/><published>2025-02-15T20:10:23+00:00</published><updated>2025-02-15T20:10:23+00:00</updated><id>https://simonwillison.net/2025/Feb/15/kevin-samuel/#atom-tag</id><summary type="html">
    &lt;blockquote cite="https://www.bitecode.dev/p/a-year-of-uv-pros-cons-and-should"&gt;&lt;p&gt;[...] if your situation allows it, always try uv first. Then fall back on something else if that doesn’t work out.&lt;/p&gt;
&lt;p&gt;It is the Pareto solution because it's easier than trying to figure out what you should do and you will rarely regret it. Indeed, the cost of moving to and from it is low, but the value it delivers is quite high.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="https://www.bitecode.dev/p/a-year-of-uv-pros-cons-and-should"&gt;Kevin Samuel&lt;/a&gt;, Bite code!&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/uv"&gt;uv&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/astral"&gt;astral&lt;/a&gt;&lt;/p&gt;



</summary><category term="python"/><category term="uv"/><category term="astral"/></entry><entry><title>python-build-standalone now has Python 3.14.0a5</title><link href="https://simonwillison.net/2025/Feb/13/python-3140a5/#atom-tag" rel="alternate"/><published>2025-02-13T06:25:24+00:00</published><updated>2025-02-13T06:25:24+00:00</updated><id>https://simonwillison.net/2025/Feb/13/python-3140a5/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/astral-sh/python-build-standalone/releases/tag/20250212"&gt;python-build-standalone now has Python 3.14.0a5&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Exciting news &lt;a href="https://twitter.com/charliermarsh/status/1889837406322565305"&gt;from Charlie Marsh&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We just shipped the latest Python 3.14 alpha (3.14.0a5) to uv and python-build-standalone. This is the first release that includes the tail-calling interpreter.&lt;/p&gt;
&lt;p&gt;Our initial benchmarks show a ~20-30% performance improvement across CPython.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is an optimization that was first discussed &lt;a href="https://github.com/faster-cpython/ideas/issues/642"&gt;in faster-cpython&lt;/a&gt; in January 2024, then landed earlier this month &lt;a href="https://github.com/python/cpython/issues/128563"&gt;by Ken Jin&lt;/a&gt; and included in the 3.14a05 release. The &lt;a href="https://docs.python.org/dev/whatsnew/3.14.html#whatsnew314-tail-call"&gt;alpha release notes&lt;/a&gt; say:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A new type of interpreter based on tail calls has been added to CPython. For certain newer compilers, this interpreter provides significantly better performance. Preliminary numbers on our machines suggest anywhere from -3% to 30% faster Python code, and a geometric mean of 9-15% faster on pyperformance depending on platform and architecture. The baseline is Python 3.14 built with Clang 19 without this new interpreter.&lt;/p&gt;
&lt;p&gt;This interpreter currently only works with Clang 19 and newer on x86-64 and AArch64 architectures. However, we expect that a future release of GCC will support this as well.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Including this in &lt;a href="https://github.com/astral-sh/python-build-standalone"&gt;python-build-standalone&lt;/a&gt; means  it's now trivial to try out via &lt;a href="https://github.com/astral-sh/uv"&gt;uv&lt;/a&gt;. I upgraded to the latest &lt;code&gt;uv&lt;/code&gt; like this:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell"&gt;&lt;pre&gt;pip install -U uv&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then ran &lt;code&gt;uv python list&lt;/code&gt; to see the available versions:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cpython-3.14.0a5+freethreaded-macos-aarch64-none    &amp;lt;download available&amp;gt;
cpython-3.14.0a5-macos-aarch64-none                 &amp;lt;download available&amp;gt;
cpython-3.13.2+freethreaded-macos-aarch64-none      &amp;lt;download available&amp;gt;
cpython-3.13.2-macos-aarch64-none                   &amp;lt;download available&amp;gt;
cpython-3.13.1-macos-aarch64-none                   /opt/homebrew/opt/python@3.13/bin/python3.13 -&amp;gt; ../Frameworks/Python.framework/Versions/3.13/bin/python3.13
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I downloaded the new alpha like this:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell"&gt;&lt;pre&gt;uv python install cpython-3.14.0a5&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And tried it out like so:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell"&gt;&lt;pre&gt;uv run --python 3.14.0a5 python&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The Astral team have been using Ken's &lt;a href="https://gist.github.com/Fidget-Spinner/e7bf204bf605680b0fc1540fe3777acf"&gt;bm_pystones.py&lt;/a&gt; benchmarks script. I grabbed a copy like this:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell"&gt;&lt;pre&gt;wget &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;https://gist.githubusercontent.com/Fidget-Spinner/e7bf204bf605680b0fc1540fe3777acf/raw/fa85c0f3464021a683245f075505860db5e8ba6b/bm_pystones.py&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And ran it with &lt;code&gt;uv&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell"&gt;&lt;pre&gt;uv run --python 3.14.0a5 bm_pystones.py&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Giving:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Pystone(1.1) time for 50000 passes = 0.0511138
This machine benchmarks at 978209 pystones/second
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Inspired by Charlie's &lt;a href="https://twitter.com/charliermarsh/status/1889837406322565305"&gt;example&lt;/a&gt; I decided to try the &lt;a href="https://github.com/sharkdp/hyperfine"&gt;hyperfine&lt;/a&gt; benchmarking tool, which can run multiple commands to statistically compare their performance. I came up with this recipe:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell"&gt;&lt;pre&gt;brew install hyperfine
hyperfine &lt;span class="pl-cce"&gt;\ &lt;/span&gt;                           
  &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;uv run --python 3.14.0a5 bm_pystones.py&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt; \
  &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;uv run --python 3.13 bm_pystones.py&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt; \
  -n tail-calling \
  -n baseline \
  --warmup 10&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;img src="https://static.simonwillison.net/static/2025/hyperfine-uv.jpg" alt="Running that command produced: Benchmark 1: tail-calling   Time (mean ± σ):      71.5 ms ±   0.9 ms    [User: 65.3 ms, System: 5.0 ms]   Range (min … max):    69.7 ms …  73.1 ms    40 runs   Benchmark 2: baseline   Time (mean ± σ):      79.7 ms ±   0.9 ms    [User: 73.9 ms, System: 4.5 ms]   Range (min … max):    78.5 ms …  82.3 ms    36 runs   Summary   tail-calling ran     1.12 ± 0.02 times faster than baseline" style="max-width: 100%;" /&gt;&lt;/p&gt;
&lt;p&gt;So 3.14.0a5 scored 1.12 times faster than 3.13 on the benchmark (on my extremely overloaded M2 MacBook Pro).


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/benchmarks"&gt;benchmarks&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/uv"&gt;uv&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/astral"&gt;astral&lt;/a&gt;&lt;/p&gt;



</summary><category term="benchmarks"/><category term="python"/><category term="uv"/><category term="astral"/></entry><entry><title>Quoting Charlie Marsh</title><link href="https://simonwillison.net/2025/Jan/29/charlie-marsh/#atom-tag" rel="alternate"/><published>2025-01-29T18:53:56+00:00</published><updated>2025-01-29T18:53:56+00:00</updated><id>https://simonwillison.net/2025/Jan/29/charlie-marsh/#atom-tag</id><summary type="html">
    &lt;blockquote cite="https://bsky.app/profile/crmarsh.com/post/3lgvhzdfrps26"&gt;&lt;p&gt;We’re building a new static type checker for Python, from scratch, in Rust. From a technical perspective, it’s probably our most ambitious project yet. We’re about &lt;a href="https://github.com/astral-sh/ruff/pulls?q=is%3Aopen+is%3Apr+label%3Ared-knot"&gt;800 PRs deep&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;Like Ruff and uv, there will be a significant focus on performance. The entire system is designed to be highly incremental so that it can eventually power a language server (e.g., only re-analyze affected files on code change). [...]&lt;/p&gt;
&lt;p&gt;We haven't publicized it to-date, but all of this work has been happening in the open, in the Ruff repository.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="https://bsky.app/profile/crmarsh.com/post/3lgvhzdfrps26"&gt;Charlie Marsh&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rust"&gt;rust&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ruff"&gt;ruff&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/uv"&gt;uv&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/astral"&gt;astral&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/charlie-marsh"&gt;charlie-marsh&lt;/a&gt;&lt;/p&gt;



</summary><category term="python"/><category term="rust"/><category term="ruff"/><category term="uv"/><category term="astral"/><category term="charlie-marsh"/></entry><entry><title>Transferring Python Build Standalone Stewardship to Astral</title><link href="https://simonwillison.net/2024/Dec/3/python-build-standalone-astral/#atom-tag" rel="alternate"/><published>2024-12-03T23:18:37+00:00</published><updated>2024-12-03T23:18:37+00:00</updated><id>https://simonwillison.net/2024/Dec/3/python-build-standalone-astral/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://gregoryszorc.com/blog/2024/12/03/transferring-python-build-standalone-stewardship-to-astral/"&gt;Transferring Python Build Standalone Stewardship to Astral&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Gregory Szorc's &lt;a href="https://github.com/indygreg/python-build-standalone"&gt;Python Standalone Builds&lt;/a&gt; have been &lt;a href="https://xkcd.com/2347/"&gt;quietly running&lt;/a&gt; an increasing portion of the Python ecosystem for a few years now, but really accelerated in importance when &lt;a href="https://github.com/astral-sh/uv"&gt;uv&lt;/a&gt; started using them for new Python installations managed by that tool. The releases (shipped via GitHub) have now been downloaded over 70 million times, 50 million of those since uv's initial release in March of this year.&lt;/p&gt;
&lt;p&gt;uv maintainers Astral have been helping out with PSB maintenance for a while:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When I told Charlie I could use assistance supporting PBS, Astral employees started contributing to the project. They have built out various functionality, including Python 3.13 support (including free-threaded builds), turnkey automated release publishing, and debug symbol stripped builds to further reduce the download/install size. Multiple Astral employees now have GitHub permissions to approve/merge PRs and publish releases. All &lt;a href="https://github.com/indygreg/python-build-standalone/releases"&gt;releases&lt;/a&gt; since April have been performed by Astral employees.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As-of December 17th Gregory will be transferring the project to the Astral organization, while staying on as a maintainer and advisor. Here's Astral's post about this: &lt;a href="https://astral.sh/blog/python-build-standalone"&gt;A new home for python-build-standalone&lt;/a&gt;.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/uv"&gt;uv&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/astral"&gt;astral&lt;/a&gt;&lt;/p&gt;



</summary><category term="python"/><category term="uv"/><category term="astral"/></entry><entry><title>TIL: Using uv to develop Python command-line applications</title><link href="https://simonwillison.net/2024/Oct/24/uv-cli/#atom-tag" rel="alternate"/><published>2024-10-24T05:56:21+00:00</published><updated>2024-10-24T05:56:21+00:00</updated><id>https://simonwillison.net/2024/Oct/24/uv-cli/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://til.simonwillison.net/python/uv-cli-apps"&gt;TIL: Using uv to develop Python command-line applications&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
I've been increasingly using &lt;a href="https://docs.astral.sh/uv/"&gt;uv&lt;/a&gt; to try out new software (via &lt;code&gt;uvx&lt;/code&gt;) and experiment with new ideas, but I hadn't quite figured out the right way to use it for developing my own projects.&lt;/p&gt;
&lt;p&gt;It turns out I was missing a few things - in particular the fact that there's no need to use &lt;code&gt;uv pip&lt;/code&gt; at all when working with a local development environment, you can get by entirely on &lt;code&gt;uv run&lt;/code&gt; (and maybe &lt;code&gt;uv sync --extra test&lt;/code&gt; to install test dependencies) with no direct invocations of &lt;code&gt;uv pip&lt;/code&gt; at all.&lt;/p&gt;
&lt;p&gt;I bounced &lt;a href="https://gist.github.com/simonw/975dfa41e9b03bca2513a986d9aa3dcf"&gt;a few questions&lt;/a&gt; off Charlie Marsh and filled in the missing gaps - this TIL shows my new uv-powered process for hacking on Python CLI apps built using Click and my &lt;a href="https://github.com/simonw/click-app"&gt;simonw/click-app&lt;/a&gt; cookecutter template.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/cli"&gt;cli&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/packaging"&gt;packaging&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/pip"&gt;pip&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/til"&gt;til&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/cookiecutter"&gt;cookiecutter&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/uv"&gt;uv&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/astral"&gt;astral&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/charlie-marsh"&gt;charlie-marsh&lt;/a&gt;&lt;/p&gt;



</summary><category term="cli"/><category term="packaging"/><category term="pip"/><category term="python"/><category term="til"/><category term="cookiecutter"/><category term="uv"/><category term="astral"/><category term="charlie-marsh"/></entry><entry><title>[red-knot] type inference/checking test framework</title><link href="https://simonwillison.net/2024/Oct/16/markdown-test-framework/#atom-tag" rel="alternate"/><published>2024-10-16T20:43:55+00:00</published><updated>2024-10-16T20:43:55+00:00</updated><id>https://simonwillison.net/2024/Oct/16/markdown-test-framework/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/astral-sh/ruff/pull/13636"&gt;[red-knot] type inference/checking test framework&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Ruff maintainer Carl Meyer recently landed an interesting new design for a testing framework. It's based on Markdown, and could be described as a form of "literate testing" - the testing equivalent of Donald Knuth's &lt;a href="https://en.wikipedia.org/wiki/Literate_programming"&gt;literate programming&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A markdown test file is a suite of tests, each test can contain one or more Python files, with optionally specified path/name. The test writes all files to an in-memory file system, runs red-knot, and matches the resulting diagnostics against &lt;code&gt;Type:&lt;/code&gt; and &lt;code&gt;Error:&lt;/code&gt; assertions embedded in the Python source as comments.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Test suites are Markdown documents with embedded fenced blocks that look &lt;a href="https://github.com/astral-sh/ruff/blob/2095ea83728d32959a435ab749acce48dfb76256/crates/red_knot_python_semantic/resources/mdtest/literal/float.md?plain=1#L5-L7"&gt;like this&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;```py
reveal_type(1.0) # revealed: float
```
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Tests can optionally include a &lt;code&gt;path=&lt;/code&gt; specifier, which can provide neater messages when reporting test failures:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;```py path=branches_unify_to_non_union_type.py
def could_raise_returns_str() -&amp;gt; str:
    return 'foo'
...
```
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A larger example test suite can be browsed in the &lt;a href="https://github.com/astral-sh/ruff/tree/6282402a8cb44ac6362c6007fc911c3d75729648/crates/red_knot_python_semantic/resources/mdtest"&gt;red_knot_python_semantic/resources/mdtest&lt;/a&gt; directory.&lt;/p&gt;
&lt;p&gt;This document &lt;a href="https://github.com/astral-sh/ruff/blob/main/crates/red_knot_python_semantic/resources/mdtest/exception/control_flow.md"&gt;on control flow for exception handlers&lt;/a&gt; (from &lt;a href="https://github.com/astral-sh/ruff/pull/13729"&gt;this PR&lt;/a&gt;) is the best example I've found of detailed prose documentation to accompany the tests.&lt;/p&gt;
&lt;p&gt;The system is implemented in Rust, but it's easy to imagine an alternative version of this idea written in Python as a &lt;code&gt;pytest&lt;/code&gt; plugin. This feels like an evolution of the old Python &lt;a href="https://docs.python.org/3/library/doctest.html"&gt;doctest&lt;/a&gt; idea, except that tests are embedded directly in Markdown rather than being embedded in Python code docstrings.&lt;/p&gt;
&lt;p&gt;... and it looks like such plugins exist already. Here are two that I've found so far:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/modal-labs/pytest-markdown-docs"&gt;pytest-markdown-docs&lt;/a&gt; by Elias Freider and Modal Labs.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html"&gt;sphinx.ext.doctest&lt;/a&gt; is a core Sphinx extension for running test snippets in documentation.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/scientific-python/pytest-doctestplus"&gt;pytest-doctestplus&lt;/a&gt; from the Scientific Python community, first released in 2011.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I tried &lt;code&gt;pytest-markdown-docs&lt;/code&gt; by creating a &lt;code&gt;doc.md&lt;/code&gt; file like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Hello test doc

```py
assert 1 + 2 == 3
```

But this fails:

```py
assert 1 + 2 == 4
```
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And then running it with &lt;a href="https://docs.astral.sh/uv/guides/tools/"&gt;uvx&lt;/a&gt; like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uvx --with pytest-markdown-docs pytest --markdown-docs
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I got one pass and one fail:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;_______ docstring for /private/tmp/doc.md __________
Error in code block:
```
10   assert 1 + 2 == 4
11   
```
Traceback (most recent call last):
  File "/private/tmp/tt/doc.md", line 10, in &amp;lt;module&amp;gt;
    assert 1 + 2 == 4
AssertionError

============= short test summary info ==============
FAILED doc.md::/private/tmp/doc.md
=========== 1 failed, 1 passed in 0.02s ============
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I also &lt;a href="https://twitter.com/exhaze/status/1846675911225364742"&gt;just learned&lt;/a&gt; that the venerable Python &lt;code&gt;doctest&lt;/code&gt; standard library module has the ability to &lt;a href="https://docs.python.org/3/library/doctest.html#simple-usage-checking-examples-in-a-text-file"&gt;run tests in documentation files&lt;/a&gt; too, with &lt;code&gt;doctest.testfile("example.txt")&lt;/code&gt;: "The file content is treated as if it were a single giant docstring; the file doesn’t need to contain a Python program!"

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/charliermarsh/status/1846544708480168229"&gt;Charlie Marsh&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/testing"&gt;testing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/markdown"&gt;markdown&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rust"&gt;rust&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/pytest"&gt;pytest&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ruff"&gt;ruff&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/uv"&gt;uv&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/astral"&gt;astral&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/donald-knuth"&gt;donald-knuth&lt;/a&gt;&lt;/p&gt;



</summary><category term="python"/><category term="testing"/><category term="markdown"/><category term="rust"/><category term="pytest"/><category term="ruff"/><category term="uv"/><category term="astral"/><category term="donald-knuth"/></entry><entry><title>UV — I am (somewhat) sold</title><link href="https://simonwillison.net/2024/Sep/15/uv-i-am-somewhat-sold/#atom-tag" rel="alternate"/><published>2024-09-15T14:54:04+00:00</published><updated>2024-09-15T14:54:04+00:00</updated><id>https://simonwillison.net/2024/Sep/15/uv-i-am-somewhat-sold/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://andrich.me/2024/09/uv-i-am-somewhat-sold/"&gt;UV — I am (somewhat) sold&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Oliver Andrich's detailed notes on adopting &lt;code&gt;uv&lt;/code&gt;. Oliver has some pretty specific requirements:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I need to have various Python versions installed locally to test my work and my personal projects. Ranging from Python 3.8 to 3.13. [...] I also require decent dependency management in my projects that goes beyond manually editing a &lt;code&gt;pyproject.toml&lt;/code&gt; file. Likewise, I am way too accustomed to &lt;code&gt;poetry add ...&lt;/code&gt;. And I run a number of Python-based tools --- &lt;a href="https://pypi.org/project/djhtml/"&gt;djhtml&lt;/a&gt;, &lt;a href="https://pypi.org/project/poetry/"&gt;poetry&lt;/a&gt;, &lt;a href="https://pypi.org/project/ipython/"&gt;ipython&lt;/a&gt;, &lt;a href="https://pypi.org/project/llm/"&gt;llm&lt;/a&gt;, &lt;a href="https://pypi.org/project/mkdocs/"&gt;mkdocs&lt;/a&gt;, &lt;a href="https://pypi.org/project/pre-commit/"&gt;pre-commit&lt;/a&gt;, &lt;a href="https://pypi.org/project/tox/"&gt;tox&lt;/a&gt;, ...&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;He's braver than I am!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I started by removing all Python installations, pyenv, pipx and Homebrew from my machine. Rendering me unable to do my work. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here's a neat trick: first install a specific Python version with &lt;code&gt;uv&lt;/code&gt; like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uv python install 3.11
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then create an alias to run it like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;alias python3.11 'uv run --python=3.11 python3'
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And install standalone tools with optional extra dependencies like this (a replacement for &lt;code&gt;pipx&lt;/code&gt; and &lt;code&gt;pipx inject&lt;/code&gt;):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uv tool install --python=3.12 --with mkdocs-material mkdocs
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Oliver also links to Anže Pečar's handy guide on using &lt;a href="https://blog.pecar.me/uv-with-django"&gt;UV with Django&lt;/a&gt;.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://mastodon.social/@webology/113142102296895914"&gt;Jeff Triplett&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/packaging"&gt;packaging&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/uv"&gt;uv&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/astral"&gt;astral&lt;/a&gt;&lt;/p&gt;



</summary><category term="django"/><category term="packaging"/><category term="python"/><category term="uv"/><category term="astral"/></entry><entry><title>uv under discussion on Mastodon</title><link href="https://simonwillison.net/2024/Sep/8/uv-under-discussion-on-mastodon/#atom-tag" rel="alternate"/><published>2024-09-08T16:23:31+00:00</published><updated>2024-09-08T16:23:31+00:00</updated><id>https://simonwillison.net/2024/Sep/8/uv-under-discussion-on-mastodon/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://social.jacobian.org/@jacob/113091418140504394"&gt;uv under discussion on Mastodon&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Jacob Kaplan-Moss kicked off this fascinating conversation about &lt;a href="https://docs.astral.sh/uv/"&gt;uv&lt;/a&gt; on Mastodon recently. It's worth reading the whole thing, which includes input from a whole range of influential Python community members such as Jeff Triplett, Glyph Lefkowitz, Russell Keith-Magee, Seth Michael Larson, Hynek Schlawack, James Bennett and others. (Mastodon is a pretty great place for keeping up with the Python community these days.)&lt;/p&gt;
&lt;p&gt;The key theme of the conversation is that, while &lt;code&gt;uv&lt;/code&gt; represents a huge set of potential improvements to the Python ecosystem, it comes with additional risks due its attachment to a VC-backed company - and its reliance on Rust rather than Python.&lt;/p&gt;
&lt;p&gt;Here are a few comments that stood out to me.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cloudisland.nz/@freakboy3742/113093889194737339"&gt;Russell&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;As enthusiastic as I am about the direction uv is going, I &lt;em&gt;haven't&lt;/em&gt; adopted them anywhere - because I want very much to understand Astral’s intended business model before I hook my wagon to their tools. It's definitely not clear to me how they're going to stay liquid once the VC money runs out. They could get me onboard in a hot second if they published a "This is what we're planning to charge for" blog post.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="https://mastodon.social/@hynek/113094437303343866"&gt;Hynek&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;As much as I hate VC, [...] FOSS projects flame out all the time too. If Frost loses interest, there’s no PDM anymore. Same for Ofek and Hatch(ling).&lt;/p&gt;
&lt;p&gt;I fully expect Astral to flame out and us having to fork/take over—it’s the circle of FOSS. To me uv looks like a genius sting to trick VCs into paying to fix packaging. We’ll be better off either way.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="https://mastodon.social/@glyph/113094489295782200"&gt;Glyph&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Even in the best case, Rust is more expensive and difficult to maintain, not to mention "non-native" to the average customer here. [...] And the difficulty with VC money here is that it can burn out &lt;em&gt;all&lt;/em&gt; the other projects in the ecosystem simultaneously, creating a risk of monoculture, where previously, I think we can say that "monoculture" was the &lt;em&gt;least&lt;/em&gt; of Python's packaging concerns.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="https://mastodon.social/@hynek/113094547139925962"&gt;Hynek on Rust&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I don’t think y’all quite grok what uv makes so special due to your seniority. The speed is really cool, but the reason Rust is elemental is that it’s one compiled blob that can be used to bootstrap and maintain a Python development. A blob that will never break because someone upgraded Homebrew, ran pip install or any other creative way people found to fuck up their installations. Python has shown to be a terrible tech to maintain Python.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="https://social.coop/@chrisjrn/113094511860843571"&gt;Christopher Neugebauer&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Just dropping in here to say that corporate capture of the Python ecosystem is the #1 keeps-me-up-at-night subject in my community work, so I watch Astral with interest, even if I'm not yet too worried.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I'm reminded of &lt;a href="https://lucumr.pocoo.org/2024/8/21/harvest-season/"&gt;this note from Armin Ronacher&lt;/a&gt;, who created Rye and later donated it to uv maintainers Astral:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;However having seen the code and what uv is doing, even in the worst possible future this is a very forkable and maintainable thing. I believe that even in case Astral shuts down or were to do something incredibly dodgy licensing wise, the community would be better off than before uv existed.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I'm currently inclined to agree with Armin and Hynek: while the risk of corporate capture for a crucial aspect of the Python packaging and onboarding ecosystem is a legitimate concern, the amount of progress that has been made here in a relatively short time combined with the open license and quality of the underlying code keeps me optimistic that &lt;code&gt;uv&lt;/code&gt; will be a net positive for Python overall.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: &lt;code&gt;uv&lt;/code&gt; creator Charlie Marsh &lt;a href="https://hachyderm.io/@charliermarsh/113103564055291456"&gt;joined the conversation&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I don't want to charge people money to use our tools, and I don't want to create an incentive structure whereby our open source offerings are competing with any commercial offerings (which is what you see with a lost of hosted-open-source-SaaS business models).&lt;/p&gt;
&lt;p&gt;What I want to do is build software that vertically integrates with our open source tools, and sell that software to companies that are already using Ruff, uv, etc. Alternatives to things that companies already pay for today.&lt;/p&gt;
&lt;p&gt;An example of what this might look like (we may not do this, but it's helpful to have a concrete example of the strategy) would be something like an enterprise-focused private package registry. A lot of big companies use uv. We spend time talking to them. They all spend money on private package registries, and have issues with them. We could build a private registry that integrates well with uv, and sell it to those companies. [...]&lt;/p&gt;
&lt;p&gt;But the core of what I want to do is this: build great tools, hopefully people like them, hopefully they grow, hopefully companies adopt them; then sell software to those companies that represents the natural next thing they need when building with Python. Hopefully we can build something better than the alternatives by playing well with our OSS, and hopefully we are the natural choice if they're already using our OSS.&lt;/p&gt;
&lt;/blockquote&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/armin-ronacher"&gt;armin-ronacher&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/jacob-kaplan-moss"&gt;jacob-kaplan-moss&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/open-source"&gt;open-source&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/packaging"&gt;packaging&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/russell-keith-magee"&gt;russell-keith-magee&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rust"&gt;rust&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hynek-schlawack"&gt;hynek-schlawack&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mastodon"&gt;mastodon&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/glyph"&gt;glyph&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/uv"&gt;uv&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/astral"&gt;astral&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/charlie-marsh"&gt;charlie-marsh&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/seth-michael-larson"&gt;seth-michael-larson&lt;/a&gt;&lt;/p&gt;



</summary><category term="armin-ronacher"/><category term="jacob-kaplan-moss"/><category term="open-source"/><category term="packaging"/><category term="python"/><category term="russell-keith-magee"/><category term="rust"/><category term="hynek-schlawack"/><category term="mastodon"/><category term="glyph"/><category term="uv"/><category term="astral"/><category term="charlie-marsh"/><category term="seth-michael-larson"/></entry><entry><title>Quoting Armin Ronacher</title><link href="https://simonwillison.net/2024/Aug/21/armin-ronacher/#atom-tag" rel="alternate"/><published>2024-08-21T12:08:15+00:00</published><updated>2024-08-21T12:08:15+00:00</updated><id>https://simonwillison.net/2024/Aug/21/armin-ronacher/#atom-tag</id><summary type="html">
    &lt;blockquote cite="https://lucumr.pocoo.org/2024/8/21/harvest-season/"&gt;&lt;p&gt;There is an elephant in the room which is that Astral is a VC funded company. What does that mean for the future of these tools? Here is my take on this: for the community having someone pour money into it can create some challenges. For the PSF and the core Python project this is something that should be considered. However having seen the code and what uv is doing, even in the worst possible future this is a very forkable and maintainable thing. I believe that even in case Astral shuts down or were to do something incredibly dodgy licensing wise, the community would be better off than before uv existed.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="https://lucumr.pocoo.org/2024/8/21/harvest-season/"&gt;Armin Ronacher&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/armin-ronacher"&gt;armin-ronacher&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/open-source"&gt;open-source&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rye"&gt;rye&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/uv"&gt;uv&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/astral"&gt;astral&lt;/a&gt;&lt;/p&gt;



</summary><category term="armin-ronacher"/><category term="open-source"/><category term="python"/><category term="rye"/><category term="uv"/><category term="astral"/></entry><entry><title>uv: Unified Python packaging</title><link href="https://simonwillison.net/2024/Aug/20/uv-unified-python-packaging/#atom-tag" rel="alternate"/><published>2024-08-20T22:45:16+00:00</published><updated>2024-08-20T22:45:16+00:00</updated><id>https://simonwillison.net/2024/Aug/20/uv-unified-python-packaging/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://astral.sh/blog/uv-unified-python-packaging"&gt;uv: Unified Python packaging&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Huge new release from the Astral team today. &lt;a href="https://github.com/astral-sh/uv/releases/tag/0.3.0"&gt;uv 0.3.0&lt;/a&gt; adds a bewildering array of new features, as part of their attempt to build "Cargo, for Python".&lt;/p&gt;
&lt;p&gt;It's going to take a while to fully absorb all of this. Some of the key new features are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;uv tool run cowsay&lt;/code&gt;, aliased to &lt;code&gt;uvx cowsay&lt;/code&gt; - a &lt;a href="https://github.com/pypa/pipx"&gt;pipx&lt;/a&gt; alternative that runs a tool in its own dedicated virtual environment (tucked away in &lt;code&gt;~/Library/Caches/uv&lt;/code&gt;), installing it if it's not present. It has a neat &lt;code&gt;--with&lt;/code&gt; option for installing extras - I tried that just now with &lt;code&gt;uvx --with datasette-cluster-map datasette&lt;/code&gt; and it ran Datasette with the &lt;code&gt;datasette-cluster-map&lt;/code&gt; plugin installed.&lt;/li&gt;
&lt;li&gt;Project management, as an alternative to tools like &lt;a href="https://python-poetry.org/"&gt;Poetry&lt;/a&gt; and &lt;a href="https://pdm-project.org/en/latest/"&gt;PDM&lt;/a&gt;. &lt;code&gt;uv init&lt;/code&gt; creates a &lt;code&gt;pyproject.toml&lt;/code&gt; file in the current directory, &lt;code&gt;uv add sqlite-utils&lt;/code&gt; then creates and activates a &lt;code&gt;.venv&lt;/code&gt; virtual environment, adds the package to that &lt;code&gt;pyproject.toml&lt;/code&gt; and adds all of its dependencies to a new &lt;code&gt;uv.lock&lt;/code&gt; file (&lt;a href="https://gist.github.com/simonw/e309647b7d5380c7c7e5864d567f697b"&gt;like this one&lt;/a&gt;). That &lt;code&gt;uv.lock&lt;/code&gt; is described as &lt;a href="https://docs.astral.sh/uv/concepts/projects/#lockfile"&gt;a universal or cross-platform lockfile&lt;/a&gt; that can support locking dependencies for multiple platforms.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.astral.sh/uv/guides/scripts/"&gt;Single-file script execution&lt;/a&gt; using &lt;code&gt;uv run myscript.py&lt;/code&gt;, where those scripts can define their own dependencies using &lt;a href="https://peps.python.org/pep-0723/"&gt;PEP 723 inline metadata&lt;/a&gt;. These dependencies are listed in a specially formatted comment and will be installed into a virtual environment before the script is executed.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.astral.sh/uv/concepts/python-versions/"&gt;Python version management&lt;/a&gt; similar to &lt;a href="https://docs.astral.sh/uv/concepts/python-versions/"&gt;pyenv&lt;/a&gt;. The new &lt;code&gt;uv python list&lt;/code&gt; command lists all Python versions available on your system (including detecting various system and Homebrew installations), and &lt;code&gt;uv python install 3.13&lt;/code&gt; can then install a uv-managed Python using  Gregory Szorc's invaluable &lt;a href="https://github.com/indygreg/python-build-standalone"&gt;python-build-standalone&lt;/a&gt; releases.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It's all accompanied by &lt;a href="https://docs.astral.sh/uv/"&gt;new and very thorough documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The paint isn't even dry on this stuff - it's only been out for a few hours - but this feels &lt;em&gt;very&lt;/em&gt; promising to me. The idea that you can install &lt;code&gt;uv&lt;/code&gt; (a single Rust binary) and then start running all of these commands to manage Python installations and their dependencies is very appealing.&lt;/p&gt;
&lt;p&gt;If you’re wondering about the relationship between this and Rye - another project that Astral adopted solving a subset of these problems - &lt;a href="https://github.com/astral-sh/rye/discussions/1342"&gt;this forum thread&lt;/a&gt; clarifies that they intend to continue maintaining Rye but are eager for &lt;code&gt;uv&lt;/code&gt; to work as a full replacement.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/charliermarsh/status/1825958674239803515"&gt;@charliermarsh&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/packaging"&gt;packaging&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rust"&gt;rust&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rye"&gt;rye&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/uv"&gt;uv&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/astral"&gt;astral&lt;/a&gt;&lt;/p&gt;



</summary><category term="packaging"/><category term="python"/><category term="rust"/><category term="rye"/><category term="uv"/><category term="astral"/></entry><entry><title>uv pip install --exclude-newer example</title><link href="https://simonwillison.net/2024/May/10/uv-pip-install-exclude-newer/#atom-tag" rel="alternate"/><published>2024-05-10T16:35:40+00:00</published><updated>2024-05-10T16:35:40+00:00</updated><id>https://simonwillison.net/2024/May/10/uv-pip-install-exclude-newer/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/hauntsaninja/typing_extensions/blob/f694a4e2effdd2179f76e886498ffd3446e96b0b/.github/workflows/third_party.yml#L111"&gt;uv pip install --exclude-newer example&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
A neat new feature of the &lt;code&gt;uv pip install&lt;/code&gt; command is the &lt;code&gt;--exclude-newer&lt;/code&gt; option, which can be used to avoid installing any package versions released after the specified date.&lt;/p&gt;
&lt;p&gt;Here's a clever example of that in use from the &lt;code&gt;typing_extensions&lt;/code&gt; packages CI tests that run against some downstream packages:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;uv pip install --system -r test-requirements.txt --exclude-newer $(git show -s --date=format:'%Y-%m-%dT%H:%M:%SZ' --format=%cd HEAD)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;They use &lt;code&gt;git show&lt;/code&gt; to get the date of the most recent commit (&lt;code&gt;%cd&lt;/code&gt; means commit date) formatted as an ISO timestamp, then pass that to &lt;code&gt;--exclude-newer&lt;/code&gt;.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/hauntsaninja/status/1788848732437713171"&gt;@hauntsaninja&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/git"&gt;git&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/pip"&gt;pip&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/uv"&gt;uv&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/astral"&gt;astral&lt;/a&gt;&lt;/p&gt;



</summary><category term="git"/><category term="pip"/><category term="python"/><category term="uv"/><category term="astral"/></entry><entry><title>Ruff v0.4.0: a hand-written recursive descent parser for Python</title><link href="https://simonwillison.net/2024/Apr/19/ruff-v040/#atom-tag" rel="alternate"/><published>2024-04-19T05:00:26+00:00</published><updated>2024-04-19T05:00:26+00:00</updated><id>https://simonwillison.net/2024/Apr/19/ruff-v040/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://astral.sh/blog/ruff-v0.4.0"&gt;Ruff v0.4.0: a hand-written recursive descent parser for Python&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
The latest release of Ruff—a Python linter and formatter, written in Rust—includes a complete rewrite of the core parser. Previously Ruff used a parser borrowed from RustPython, generated using the LALRPOP parser generator. Victor Hugo Gomes contributed a new parser written from scratch, which provided a 2x speedup and also added error recovery, allowing parsing of invalid Python—super-useful for a linter.&lt;/p&gt;

&lt;p&gt;I tried Ruff 0.4.0 just now against Datasette—a reasonably large Python project—and it ran in less than 1/10th of a second. This thing is Fast.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/compilers"&gt;compilers&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rust"&gt;rust&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ruff"&gt;ruff&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/astral"&gt;astral&lt;/a&gt;&lt;/p&gt;



</summary><category term="compilers"/><category term="python"/><category term="rust"/><category term="ruff"/><category term="astral"/></entry><entry><title>uv: Python packaging in Rust</title><link href="https://simonwillison.net/2024/Feb/15/uv-python-packaging-in-rust/#atom-tag" rel="alternate"/><published>2024-02-15T19:57:13+00:00</published><updated>2024-02-15T19:57:13+00:00</updated><id>https://simonwillison.net/2024/Feb/15/uv-python-packaging-in-rust/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://astral.sh/blog/uv"&gt;uv: Python packaging in Rust&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
"uv is an extremely fast Python package installer and resolver, written in Rust, and designed as a drop-in replacement for pip and pip-tools workflows."&lt;/p&gt;
&lt;p&gt;From Charlie Marsh and Astral, the team behind &lt;a href="https://github.com/astral-sh/ruff"&gt;Ruff&lt;/a&gt;, who describe it as a milestone in their pursuit of a "Cargo for Python".&lt;/p&gt;
&lt;p&gt;Also in this announcement: Astral are taking over stewardship of Armin Ronacher's Rye packaging tool, another Rust project.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;uv&lt;/code&gt; is reported to be 8-10x faster than regular &lt;code&gt;pip&lt;/code&gt;, increasing to 80-115x faster with a warm global module cache thanks to copy-on-write and hard links on supported filesystems - which saves on disk space too.&lt;/p&gt;
&lt;p&gt;It also has a &lt;code&gt;--resolution=lowest&lt;/code&gt; option for installing the lowest available version of dependencies - extremely useful for testing, I've been wanting this for my own projects for a while.&lt;/p&gt;
&lt;p&gt;Also included: &lt;code&gt;uv venv&lt;/code&gt; - a fast tool for creating new virtual environments with no dependency on Python itself.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/charliermarsh/status/1758216803275149389"&gt;@charliermarsh&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/armin-ronacher"&gt;armin-ronacher&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/pip"&gt;pip&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rust"&gt;rust&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rye"&gt;rye&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ruff"&gt;ruff&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/uv"&gt;uv&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/astral"&gt;astral&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/charlie-marsh"&gt;charlie-marsh&lt;/a&gt;&lt;/p&gt;



</summary><category term="armin-ronacher"/><category term="pip"/><category term="python"/><category term="rust"/><category term="rye"/><category term="ruff"/><category term="uv"/><category term="astral"/><category term="charlie-marsh"/></entry></feed>