Have you ever waited around for pip to do its thing while installing packages or syncing virtual environments,
or even through some higher-level tools such as pip-tools?
Then you'll be very excited to hear about what just got announced from Astral,
a PIP-compatible CLI tool called UV.
It's like PIP, but 100 times faster.
Charlie Marsh from Rough Fame and the founder of Astral is here to dive in.
Let's go.
This is Talk Python To Me, episode 453, recorded March 12, 2024.
Welcome to Talk Python To Me, a weekly podcast on Python.
This is your host, Michael Kennedy.
Follow me on Mastodon, where I'm @mkennedy, and follow the podcast using @talkpython, both on fosstodon.org.
Keep up with the show and listen to over seven years of past episodes at talkpython.fm.
We've started streaming most of our episodes live on YouTube.
Subscribe to our YouTube channel over at talkpython.fm/youtube to get notified about upcoming shows and be part of that episode.
This episode is sponsored by Neo4j.
It's time to stop asking relational databases to do more than they were made for and simplify complex data models with graphs.
Check out the sample FastAPI project and see what Neo4j, a native graph database, can do for you.
Find out more at talkpython.fm/Neo4j.
And it's also brought to you by us over at Talk Python Training.
Did you know that we have over 250 hours of Python courses?
Yeah, that's right.
Check them out at talkpython.fm/courses.
Hey, y'all.
I have a quick announcement before we jump into the conversation with Charlie.
And sticking with the theme of the episode, I'll keep it quick.
Over at Talk Python, we just released a new free course.
It's all about working with audio in Python, converting it to text, applying all sorts of AI awesome sauce, and more.
We end up with a dynamic web app that lets you have a ChatGPT style Q&A with a podcast, guests, and hosts starting from just the RSS feed.
It's really mind-blowing.
As a sweet bonus, the course shows you a bunch of hands-on examples of FastAPI, HTMX, Beanie, MongoDB, and more.
I hope you love it.
Give it a look as it is 100% free, no strings attached.
The link is on the episode page, in your podcast player show notes, and at talkpython.fm/courses.
Hey, Charlie.
Hey.
Welcome.
Yeah, thanks so much for having me back on the show.
I really appreciate it.
Yes, it's really great to have you back on the show.
You and your team are doing awesome work these days and making a big dent in Python.
Thank you.
Hopefully a good dent, I guess.
Yeah, I guess you could make a good dent or a bad dent.
But no, I meant that in a good way.
Definitely in a good way.
I appreciate it.
Yeah.
Yeah, I think excellent work.
It's really, it's kind of surprising how some of these tools just come in and just catch fire in a way.
I don't know how you felt about it, but it seemed more than I would have expected.
I mean, I did not expect your things to be popular, but they became really popular really quickly.
Yeah.
I mean, it was different, you know, with Ruff and with UV, this sort of context around it has been pretty different.
Because with Ruff, like when I started working on Ruff, no one knew who I was or had any reason to care about what I was doing.
And the project just grew, you know, grew over time.
And then I knew that when we were working on UV, like there would just be a lot more of an expectation around like anything we build.
Yeah.
The spotlight was already shining, right?
A little bit.
Yeah.
And that's awesome because it means our stuff gets traction.
Also, it comes with a lot of responsibility.
It means anything we release, we're, you know, we're kind of committed to maintaining.
So, like, yeah.
Yeah.
It's been very interesting, like this kind of release cadence versus what happened with Ruff.
Well, you have more people behind the scenes helping you out, right?
I do.
Yeah.
Thankfully.
Yeah.
Tell us, you know, maybe that's a good place to just kick off our conversation is, you know, we're talking a bit about Ruff for everyone.
And Ruff was the thing that really launched all of this.
But you started a company, Astral.
Yep.
Got some funding behind it.
Yep.
Building awesome tools.
Yeah.
Just give people the broad view of your world these days.
Yeah, totally.
So, yeah, I started, this all started when I released Ruff probably like a year and a half ago, maybe at this point.
And at that point, it was really not just a side project for me, but very much an exploratory project.
Like I was kind of curious about building faster Python tooling, really, and curious about getting better at Rust and all this stuff.
And Ruff, when I released it, it's, you know, it was a lint or it is a linter, but it kind of brings a lot of different tools together.
So if you're familiar with like Flategate or Pylent, but also Black, Ruff is designed to kind of bundle all those tools together.
So it can detect problems with your code.
It can fix them automatically.
It can reformat your code.
So often when we see people like adopting Ruff, they're replacing like 20 or 30 tools with Ruff.
And, you know, it has, there's a bunch of nice things about it, but ultimately it's very, very fast and hopefully a lot simpler for users.
Yeah.
But, go ahead.
I was going to say, it's really nice that it's just one tool that brings that all together.
You know, it's not a patchwork.
Well, here's how we use ISORT and here's how we use Flategate and here's how we use this and here's how we use that, you know?
Right.
I think ISORT's a really good example because instead of having an ISORT's a great tool, but instead of having a separate tool to do your import sorting, Ruff Frames import sorting is just a lint rule.
And so you don't have to learn a bunch of different tools and figure out how to sort of merge them together.
And, you know, Ruff, again, when I released it, it was just a side project and it sort of took off.
You know, there were, it was originally, you know, I released it in part because I had this thesis that like Python tooling could be much faster and Ruff was meant to evidence that.
It was meant to be an example of what I saw as like this potential to build really different Python tooling.
And took off a couple of big projects like FastAPI and such were kind of early adopters and it just grew and grew and grew from there.
And I started a company, Astral, you know, shortly after based on a lot of these ideas.
So again, Ruff in this context was meant to be, you know, the goal wasn't necessarily to start a company just based around Ruff.
The goal was to start a company based around, you know, the ideas behind Ruff, which is, can we build really different Python tooling by, well, it's all written in Rust.
It's sort of an implementation detail, right?
But ultimately what we're trying to do is build like really high performance Python tooling, but also tooling that works together really well and simplifies things.
So tackle, it's not just about performance.
It's also about tackling a lot of, I guess, what I see as the complexity in Python tooling today.
And really trying to, I guess, challenge certain status quos and respect others, but challenge some status quos in what it feels like to work with and use Python.
And so, you know, our focus as a company, you know, right now we're very, very focused on our open source roadmap and our open source tooling.
So that's Ruff now, UV, which we'll talk about in a bit.
And these are, you know, MIT licensed, you know, fully open source tools that we build.
And ultimately our goal is to build and sell paid services that integrate really well with the tooling and are kind of like the natural next thing you need when you're building with Python.
So, you know, we'll never charge money for like the tools themselves.
Those remain free, permissively licensed.
But our goal is to kind of build, you know, imagine you're building with Python, you need to deploy a web server.
There's a lot of things that you need naturally to do that.
So for people who are already using our tools, what are the natural next things they need and how can we build really good services on top of the tooling that just integrate with it really well?
So that's kind of the premise of the company.
There's like really two focuses to the roadmap.
It's like the open source and the commercial.
And our goal is to have an incentive structure where we're just continuously aligned to like invest a ton in the open source and grow it as much as possible in a really natural way.
So you're not going to do like per line fix pricing.
You get a million, million line fixes a month free and then no, I think it's an awesome model.
And, you know, open source 10 years ago, it really looked like it was already super vibrant and super making huge dents in the space.
Right.
Really a lot of people adopting it.
But I think there was kind of a funding side that was a little bit missing.
I still remember like, you know, buy me a coffee type of links, like send me 10 bucks.
Yeah.
If you like this.
And that's just it's not a job.
That's hardly a hobby type of thing to get stuff done.
You can't have a team of people focused on it.
And it had traditionally really been around kind of a beneficial.
I need to find a big tech company that's willing to give me sufficient amount of time to work on this project.
To sort of fund its existence.
Or maybe I'm a consultant and I'm I create Flask, but I consult on Flask, that type of thing.
Right.
And I think it's just super positive to see more direct ways people are making open source successful.
You know, I think.
Yeah, I appreciate that.
I wish.
Yeah, I think.
You know, I wish I sort of wish that there were more more good examples of that working.
There are some for sure.
You know, for me, it was pretty clear.
Like it was immediately clear to me.
I needed to work on a rough full time if I wanted the project to succeed.
And that's kind of a microcosm of the bigger the bigger challenge, which is like we wanted to build like we really wanted to like professionalize the building of this.
You know, the work on this project and bring in more people to help build it.
And so, you know, ultimately, it's not obviously it's not it's not charity.
It is venture funding.
And ultimately, we need to build a business, you know, around the tooling to make it, you know, to make it sustainable.
But, you know, again, for me, I want the incentive structure to be such that like the open source is obviously free, open source, extremely permissively licensed and truly open source.
Like we have tons and tons of contributors.
We have a huge community around it.
And I'm just glad that we've been able to, you know, bring in more people to kind of supercharge the development of it all.
So, yeah.
So I guess you talked on you touched on this before, but we're now eight people.
So we've grown, you know, it was it was I guess a year ago it was just me in March.
So over the past year, our first two team members joined actually in March of last year.
So almost exactly a year.
And, yeah, we're completely distributed.
So we're, you know, we have people in U.S. Pacific time all the way to Bangalore.
So we're just, you know, around the like open source.
We're kind of all over the world and and just building, you know, building all this stuff out in the open.
It's such a good fit to be a distributed company as an open source with open source roots, because the tools of open source in some degree for software in general, but especially for open source is asynchronous.
Yeah.
Semi-connected, you know, kind of the zen of get, but for the way you work.
Right.
And it makes it super easy to hire just the most engaged people, regardless.
Yeah, exactly.
Yeah.
The people who are willing to commute to my office in the office park.
Yeah.
It was I would be pretty surprised if a single person I've hired would have been willing to move to New York, which is around based.
So from that perspective, it was a no brainer, which is and actually, you know, multiple people we've hired.
Our relationship with them started on the repo.
Yeah.
InRuff itself.
And then almost everyone we've hired, we discovered through open source in some way or had some relationship through open source in some way.
Yeah.
So, yeah, it's been a really it's very much in it's also very much in the DNA of the company, which is, you know, we actually also intentionally try to hire people who have been maintainers.
Right.
And have a lot of experience with that, too.
We view that as a really important skill.
Yeah, that's excellent.
So we talked about Ruff.
One thing I do want to give a bit of a shout out to is I don't remember.
I think I found this on Mastodon.
I can't remember where somebody talked about it.
But one of the things that Ruff does, one, it changes code, which is awesome.
I love your Ruff format story.
But it also just tells you, hey, this could be better.
You're violating PEP 8.
You're violating this other convention or even a security thing.
Right.
But the why is the why of that, I think, requires a little bit of experience.
Like, why should I use this kind of loop or that kind of comprehension over another?
Right.
It's people told me that who are much better have been doing this longer.
I shouldn't do it.
Why?
When you have when you have 700 rules, there's a lot of why.
And so you guys came up with this thing at docs.astral.sh slash rules, put in links that literally for each one of these has like a little example.
And what is good and what is bad and when you should use it and so on.
You want to tell people about this a bit?
I think it's a mess.
Yeah, totally.
So we didn't have, I mean, we obviously didn't have this when we started the project.
And then we accumulated a lot of rules.
Like, when we decided to add this, I think we already had like hundreds of rules.
And the motivation for the format really comes from Clippy, which is the linter used in Rust.
Okay.
And they have really, Rust in general has a really good documentation culture.
And Clippy has this nice format, very similar to ours.
We've made some adjustments, but it's pretty similar around how you document lint rules, like what's the motivation and giving examples.
And so we were like, all right, let's, we want to do this.
And we just over a very long period of time and a lot of contributors contributed on this documentation, but it took like six months or something probably to document it.
And now, yeah, now we can, now we require it for all rules.
So it's much easier to add going forward, but it was a huge effort to add this.
And, you know, some of the explanations too are very extensive and detailed with lots of references.
Yeah.
I pulled the one up for iSort, unsorted imports, which is error i001.
And it also talks about whether it can automatically fix it, what this does, why is it bad?
So it says things like consistency is good, use a common convention for imports to make your code more readable and idiomatic or Pythonic.
Yep.
And it just gives an example of bad, good.
Right, right.
I think that's nice.
Yeah.
And, you know, we've started to put more stuff in here over time too.
Like whether, like in some cases we let users apply automatic fixes that aren't completely safe, like by opting in.
Like it might change the meaning of your code and you kind of need to be careful.
And so over time we've started to document that here too, like rules that have unsafe fixes.
Why?
Like in what case might it break your code and what should you look out for?
So, yeah, we want it to be a tool with really good, like we're kind of inspired by Rust in this way.
Because Rust has a really good documentation culture and also the Rust like compiler itself has really good error messages.
It's sort of famous for that, like when your code doesn't work, it's really good at telling you why.
It doesn't always get it right, but it has famously good error messages.
And that's something that we try and channel too, to like when we make changes to configuration, like just putting extra effort into trying to make like those, those like error messages and those hints helpful.
But yeah, it's a lot of work.
So I appreciate you.
I appreciate that you called it out.
I'm sure it looks like a lot of work, but it's one of those things that's, where else are you going to get this knowledge, right?
I mean, I know you can go search for one at a time, but in this aggregates is really good.
Right, right, right.
This portion of Talk Python to Me is brought to you by Neo4j.
Do you know Neo4j?
Neo4j is a native graph database.
And if the slowest part of your data access patterns involves computing relationships,
why not use a database that stores those relationships directly in the database, unlike your typical relational one?
A graph database lets you model the data the way it looks in the real world, instead of forcing it into rows and columns.
It's time to stop asking a relational database to do more than they were made for and simplify complex data models with graphs.
If you haven't used a graph database before, you might be wondering about common use cases.
You know, what's it for?
Here are just a few.
Detecting fraud.
Enhancing AI.
Managing supply chains.
Gaining a 360-degree view of your data.
And anywhere else you have highly connected data.
To use Neo4j from Python, it's a simple pip install.
Neo4j.
And to help you get started, their docs include a sample web app demonstrating how to use it both from Flask and FastAPI.
Find it in their docs or search GitHub for Neo4j Movies Application Quick Start.
Developers are solving some of the world's biggest problems with graphs.
Now it's your turn.
Visit talkpython.fm/Neo4j to get started.
That's talkpython.fm/Neo4j.
Thank you to Neo4j for supporting Talk Python to me.
So Ruff will fix a lot of these things for you.
And one of the things that I like to do is I just have it integrated into my editor these days.
So both with PyCharm and with VS Code, if I just say format this document, that's a Ruff format.
Nice.
Yeah, yeah.
So we have a VS Code extension.
And it supports formatting, autofixing, all that kind of stuff.
The PyCharm one's a third-party one, right?
Someone else decided to make that.
Yeah, the JetBrains one is by Huda.
And it's, yeah, that's like a community extension.
We're considering doing our own at some point because there's a lot of demand for, obviously, we have a lot of users who use the JetBrains stuff.
I mean, I use it.
So we may do our own at some point, but there's a community-maintained one right now.
And that's based on, we have sort of like a language server.
So there's kind of like an underlying piece of technology that wraps rough, that powers all of these editor integrations.
So you can also use that from like NeoVim or Sublime Text or Emacs.
All of those editors support the LSP.
And so you can actually, it's the same thing that powers the VS Code extension.
Just that's wrapped in some VS Code specific stuff.
But it's the same piece of technology.
We're actually rewriting that right now to make it sort of like more natively integrated into Ruff, which will let us do some cool things.
So it should get like actually significantly better, I think, over the course of this year because it's becoming more and more of a priority for us.
Yeah, cool.
The whole LSP thing is pretty interesting.
I think it's really opened up a lot of editors being better.
Yeah, it has.
And it made it, like from our perspective, it made it way easier to build like editor integrations.
Because we just built an LSP and then it like works for like everyone, almost.
Yeah.
Like the JetBrains stuff, it does support the LSP, but I think only in the paid version, not in the community version.
So like there's some limitations around it.
But in general, like if you support the LSP, like it's actually very easy to build editor integrations that work with everyone, which is like super, super useful.
Yeah.
Instead of rebuilding your own integration for every single thing, which is not fun.
Yeah, it's a lot.
All right.
Well, let's talk about the main project here.
The main reason for being here today is UV.
Tell people what UV is.
This is your next big project, next big tool.
Yes.
Yeah.
UV, we released UV a little under a month ago.
And this is something that I've wanted to do, like basically since we started the company, I wanted to start, I thought there was an opportunity to build some really interesting tooling in Python packaging.
And UV is kind of the first milestone in that.
So UV, in its current form, it's designed as a sort of drop-in alternative to PIP, pip-tools, like if you use pip compile, pip sync, and virtualenv.
So it takes those three tools and tries to bundle them into one.
And so it can do things like, you know, given a set of input requirements, generate a requirements.txt file similar to what you'd get from pip compile.
It can, you know, you can do uvpip install-r requirements.txt, uvpip install black.
So it's really intended right now to be sort of, you know, it won't always, we don't support absolutely 100% of what pip does, but it's, we try to be pretty close.
And so in many cases, the intention is that people can basically drop in UV in their project that uses pip today and get, in many cases, like very, very significant performance improvements.
So similar to Ruff, like some of the goals we had for this project were one, it should be very, very fast.
And UV, it's really fast.
In particular, there's like a benchmarks.md in here, actually, if you want to click on that.
Now scroll up.
Does that do it?
Oh yeah, that works too, I guess.
That was smart of me.
Yeah, so it's really, really fast, especially if you've already have, if you're, if you have things cached, which is pretty common.
So like often on your machine, when you're doing like pip install-r, whatever, a lot of those packages, you've probably installed them at least like once before on your machine.
Or maybe you deleted your virtual environment and you're recreating it with the exact same dependencies or something like that.
UV is like very, very well optimized for that case.
So if you have a package that you're installing multiple times, like the installation is effectively free.
And it's also a lot more like disk space efficient.
We use kind of like, we store all of them in one place and kind of copy them into your virtual environment so that you don't have like many, many different copies of the package too.
So this was all kind of taking techniques and inspiration from like other ecosystems and other package managers and kind of molding them to fit Python's model for how packaging and dependencies work and all the specifications.
And so again, the end result is like you, you know, installing into a virtual environment, a package that you've already installed before is basically free.
And yeah, a lot of these things are just like way, way, way faster.
Similar to rough, like dramatically faster.
Yeah.
And similar to radically.
And I think, you know, it's worth pointing out that like on one hand, we all have an extra 10 seconds, right?
Or of course, whatever.
But in the aggregate, all of these things are just like little paper cuts over your day, you know?
And so, yeah, sure.
I can format the code and I could use something nice and sure if it takes 20 seconds.
Okay.
But then you stop running it because it's kind of a hassle and you're just, you're in your flow.
And this is kind of the same way.
It's like, oh, I want to maybe see if there's a new, some new packages for this project as I'm sitting down to work on it.
Like, okay, well, wait for a pip compile to run and you wait and you wait and then like, okay, now it's done the onto the development version and you wait and you wait.
And like, you know, it's just some of these things that are instant.
You just ask the question more and it just doesn't break your train of thought, you know?
Totally.
I think there's like maybe like three different things that come to mind here when we think about performance.
Because like, yeah, okay.
In this case, like it may not seem to change your life if you're going from one second to, you know, 50 milliseconds.
But I think three things come to mind.
So one, like for companies and large projects, this can actually be like a really big difference.
And so if you're at a company and you have like a big monorepo with like a bunch of different sub projects, they all have requirements files and you want to bump a dependency.
That can be like, at that point you're talking like 15 plus minutes for a command.
And so like for the larger the project gets, obviously the more performance matters and the more it helps out.
And we're trying to build tooling that can basically scale.
I don't know about like to arbitrarily large projects, but like two large projects and useful for companies too.
You know, the other thing I'd say is I think there's something that happens like when tools, when you make something like way faster, it just changes a lot of the ergonomics around what it's like to do things.
And so, you know, in this case, like, okay, so installing into a virtual environment, a package that you've already installed before is free now.
And so how does that change things?
It's nearly instant.
So how does that change things?
Right.
So that means like if you mess up your virtual environment and have to delete it and recreate it, it doesn't, it doesn't cost you anything.
It's totally, it's totally ephemeral.
You can throw it away and recreate it at any time.
And like, that's just like a different, like, it sounds small, but that's kind of like a different relationship to a virtual environments than before where it's like, okay, I created the virtual environment now.
Oh no, my virtual environment.
So I messed up.
I got to recreate it.
Like we want to just change a lot of the dynamics around some of those like abstractions.
And then the other thing is this performance budget or this, if you think of performance, like a budget, this buys us a lot of room.
And so like the fact that we are so fast on some of these things means that we can do things that otherwise might be like prohibitively slow.
And this is more sort of forward looking and for the future.
Like one thing that we're thinking about a lot right now is this idea of like resolving Python dependencies for many platforms because it's a little bit complicated, but you know, pip compile and pip and UV, they're really designed to only work on like the current Python platform and the current Python that you're using.
So if you're on like macOS and you run pip compile, it will give you dependencies that are correct for like macOS and your current Python version, but they might be wrong on Windows because Python and Python, you can have dependencies that vary based on things like the current Python version or the current operating system.
And so one example would be UV loop, right?
For people trying to speed up.
I think it doesn't work on Windows.
It doesn't work at all on Windows.
That's right.
And so, yeah.
So that's a very common one.
Yeah.
And it is, I think, very common that this is a very common thing, like on like lots of really, really popular packages have these kinds of markers, these what are called markers, which basically makes the dependencies conditional based on the current Python.
And so, you know, like again, like in pip and pip-tools, UV right now just locks for the current Python poetry and I think PDM, but poetry for sure does this very interesting thing where they actually try to lock.
They try to resolve for like all possible platforms.
And that's something, it's really convenient because it means that like you kind of do one lock and then any user anywhere can like use that and it works.
And it's kind of like guaranteed to be right as opposed to maybe it doesn't work on Windows or whatever else.
And so we're pretty interested in like that, adding that behavior and that's going to be like more expensive.
And so if we have something that's really fast right now, it kind of like opens up a design space of interesting things we can do to solve that problem while still being, you know, very fast.
So that's kind of how I think about performance.
Like I think it's, I think people like a little bit underrate how much of an impact it can have on even small interactions.
Because once you try something that's much faster, it's often hard to go back to the other thing.
But I'm glad you've had that experience at least.
Yeah, absolutely.
A couple of interesting comments.
Danny says, if it takes 10 seconds, I go to triage that issue on GitHub and come back five minutes later, right?
Like that's kind of where I was getting at with the flow stuff.
It's like, okay, I'm ready.
Mind wonders and you're kind of like starting over.
Yeah.
And then Henry out in the audience also says, hey, Henry.
Also, this doing things so quickly, it encourages good environment usage because if doing things the right way is just as easy and as fast as doing it the wrong way, you might as well do it the right way.
That's a nice thought.
Yeah.
It is.
Yeah.
I think there are certain things though where we aren't any faster.
And I'm interested in thinking about those and what we can do about them.
The most obvious one is in Python, sometimes when you install a dependency, you might have to build it from source.
And in Python, you often are installing things like NumPy, which includes some native code.
And so actually turning that into something that your system can run is kind of expensive.
And you typically don't have to think about this with NumPy because they ship what are called wheels, which are kind of like these pre-compiled artifacts.
But not all packages ship wheels.
You could be on a platform that doesn't have a wheel.
For a variety of reasons, you might get the raw NumPy source code and then have to compile it down into a build distribution.
And for us, if we get into that situation, it's not going to be any faster because we still have to build the thing from source.
Yeah.
Just like this.
That's the slowest part of the whole process.
Yeah.
And so there are some cases and some bottlenecks where I'm kind of thinking about how could we do even better there.
And there are actually things that are changing in the standards that have made this a little easier.
There's this new thing called metadata 2.2.
Sounds cool.
I know.
It basically lets you read the metadata.
You thought you liked metadata 2.1.
Yeah.
We're actually on 2.3 now.
I'm just kidding.
But the point of that is it's a standard that makes it so you don't have to build the thing as often.
If you just want to know the metadata of NumPy, for example, you may no longer need to build it.
And before you did.
And so the standards are moving in a helpful direction here.
But I just thought I'd call it out because like the source distribution, there are cases where it won't be faster.
And I'm pretty interested in those.
But people should know that they also exist.
There's also, it's not just time.
There's also security issues around that, right?
If things are still based on building source from source and then running the setup pie to see what the metadata is.
It's both slow and also potentially running arbitrary code just to install a thing, which can make you, I mean, I don't know.
Rarely has anything gone wrong with just installing running arbitrary code off the internet.
But sometimes it could go wrong.
Yeah.
It would be nice to get to a world where that's not required or at least for dependency resolution.
And like the standards are moving in that direction.
Yeah, exactly.
I mean, you might, if you're going to use it, you're going to have to get it.
But if you just want to know, well, what versions do I need to put these two things together?
You shouldn't have to do that.
Yeah, exactly.
Because today for NumPy, for example, if you didn't have a wheel, you would have to run some arbitrary code to ask it for its dependencies.
Yeah, exactly.
Well, let's talk about some of the usages here.
Let's see some more interesting comments in the chat.
I'll get back to them.
First of all, you know, is it like Highlander the movie?
Should there just be one?
Is UPy a thing that I put into, say, my requirements file if I want to use it?
Or do I install it just once for my machine?
Like, what's the scale?
UV.
So there's a lot of different ways.
You can, there's a lot of different ways to install it.
You definitely can install it into a virtual environment.
My general recommendation would be to install it on your machine once.
Because an interesting thing about UV is you don't need Python to install it.
And it doesn't have, you need to have Python on your machine.
Because we need to be able to, for example, build source distributions or know where to install the thing.
Right?
We have to install into a virtual environment somewhere.
And so you have to have Python installed on your machine.
But UV does not depend on Python.
So like it can install into arbitrary virtual environments or into arbitrary other Python interpreters.
So that's why we generally recommend using like these standalone installers that we have at the top of this snippet on the screen.
They're like the curl and the PowerShell invocations.
Those will install a single binary on your machine that's UV.
And from there, you can use UV to install into virtual environments that it creates, to install into your system Python, to do whatever.
So like I would say most people, based on the statistics, based on our download statistics, most people still install UV with PIP, which makes sense, which is not that surprising to me.
But I would generally recommend having like one UV install on your machine.
Although if you do install into a virtual environment, like that's also totally fine.
Like nothing's going to go wrong.
It's just not completely necessary because a single UV can already install into that virtual environment.
Right.
You're never going to import UV.
No.
I mean, you might, but in general, people are not going to.
I think you can.
I'm trying to think what would happen.
It's not like things like pie tests and other things.
A lot of times there could be just one of those, but then you want to use fixtures and you need to import something out.
So then it really needs to be in the virtual environment and accessible like a library.
But this is just something you run maybe even before your codes, before your virtual environment exists.
Right.
Like it is, it really kind of does ideally exist outside of it, I think.
Yeah.
Ideally it exists outside of it.
And there are some cases where you'd want to install it within the virtual environment, but ideally it exists outside of it.
The other thing that's nice about using the standalone installers, like at the top here, is soon we're going to ship like a self-update command.
So you can do like UV self-update and it will update UV to the latest version.
And we can't really support that if you install it with a different package manager, like pip or brew.
Those have their own upgrade commands, obviously.
But like if you install it with our installer, then like we can control the upgrades and stuff like that and provide some other features.
So that's generally what we recommend, but obviously we're always going to support like installing with pip and stuff too.
Yeah.
I'm all about pipX these days.
I really like...
Yeah, we're pipX.
That's mine.
Yeah, yeah.
PipX really, you know, you can just say, kind of like brew, you can say upgrade all my Python CLI tools.
PipX upgrade all.
Yeah, yeah.
Yeah, yeah, yeah.
I find rough and UV is just, you guys are moving super fast and there's frequently an update.
There are often updates, yeah.
Yeah.
Yeah, and then, you know, the UV interface, like it's meant to be pretty familiar to, or it's meant to be, I guess, hopefully very familiar to people who have used, who are already using pip and other tools.
And so like UVVM creates a virtual environment.
And then there's, we have this sort of pip subcommand.
So like UV pip install flask.
And that doesn't call or use pip in any way.
We're just using pip here to convey what the interface looks like.
And part of the motivation there is at some point in the future, we probably want to add a new interface to UV that's a little bit more high level.
So you could think of something like Poetry, where they have like Poetry install.
You know, they have this sort of higher level interface for interfacing with packages.
We want to do something like that.
And so that's why we left the top level of the interface clear, because we might kind of like integrate and, sorry, innovate and like ship a bunch of stuff that would otherwise break this interface.
So like, by putting this stuff under pip, we basically created this like isolated space where we can make sure that those commands like keep working no matter what we choose to change in the future.
And it's very similar to the pip's interface, right?
It's like pip install, then it could be a package name.
It could be a requirement, dash R requirements file.
We support editable installs.
We support like URL dependencies, get dependencies, all that kind of stuff.
Right.
All the stuff you might normally do pip install something for the most part, that's the same.
Yep.
Yeah, exactly.
And we support a lot of the same flags, too, that like pip supports.
So like --index URL, --extra index URL, like --no binary, like all that stuff.
Like we've put a lot of, we don't support every flag, but we've put a lot of effort into supporting a lot of them.
And we've added more over time.
Like now we support like --no build isolation and stuff like that, that maybe most listeners have never even had to look at.
But like, you know, these things matter in some circumstances.
And so like over time, our goal is to add like more of the interface.
But, you know, I would say for common use cases, I would expect that it just works.
Like just adding UV at front, like it should just work.
Now, as you become more complex, it won't.
And you'll run into some, we have a whole document of like subtle ways that we deviate.
Some are intentional.
Some I consider bugs, right?
Like some we want to fix over time.
But the intention is that for most people, we want it to just work.
Once we fix the first round of bugs following the release, of course.
Yeah, yeah, sure.
So you've got a uv venv VIMP, for creating a virtual environment.
And it has a lot of the flags that Python dash MVNV would have, where you can say, you know,
bring along pip or upgrade things or set the prompt name, that kind of stuff, right?
Yeah, exactly.
Yep.
Similar for UV, PIP, and then stuff.
What I find I do for most of my work, at least if I'm not trying to teach or do a presentation,
where people are like, what did you just do?
These all have kind of aliases, right?
Like UV, PIP, install, dash, R, requirements.txt is just PIR, pip install requirements.
You know, things like that, right?
Yeah, yeah, yeah.
And so try to just take the common stuff.
And it doesn't matter if it's pip or UV really backing it from my CLI ergonomics, right?
I'm just, I use my alias.
And if I want to change that, I just go and edit it.
And so for me, it was super easy to switch to adopt these things because I'm like, I edit
my ZSH RC file once and now everything just, I just do the same stuff and it works, but
the new way, way faster.
Yeah.
And, you know, the goal of like pip compatibility has been interesting because there are actually
like some things that we very intentionally want to do differently.
And like, I won't speak for the pip maintainers, but I think in some cases, there are probably
things that they would do differently too, if they could.
I think so too, yeah.
Yeah, because like PIP, I mean, pip is extremely important and its number one goal is like,
it needs to be like robust, right?
It needs to keep working and it needs to be compatible.
And because it's like, it's truly like the cornerstone of like a lot of the Python ecosystem.
And so PIP, it's very, it's harder for them to change things, especially in a breaking
way.
And they have to be really thoughtful and do that over a long period of time.
And so we're in kind of a privileged position, honestly, because we come in with a new tool.
We can actually do a bunch of, choose to do things differently.
And some people will get upset about it, obviously, because they're like, this isn't exactly how
PIP does it.
I'm trying to hold firm on some of those things and also be open-minded on others.
Right.
But like, you know, like one thing that we do that's different, that's, I guess maybe it's
not evident from this exact, from this screen exactly, or I guess it sort of is.
So when you do UVVM, we default to the name .vm.
So like, if you don't provide a name, we just default to .vm.
And there was a PEP to make that a standard that got pulled back.
But like, it's not like we're trying to make it a standard, but I just think it's a good
default.
Like we want to abstract away some of this stuff.
And so you can just like have a virtual, you can obviously pass a name if you want,
but we default to .vm.
That's different from other tools.
And then, you know, the other thing is when you do UVPIP install, by default, we require
a virtual environment.
And so if you do UVPIP install Flask and there's no virtual environment, like we'll throw, we'll
error.
And it doesn't have to be active.
We'll look for it in the current directory, even if it's not active.
So like if you do UVVM, then UVPIP install Flask, like it will work.
And in my opinion, it will do the intuitive thing, which is it will install into the environment
in the current directory.
So it's like, it's trying to provide...
It will traverse up.
Like if I'm a little farther down, it'll go up and say, oh, just, oh, that's amazing.
Exactly.
So it'll find the virtual environment in the current directory or any parent directory.
So like for me, that's just like a nice default workflow that encourages virtual environments
and like doesn't get in your way about it.
And we do have a flag for installing outside virtual environments, but the difference is in
UV, you have to opt in if you want to do something like install into the system Python.
It's a very virtual environment first while abstracting away a lot of the details of virtual environments.
So there are things like that where we've made intentional decisions.
In my opinion.
Yeah.
And I think, and it's nice because we can start with that behavior and we're in a privileged
position because we can start with different defaults.
Yeah, for sure.
So if I do, excuse me, if I do a UV, VNV for a virtual environment, then maybe I UV pip install
something, but then I forget and I pip install something else.
Does it break?
Is it okay?
As in the third time there's no UV?
Well, yeah, exactly.
Like, so I'm in UV pip install, something UV pip install that.
And I was, oh, I forgot this thing.
It was pip install.
Oh, I forgot the UV.
To this day.
No, it shouldn't.
It shouldn't break.
Assuming.
So let's say you activate the virtual environment.
Yeah.
It's already activated.
Okay, cool.
So you do UV VM, you activate the virtual environment, you do UV pip install flask, and then you
do pip install black or whatever.
Yeah.
Something, yeah.
That should work just fine because like the thing that we ultimately create in the virtual
environment, like that's all based on standards.
So like the stuff that we do in the virtual environment to install packages, it should look
like roughly indistinguishable from what pip would do.
And it's totally interoperable with pip.
So like similarly, if you did pip install and then like pip install flask and then UV pip
uninstall flask, like that would work correctly.
Like pip would install flask and we would remove it because everything that pip and UV are doing
in the virtual environment is based on standards.
So the way that we add and remove packages, all that kind of stuff, it should be totally interoperable
with other tools.
Okay, cool.
PyPI is pretty good at having analytics around what packages are being downloaded, what's popular,
what platforms.
Do you do anything like send a user agent or something so that people could answer the
question?
Or how many people are using straight pip and how many people are using UV in a year?
Yeah, we sent, we set a UV user agent and it's right now it's just UV in the UV version.
There's an open issue in the repo from Pradyan who works on pip that outlines all this stuff
that pip includes in its own user agent, which we want to add, which is pretty interesting.
I actually didn't know this.
So pip in its user agent includes a lot of things about the current Python platform.
Data that they use in PyPI basically to inform decisions.
Like, oh, no one's using Python.
Right.
This is just, I don't think this is actually how it's used, but just as an example.
Oh, no one's using Python 3.7 anymore.
Let's lower priority on that because no one's installing Python with Python 3.7.
And so we want to add, we don't have that right now.
We're planning to add it.
But yeah, it will be interesting to see.
We can get statistics over time too on like UV and pip and how common they are in different
dimensions.
Yeah.
You know, one thing that would be kind of fun to have is, I'm not sure if it's at all
interesting to you, but to have some kind of cron job or background thing, even if you
just interact with UV, if it kind of kicked off sort of a background process that did its
thing, but, you know, take the history of maybe the top 500 packages plus the ones you've
used and just kind of keep a cache up to date on your system.
So if you're on an airplane or you're in a coffee shop or for some reason, the internet's
not great.
Like it's kind of pre-filled the cache and everything's there.
Yeah.
And that kind of, that might be fun.
Yeah.
We do have a dash track offline flag, which will like, it forbids network requests, obviously,
but it, so like it'll, it'll try and do the full install without accessing the network.
Yeah.
That's cool.
It would be cool to pre-fill the cache.
Yeah.
But it's just like, you know, if you're a UV user and you sit down on your computer and
for some reason the internet's out, I'm at a conference, I'm doing a talk and it's got
the dreaded, terrible conference wifi.
It's not the end of your demo.
It's just like, yeah, see how fast this is?
It's amazing.
Yeah.
It was actually, it's actually funny because like the benchmarking, like when we do benchmarks,
benchmarks can just vary so dramatically based on like internet connectivity, right?
Like that's often, that is often the bottle.
I mean, it's not, it's clearly not always the bottleneck because we're able to be faster
than other tools.
So like if it was always the bottleneck, I don't think that wouldn't really be true, but, but,
but it matters a lot.
Yeah.
And so sometimes I'll throw on, on macOS, they have a tool called network link conditioner.
So you can actually force.
Like drag your network down.
Yeah.
You can force it down.
And the categories are like, it's not literally called like bad mobile phone or something,
but it's, that's like basically what it is.
Yeah.
It's like, it's like, it's like very lossy edge network.
Like those are like the pre-built category.
It's pretty funny, but like it is actually, that's a very helpful thing for benchmarking.
Yeah.
And sometimes actually, if you have a really good network connection, sometimes it's actually helpful
to, to set that anyway, to a pretty good level, because then at least it'll be like very consistent
across your executions.
Anyway, it's something I've learned over time.
Yeah.
That is super interesting.
So one of the things I think it's interesting to consider here is obviously this is way faster.
I saw some of the announcements and some of the discussion around the announcements and the
people were really surprised how fast this is.
And I think, I don't think Rust is the full answer.
I mean, you tell me if I'm wrong, but like one part, obviously making the code run ultra
fast, that is an important part of it.
But it also seems like you all have rethought some of the internal algorithms and some of
the caching and some of the ways things work, maybe with a fresh take on it, or you're not
constrained by the way it's been done for many, many years.
So what elements are at play to make it as fast as it is?
Is it just Rust or is it something else?
So Rust is important, but the way I typically talk about frame it is that Rust is kind of like an
enabler to writing really fast programs.
It forces you to slash lets you care about certain things that matter a lot for performance that like
in Python, there's actually just no way to care about them.
I'm talking specifically here about memory allocation.
Like in Python, that all just kind of happens.
In Rust, you're forced to think about, am I going to allocate memory here or not?
And like, when is it going to be deallocated and all that kind of stuff?
And so that unlocks the ability to care and like be really careful in how you manage it.
And so Rust is like a really important, Rust is an important part of the success story here.
But I think it's like really, I think it would be really like very incorrect to say that it's
like all about Rust and it's not a Rust versus Python thing.
Right.
Like if we could just recompile pip with.
Yeah.
So if you took.
If you took.
Cython or something.
Boom.
It would just be.
No, it wouldn't be as big of a deal.
Right.
If you took pip and just like rewrote it line by line as close as you could in Rust, like
it would probably be faster than pip, but it would not be nearly as fast as UV.
Like we just do a lot of things differently.
And part of like, I guess evidence for this too, is like throughout the development of UV,
there were like multiple pull requests that sped up like UV as a whole by like 30 to 50%.
So what does that say?
That says that like, there's lots of different, those were all Rust programs.
Right.
So like we were able to write the same Rust program many times, optimizing it more and
more and more.
Right.
And so there's like so much engineering that went into making it fast.
Some of it's like how the cache is designed.
That was like a really important piece.
And that's actually something that like pip could also do.
And I think like it's possible a good outcome here actually is that like pip is able to take
some of these changes and incorporate them over time.
And we are kind of the guinea pig for that.
Like we're going to kind of change user expectations a little bit about how the cache is set up.
Like we're going to run into bugs about platform compatibility.
Like we're going to run into bugs based on this cache design.
Right.
And like hopefully that could at some point help inform pip if they choose to redesign their
cache this way.
The cache design is really big thing.
And then just a lot of like profiling the program, figuring out what the bottleneck is, and then
like solving the bottleneck and just like really intense engineering work that was not me, but
was like other people on the team to optimize some of that.
Like a good example is it's like it sounds silly, but like we found that a bottleneck when
all the data is cached and you're trying to do a resolution.
So there's no network requests.
Everything's local.
One of the bottlenecks that we kept running into was parsing and comparing versions, version
specifiers.
So like in Python, when you have a requirements file, you have like FastAPI is greater than
version one or whatever.
And then in the FastAPI file, you have like FastAPI version 1.0.0, blah, blah, blah.
So like those, like parsing those, and then we were comparing those.
We were doing comparisons between version markers like so many times.
Because it was just a constant thing in dependency resolution.
It's like, can I use this dependency?
Well, does it fit to this range?
So Andrew Gallant from our team, like rewrote that parser and the version comparison specifier.
And it's like, it's like one of the most incredible pull requests I've ever seen.
Like it's like so, like every, every commitment is like so interesting.
And he like optimized it so massively that it was like, he's basically representing the version
in the end by like, like a 64 bit, like a U64 integer and comparisons is just like compare
the two integers.
And like, there was just so much engineering that went into it.
And it sped up the cache case by like 30%.
And so there's a lot of, there's just a lot of engineering that went into it.
And, you know, again, it's harder for pip to do some of those things because they, the code
bases, they have a lot, they have, they have actual users to support, right?
Like we were able to do this before we launched publicly.
Like we could break things, like we can do things, you know, we can make massive changes
to the code base in short periods of time.
So, you know, we're in kind of a privileged position to be able to really optimize the
performance like that.
But, you know, it's a big part culturally of what we wanted to do too, is like, we're going
to make this thing extremely fast.
Yeah.
I'm seeing also interesting secondary effects, you know, talks and not, not, I think that's
talks, talking about using it, making it faster.
Just now here, Henry says build 1.1 is faster from looking at UV and the next version will
also add UV as an installer choice, which is pretty impressive.
Yeah.
That's been a really cool, that's actually something I didn't really anticipate, but I'm
really glad has happened, which is that there's a little bit of like, we ended up building
something pretty modular.
And so there's been a little bit of a, or a lot of like integrations with UV that people
have been building.
Like, like, Bernard had the, had the talks UV thing that was out like within a week, I
think, which was like use UV to power talks in different ways.
Yeah.
Knox, I think supports it bill pipe a slash build.
You know, I've talked, I've talked to the hatch maintainer, you know, like he's pretty interested
in making UV like an optional backend for hatch.
So like that's really cool to me because it's all just like magnifying the impact.
Yeah.
And again, I don't know how much of that I anticipated, but it's really cool to see that
like you could plug it into these other tools and they can just like go much faster.
Yeah.
So I don't know.
I mean, that's been like, that's actually been like a big highlight from the release, honestly,
has been the reception from like other maintainers of other tools who have been excited to integrate
it in different ways.
Cause it's just not, it just didn't happen.
Like rough wasn't nearly as much of a fit for that kind of thing.
Like there just aren't as nearly, there are some, but it's just not as natural to have like
integrations with rough in that way.
But for UV, it makes a lot of sense and it's been really cool to see.
Yeah.
It's more, UV is more of a building block than rough is rough fits in editors and CI and
stuff.
Yeah.
Okay.
Yeah.
And there were, there were other tools, but yeah, it was, it's, it's mostly an end user thing
and not a library, I think.
All right.
So a couple of interesting things out in the audience.
Let's, let's knock them out.
Okay.
So Tushar asks, and this is, I think a big tension that's building in the Python packaging space
is packaging tools use Python to do stuff.
What are the packaging tools control the Python?
Who, who is controlling whom here?
And so Tushar asks, will UV also install Python sometime soon?
Can I just express, Hey, I want to use 312 on this and these dependencies.
Yeah.
We almost, we almost certainly want to do this.
Um, I don't think it will be, it won't be required.
Like you can still use your own Python, but we almost certainly want to add Python bootstrapping.
So like, that's another reason why the dream workflow is like you use the standalone UV installer,
because then it's like, it will actually install Python for you too.
And so like the reason, so then it's like, you don't have to have Python on your machine basically to start being productive with UV.
You can just bootstrap the environment for you.
And we can also do, you know, yeah, it would just be nice if you did, you know, pip compile, like UV pip compile, --Python 3.13 or something.
And then we just like bootstrapped Python 3.13 and did the resolution on your machine.
Like that's, that's kind of the workflow that we're trying to build towards.
Yeah.
Since you're so UV centric as well, it could be UV, V and V, you know, dash that version.
Yeah.
A hundred percent.
And then we bootstrap it.
Yeah.
If you don't have, if you've got a cache, you just give it.
And if you don't, then you, you get it on the machine.
Exactly.
Yeah.
So we'll definitely, we'll definitely do this.
Um, again, I do think it's important that it's not like required to use like the UV pythons.
Yeah.
Um, we actually kind of had to do like a minimal version of this for, for our CI and testing.
Um, so, but it was a bash script.
And then I think it became a Python script, but eventually it would be like built into UV.
Yeah.
I think that would be really.
Yeah.
I think it'll be super, really quite awesome.
Yeah.
I think it will be too.
Um, let's see.
Tushar also says loves that the --require V and V.
Yep.
As a thing.
Uh, he thinks it'll become the default and also points out for those who don't UV that
pip require virtual UV as an environment flag is in your RC files.
It's pretty nice.
I need to do that.
Yes.
The other day.
Yeah.
You can, you can.
Oh, I spelled that to the, to my, to the wrong spot.
Yeah.
So pip can be configured to require virtual ones.
Yes.
Yeah.
I do something weird.
I'm actually looking at my terminal behind our, our shared screen meeting here.
And my prompt says global V and V.
And so one of the things that I do is I have a, just, if I log it, if I open up my terminal,
it already has an activated virtual environment.
That's just for whatever.
Oh, interesting.
Just to avoid messing up your system Python.
Just to avoid messing up.
Or so I can have a, I can just make that virtual environment version of Python.
I want it to be, even if it's not the system one in general that I want to set, you know,
just like it's its own thing.
And so it wouldn't actually help me, but I still like that.
Cause that's smart.
Yeah.
That's smart.
Thanks.
Yeah.
I've learned a lot about like, oh my gosh.
I mean, I've learned a lot about packaging.
Like I didn't know like anything about packaging, you know, like six months ago.
I shouldn't, I should actually shouldn't admit that.
Cause it's really bad for my credibility, but like I've learned a lot about packaging.
And in the past, like two weeks, I've also learned a lot about like system pythons, like
how Python is installed and like how on like older versions of like Debian, like Python,
they do like a lot of customization to Python that makes it like really different from like
I learned like way more about this than I ever thought I would.
I think it's fine to say that.
I'm out on system pythons, but we do support them.
Yeah.
Awesome.
You know, someone asked me like, no, Michael, you must know all of the standard library.
I'm like, what are you crazy?
No.
Yeah.
Why don't I want to stop the standard library?
Yes, exactly.
And I think it's the same thing about packaging.
There's like so many edge cases.
If you never interact with an edge case and you don't care about that edge case, why would
you take the week or whatever to study it?
Like it's just, it's irrelevant to you until you need it.
And now you've dove in head first here.
So then you're in the deep end.
We spent so much time.
I shouldn't even bring this up, but we did.
Okay.
When we were, whatever.
I want to tell the whole story because I need to not, but like we did consider like lots
of different names for this tool and multiple times we considered a name and then it turned
out to be a standard library module that none of us had ever used.
Like we wanted to use wave W-A-V-E.
Okay.
But that's a standard library module.
Yeah.
I was like, oh, I had no idea.
Is that for working with a wave audio files?
Probably it is.
Yeah.
Like W-A-V files.
Yeah.
Interesting.
Yeah.
There's a bunch of stuff.
There's the whole dead batteries and removing certain things that like, you know, I know it's
like a library, but some of these things I had never seen.
Yeah.
Well, it's naming tools and packages is its own whole special deal.
And we have half a million packages in PyPI.
And so how are you going to not conflict with that?
Have an interesting name that's not for typo squatting.
Yeah.
Exactly.
Hard.
Yeah.
It's a hard problem.
Yeah.
I don't even get me started on the name stuff.
Someone actually donated this name to us, which is very kind of them.
Oh, that's actually very cool.
Very cool.
All right.
One other thing I do want to talk about here.
Padnish says, asks about, you know, is there a future where Rye, R-Y-E and UV go hand
in hand.
Also great work.
But maybe just talk a bit about Rye.
That was by Armin Roeniger.
And it kind of had a similar zen as UV, but really different.
Yeah.
So we, yeah.
So we're taking over like maintainership of Rye.
And we've just been like, I think I started talking to Armin like right after Rye got released,
which was PyCon last year.
I think it was during PyCon it got released.
And we talked like shortly after.
And we just found that like we were trying to do a lot of the, we were trying to solve a
lot of the same problems.
And we had like very similar vision for what we wanted packaging to be.
But like we were coming at it from very different angles.
Like Rye kind of came at it from, let's solve the Python bootstrapping problem.
So we're going to ship a Rust tool.
That seems like it's main focus.
Yeah.
Yeah, exactly.
And then internally it was actually using like pip-tools and pip to do installs and resolutions.
And then the thing that, I think the thing that Armin came to realize was like, if you want
to fulfill this whole vision, you kind of need to like reinvent a lot of those internals.
And meanwhile, like we were building UV, which was like basically those internals.
And I was like, we're going to put a lot of effort into like building this packaging stack.
And so we kind of found that like, it was just a really, we're trying to get to the same
place.
And we were putting in a lot of the engineering investment on building a lot of kind of building
blocks.
And we want UV to evolve into something that could like fully replace Rye.
So we want it to evolve in that direction.
And in the meantime, like we're going to keep maintaining Rye and kind of using it as like
a little bit of a test bed for like experimental things.
Like Armin added like pie test support to it, for example.
So we're like, we're kind of playing with like, you know, that's meant to be more of
an experimental test bed for like the future that we want to achieve.
And over time, we're going to kind of evolve UV up to the point that hopefully it can fully
replace it.
And then we can provide a clear migration path for it.
So we're going to keep maintaining it.
It is our intention for UV to like, to, you know, supplant it at some point in the future.
But it'll take us like time for it to get there and be able to do all the things.
But, but the visions were just so similar that it seemed like it made a lot of sense to
try and consolidate and kind of team up on it.
Yeah.
They do seem pretty similar.
And I can, I can see the direction that you're going in it.
It's going to make them more similar.
Yeah.
I know it'll take time.
And like, you know, this release of UV is like, it really is like the first release,
you know, it's like, like I kind of use some of this stuff as like pretty low level.
Like, like we want to build something that feels higher level and more, more automatic
in the future.
But this, these are kind of like the ability to install and uninstall and resolve packages.
These were like the fundamental things we needed and need for anything we were going to do.
And so this goal was really, let's take those and let's put them in a form that's like immediately
useful to people.
Yeah, for sure.
One more Rye question.
Then I have other questions.
So UV will replace Rye.
Do you recommend using Rye or UV or what's the, what's that side of the story, right?
Yeah.
It kind of depends on what you're doing.
So like, like Rye uses UV under the hood.
So like Rye uses UV for resolution and installation.
So if you're using Rye, you're using UV.
I, like I say, I consider UV to be like, especially if you're like a company or something, like I
would say UV is production ready for, for you.
Rye, you're buying into a little bit more of something that's a little bit more experimental.
Like I think Rye is a good fit for like professional projects, hobby projects, libraries, smaller
projects.
I don't know that I would like, you're just buying into more change, I think.
Yeah.
And so if you're already in a part of your monorepo, that's got a million lines of code
and a hundred people on it.
Yeah.
You can certainly, you can certainly try it, but you should know that you're buying into
something experimental is the way I'd put it.
Whereas UV, like you could also view UV as experimental if you want.
Like it's very new, right?
Like we've, we're like when we launched, we had, I mean, I think having issues is actually
good because it means people are using your project, but we had like hundreds of
issues.
And we closed and we closed, we've closed like hundreds and hundreds of issues since
we launched.
Yeah.
You guys have been super, yeah.
You've been super responsive on it.
Like we, you and I've had some exchanges there.
Yeah, we did.
And yeah.
Yeah.
That's some nice changes I saw going on, but like I said, almost every day.
It's getting like way better.
It's great.
Yeah.
And it's just getting way, way better.
Like that's the thing about developing in private is like, like we just, once we released
it, we finally, we actually had users who could use it and tell us all the things we missed,
also the things we didn't think about.
It's just like every week getting way better.
So like it's getting more and more stable.
And like, I would use it in production for my stuff for sure.
And I recommend it for production, but like Rye is just a little bit of a different story.
I think with Rye, you know, it's not like we're going to shut it down tomorrow or anything
like that.
Like it's going to be, it's going to continue to be supported for sure.
Um, but you are, and I think it's branded this way, which is you are kind of buying into
a little bit of an experimental tool.
Yeah.
Also a bit of a workflow.
Yeah.
It's a very opinionated workflow.
Yeah.
Whereas UVs were designed to kind of slot into existing workflows.
Sure.
It's a little more foundational.
Speaking of which, I really like that, you know, so many of these tools have their own,
their complete own way.
Like, I know you're going to do that, but we're going to start up our shell and then
you're going to run these three commands and then we're going to have our own lock file
and we're going to have our own things.
And it's, it's amazing if you drink the Kool-Aid, if you go all in on the tool, but if you don't,
then it's like, ah, okay, well, what is this thing even doing?
It's more in my way than it's helping me, you know?
And so on.
So the fact that a lot of, a lot of this is kind of baking in the pip-tools way of there's
going to be this external tool that can manage some of your stuff for you, but it's not
prescribing a workflow.
A hundred percent props for that.
Love it.
Thanks.
Yeah.
I wanted, like, I wanted to build something that, again, I use the word like modular a
lot and I think it can mean different things, but like rough was kind of like this too.
Like in rough, you can use it as like just a linter or like just a formatter or both.
And like with UV, like you could use UV, like just to create virtual environments or just
to do dependency resolution, but use pip for your installer or something.
Like it's designed to be kind of flexible in how you choose to use it.
And I want to, I want to maintain that.
You know, I think, I think we'll start to introduce more opinionated workflows, but I think that
we'll continue to provide this kind of pick and choose model as well.
Yeah.
I think it's great.
It lines right up with the way I do things.
And also I really like it as both someone who might do presentations either at a conference
or in a course or teaching because you're not putting, you know, the whole virtual environment
stuff is already such a kind of a large barrier that comes a little early in people's learning
path, right?
They're like, I want to run Python.
I want to run this thing.
Whoa, you don't just install this.
You don't just use it.
We're going to talk about virtual environments.
Like I don't care about those.
I just want to run it.
Like, but you're going to need to install something.
So here we go.
We're adding more workflow and more specific ways of working there.
I think while trying to help a lot of times they end up just adding more friction at the
start.
Yeah.
And like, I guess my philosophy there is like, I want us to, I want us to like embrace virtual
environments.
Actually, Rai has this philosophy too, which is like Rai does use virtual environments and
like virtual environments actually have a lot of, there's a lot of benefits to embracing
them.
Like all the editors and such, they're all built around virtual, they all are all built around
virtual environment detection and stuff like that.
But I wanted to feel, I want to feel a little, honestly, like it has a really bad reputation,
but I wanted to feel more like node modules, you know, where it's like, it just kind of
works in your, it just kind of sits in your project and your project just does the right
thing.
Um, and I know people make fun of node modules usually for being big.
Um, but like, but that's the developer experience I want, which is you don't think, you don't
think of the virtual environment as this weird other thing.
It's just kind of like the project environment and it just kind of works.
And I think, I think you've got that by not like fielding people from it, but abstracting
some of it away for people that don't need to think about it.
Yeah.
There was a, there was an amazing, it's not a joke, but it's, I guess something that's
a prank that somebody, came up with here.
I'll put it on the screen.
It's called when everything becomes too much, the NPM package chaos of 2024.
And I was just, as you were talking about node modules, it's amazing.
So it's more of a statement of like, well, how super interdependent or how many combinatorial
or transitive dependencies does a couple of NPM things have?
Like, for example, I used tailwind, but there was maybe 50 things in my, my node module for
just using tailwind in my project.
Right.
So anyway, this one is some, this, an NPM username, Patrick JS launched a troll campaign
where a package called everything, it depended on every other NPM package.
So if you, you know, NPM install everything that literally tried to download the repository.
That's kind of, that's kind of amazing.
Wow.
I know it's, it's devious, but it's also kind of like, okay, that's, that's something else.
Yeah.
And Python independency trees tend to be much,
like shorter, I guess, and like smaller, like you would tend to have way fewer dependencies.
Yeah.
Um, they are sometimes like heavier, I guess.
Cause like in Python, it's very common to have lots of native code.
Um, and like, I don't know, like PyTorch, like the PyTorch wheels that you download when
they're zipped are like between a hundred and 200 megabytes.
Wow.
Okay.
Yeah.
Like all the, all the ML stuff and all the native stuff, like those are like big, but,
but the dependent, but the number of dependencies tends to be a lot smaller.
Yeah.
I totally agree.
It's also very common to ship like foundational packages with like no dependencies or very few
dependencies, which is very hard to do in, in JavaScript.
Yeah, it is.
Um, it definitely is.
All right.
I think we're getting short on time here.
I think I probably should let you go back and knock out another release of UV.
I do have to do a release today.
Okay.
Thank you.
Awesome.
Cool.
So Tony, the audience has been using UV in production for a couple of weeks now.
Awesome.
Seems very excited about it.
And also I have two.
It's an absolute delight.
It hasn't.
Oh, thank you so much.
Yeah.
I know there's certain things that it didn't do like right away, but then it, it came
out and you added them quickly.
I know there was some criticism for y'all for developing this in private and then releasing
it.
And I just want to say like, you know, thanks for doing that.
And what's the alternative?
You start with just a blank GitHub repo and people start to say, well, you should do this.
You should be doing that.
Like we have a vision.
Let us just like get it a little structure in place and then we'll open source it.
Like give us a month, you know?
Yeah.
I don't know.
I think it's, I think it's excellent work you're doing.
I appreciate it.
Yeah.
You know, like I said at the start, it was different.
It's different this time because anything we release, like, you know, you could work
on a rough for a month and nobody cares until it starts to catch some traction.
Right.
But this is the instant that it hits.
Yeah.
We knew people would at least, would at least look at it and at least try it.
And I think, you know, we wanted to make sure that whatever we released, first of all
was good.
And second of all, that we were ready to maintain it.
And then I think with packaging too, it's like, there's just a lot of, it's just such
a complex space that like, I wanted to make sure that we had a lot of clarity in the messaging
around what the tool is and what it's not and like what we want it to be and what it isn't
yet.
And so I'm really happy with how the launch went and I've really appreciated just all
the excitement, activity, engagement that we've had on the repo.
It's been like, I don't know.
I mean, honestly, it's been a lot of work, but it's like really, really, no, but it's awesome.
It's like so energizing for me and for the team.
And to see all the people picking it up and making it the foundation of their projects.
And yeah, it's really cool.
Yeah.
And it's cool.
You know, I guess another, like one other thing that's a little different this time is
like, I talk, I just talked to more people who work on Python tooling at companies now than
I did when I released Ruff, just because over the course of the past year, I've just met
a lot of people and we've just talked about how they're using Ruff, how they're not.
And so just hearing some of those stories too, of how like companies are starting to use
it and like what the blockers are and like how much of a speed of it's providing has been
pretty cool to see too.
So yeah, I appreciate, I appreciate it though.
Yeah, you're welcome.
All right.
We'll leave with this final thought from Juan.
I installed 94 libraries in around two seconds.
Incredible.
That's great.
All right.
Yeah.
All right.
Well, I'm excited to see where things go and, you know, we'll maybe do a follow-up when,
when you've got some more, more of the ideas in place.
Sounds great.
No, it's always, it's always a pleasure.
Thanks so much for having me on.
I really appreciate it.
Yeah.
Thanks, Charlie.
This has been another episode of Talk Python to Me.
Thank you to our sponsors.
Be sure to check out what they're offering.
It really helps support the show.
It's time to stop asking relational databases to do more than they were made for and simplify
complex data models with graphs.
Check out the sample FastAPI project and see what Neo4j, a native graph database, can do
for you.
Find out more at talkpython.fm/neo4j.
Want to level up your Python?
We have one of the largest catalogs of Python video courses over at Talk Python.
Our content ranges from true beginners to deeply advanced topics like memory and async.
And best of all, there's not a subscription in sight.
Check it out for yourself at training.talkpython.fm.
Be sure to subscribe to the show.
Open your favorite podcast app and search for Python.
We should be right at the top.
You can also find the iTunes feed at /itunes, the Google Play feed at /play,
and the direct RSS feed at /rss on talkpython.fm.
We're live streaming most of our recordings these days.
If you want to be part of the show and have your comments featured on the air, be sure to
subscribe to our YouTube channel at talkpython.fm/youtube.
This is your host, Michael Kennedy.
Thanks so much for listening.
I really appreciate it.
Now get out there and write some Python code.
I'll see you next time.