Latest / Talk Python To Me / #476: Unified Python packaging with uv
Transcript
- 0:00A couple of weeks ago, Charlie Marsh and the folks at Astral made another big splash with
- 0:04a major release of uv called uv, Unified Python Packaging, which has many far-reaching features.
- 0:10We had to have Charlie on the show to give us an inside look into this development.
- 0:14Let's get to it.
- 0:16This is Talk Python To Me, episode 476, recorded September 3rd, 2024.
- 0:21Are you ready for your host, please?
- 0:24You're listening to Michael Kennedy on Talk Python To Me.
- 0:28Live from Portland, Oregon, and this segment was made with Python.
- 0:31Welcome to Talk Python To Me, a weekly podcast on Python.
- 0:37This is your host, Michael Kennedy.
- 0:39Follow me on Mastodon, where I'm @mkennedy, and follow the podcast using @talkpython,
- 0:45both accounts over at fosstodon.org, and keep up with the show and listen to over nine years
- 0:50of episodes at talkpython.fm.
- 0:53If you want to be part of our live episodes, you can find the live streams over on YouTube,
- 0:57subscribe to our YouTube channel over at talkpython.fm/youtube, and get notified about upcoming
- 1:03shows.
- 1:04This episode is sponsored by Posit Connect from the makers of Shiny.
- 1:08Publish, share, and deploy all of your data projects that you're creating using Python.
- 1:13Streamlit, Dash, Shiny, Bokeh, FastAPI, Flask, Quattro, Reports, Dashboards, and APIs.
- 1:19Posit Connect supports all of them.
- 1:21Try Posit Connect for free by going to talkpython.fm/posit, P-O-S-I-T.
- 1:28And it's also brought to you by us over at Talk Python Training.
- 1:32Did you know that we have over 250 hours of Python courses?
- 1:36Yeah, that's right.
- 1:37Check them out at talkpython.fm/courses.
- 1:40Charlie, welcome back to Talk Python To Me.
- 1:43How are you doing?
- 1:43I'm good.
- 1:44Thanks so much for having me back.
- 1:45It's always a pleasure to be on here.
- 1:47Well, you are certainly making waves in the Python space these days with all of your projects
- 1:53and their fastness.
- 1:54I think you're known as the fast Python guy these days.
- 1:58Oh, that's not fast enough.
- 1:59We got to use something from Astral.
- 2:01The fast Python tooling guy, maybe.
- 2:04Yeah.
- 2:04Yeah, exactly.
- 2:06Exactly.
- 2:06So interesting.
- 2:07You know, we spoke, I think you've been on twice before.
- 2:10Is that right?
- 2:11We talked about Ruff once.
- 2:12Came on once to talk about Ruff.
- 2:14And then I came on in March, shortly after we did the first public release of uv.
- 2:19Right, right.
- 2:20And uv at that time, I'll let you tell people what uv is.
- 2:24But for those who know, it was kind of in the, it has pip-like features.
- 2:29And now it's got another layer to the onion or another shell to it.
- 2:34And that's actually why I invited you back, because there's a lot of interesting things
- 2:38to talk about there.
- 2:39Yeah.
- 2:39Maybe like several more layers too.
- 2:41Okay, well.
- 2:42All right.
- 2:43So let's, yeah.
- 2:44Yeah.
- 2:45Let's hear about them.
- 2:46So first of all, I guess, you know, not everyone, believe it or not, not everyone listened to
- 2:52that first Ruff interview.
- 2:54Things, Ruff interview and those kinds of things.
- 2:58So I suppose maybe quick introductions to you, Astral.
- 3:04How'd you get to where you are?
- 3:05Yeah, yeah, yeah.
- 3:06So I've been working on Python tooling full-time for a little under two years at this point.
- 3:15And my journey, I've been writing Python professionally for a long time.
- 3:20But my journey with Python tooling started with Ruff, which is a very fast Python linter code formatter
- 3:28and code transformation tool.
- 3:30And what's the sort of foundational idea of Ruff was, can we make really fast Python tooling?
- 3:37And so Ruff is written in Rust, but you don't need to have Rust installed or know anything about Rust to use it.
- 3:44You can just install it with pip or with whatever you're using.
- 3:48And that whole sort of story for me started from just working with Python a lot and asking if we could build
- 3:55sort of different Python tooling by using languages like Rust.
- 4:00So, you know, the first version of Ruff was very minimal, but it's grown from then to have, I don't know,
- 4:06if something like 800 plus rules.
- 4:08If you've used tools like Playgate or PyLint in the past, Ruff can do similar things.
- 4:14So discover issues with your code without running it.
- 4:17It can also fix them automatically.
- 4:19And then if you've used tools like Black in the past for code formatting, Ruff can do a similar thing too,
- 4:25where it automatically formats your code.
- 4:27So that was how I first got started in Python tooling and also how I first ended up on Talk Python
- 4:32was people were very interested in this when it came out.
- 4:34And I think it broke a lot of people's minds in the sense that it really changed what was possible.
- 4:42You know, maybe an analogy.
- 4:44So if you have unit tests, but to run the unit test takes 30 minutes, there's no one who doesn't just want to kill time.
- 4:51Who's going to say, I made a small change.
- 4:53Well, let me run the test and see how that change did.
- 4:55But if the tests run in 50 milliseconds, you could just set up a thing to just run the test every time code changes
- 5:03and just have a green, red, white.
- 5:05And I feel like Ruff did that for linting and formatting.
- 5:09Like for me, for example, I have it just run Ruff on.
- 5:14If I use PyCharm, I ask PyCharm to reformat the code.
- 5:17It just uses Ruff to do that.
- 5:19And you can check the box to just say, run it when I hit save because you won't notice a difference.
- 5:22You know what I mean?
- 5:24Yeah, yeah.
- 5:24I think that's been one of the really interesting things about working on tooling with the focus on performance has been like,
- 5:31if you build things that are way, way faster than what currently exists, like not just like a little bit, but like significantly faster.
- 5:37The ergonomics of the tool just change a lot.
- 5:39So maybe things that you only ran in CI before, you can now run locally.
- 5:44And maybe things that you now run locally, you can run on save as opposed to on commit or on explicit command.
- 5:51So that's been a big part of what we've seen with Ruff.
- 5:55And the other big piece, apart from performance that I think we sort of accidentally made a lot of progress on with Ruff,
- 6:03was just trying to make things simpler by bundling more stuff together.
- 6:08So Ruff can do like a lot of different things.
- 6:11And so you don't need to chain together as many tools to get the kind of setup that you might want to have in your Python projects.
- 6:17And so a lot of the things we've built with Ruff and with uv, they've had these kind of dual goals of being much faster,
- 6:25hopefully bringing in some interesting new features and functionality,
- 6:29but also trying to reduce a little bit of the fragmentation and tooling and make it easier for people,
- 6:36especially, you know, for newcomers who are writing Python for the first time to kind of get started.
- 6:41And we have, well, you have announcements.
- 6:43I have things to discuss with you about them, about making that even easier.
- 6:47So that's why some of the big features of uv, right?
- 6:50For example, what if I don't have Python?
- 6:52Not a problem.
- 6:53So that's pretty, that's pretty exciting, I think.
- 6:55Yep.
- 6:56Yeah.
- 6:56And we'll get into that.
- 6:57But I do want to just take a, not get too far past it,
- 7:01because even though this episode is not about Ruff, two things.
- 7:05One, a theme of Astral's is we're going to take some tools or some kind of concept that's been around for a long time,
- 7:12redo it in Rust, but also not just, well, we ported over the code,
- 7:17but you know, rethink some of the algorithms and some of the assumptions.
- 7:19And I think that's also a lot of what makes it faster, like the way uv works with caching and things like that.
- 7:25Yep.
- 7:26And there's been a lot of excitement and positivity about that.
- 7:30But I think there's also been a little suspicion of, wait a minute, if we write this in Rust,
- 7:36is it really for Python people, by Python people?
- 7:39Like what's, what's your take?
- 7:41I don't, I have, I have some thoughts that are, I don't see it as a negative, but I think,
- 7:45I think it's interesting just to discuss, you know, where does Rust actually belong here?
- 7:50Yeah.
- 7:50I mean, I think like the way I view it is that, you know, just like Python itself is,
- 7:57is implemented in C, like it makes some sense for like the underlying tooling that people are using
- 8:03to be written in a different language.
- 8:05If it means that you can ultimately build, you know, tools that are better, you know,
- 8:10at least on, on some metrics that people care about.
- 8:13So like, for me, I sometimes view what we're doing as, you know, like we put all this investment
- 8:18into this tooling.
- 8:19We write all this stuff in Rust, which, you know, in theory, incurs some cost for us.
- 8:24It's maybe, you know, maybe we move a little bit more slowly, maybe it's harder.
- 8:28And in doing so, we kind of like give all these people who are running these commands,
- 8:33you know, hundreds of times a day, a big boost in how they work.
- 8:37And they can keep writing Python, but have a better and better experience writing Python.
- 8:41So, you know, I don't think it actually really says anything personally.
- 8:46I don't really think it says anything about Python that we write the tooling in Rust.
- 8:49Because, you know, we get, sometimes people will criticize Python for that, but like,
- 8:54you know, different languages are useful and good for different things.
- 8:57And Python is an incredibly productive language.
- 9:00It's like growing more and more every year.
- 9:02People love writing it.
- 9:03But maybe it's not the best language to write, you know, a super high performance package manager.
- 9:08And that's totally fine.
- 9:09Because like, we're going to do that.
- 9:11And then everyone who's writing Python can benefit from it and can leverage it.
- 9:15Yeah.
- 9:15I do think that one interesting piece here that I got, you know, we got a lot of skepticism
- 9:21around early on was like, you know, how can people in the Python community like contribute
- 9:26to this if it's not written in Python?
- 9:27You know, how do you like have a sustainable contributor base?
- 9:31And the interesting thing for me is like, I actually think we've had a really strong contributor
- 9:36base over time.
- 9:37Like we have, I don't know, like somewhere between four and 500 contributors total, maybe
- 9:42in Ruff.
- 9:42You know, most of those are like one or two small, you know, one or two commits, maybe
- 9:46just one or two time committers.
- 9:48You know, but a lot of people have come to Ruff and said, you know, I want to learn Rust.
- 9:52I come from the Python ecosystem.
- 9:53There's a part of this that's sort of native to what I know, which is the Python language,
- 9:57the Python semantics.
- 9:58And it's an entry point for me to learn Rust, you know, from other people who come from Python.
- 10:02So, you know, I think there is certainly a cost to engaging and a cost for contributors
- 10:07because most, you know, most of our users don't know Rust.
- 10:10But I don't think it's as steep as people would expect.
- 10:15And I think, you know, over time we have been able to grow a pretty, a pretty healthy contributor
- 10:21base, like many people who have never written Rust before.
- 10:23Yeah, I agree.
- 10:25And I was thinking the same thing that you pointed out that Python itself is written in
- 10:29C.
- 10:29Yeah.
- 10:30Right.
- 10:31Generally speaking, of course, there's multiple runtimes and so on and so on.
- 10:34But CPython, the one that we generally use is written in C.
- 10:38And I mean, I don't see why there should be an allegiance to C over Rust or anything.
- 10:43And a lot of the data science tools are written in C or Orttran even, you know, something really
- 10:49wild like that.
- 10:50And Python is a way to kind of expose them and make them more accessible, more useful, make
- 10:54people more productive on top of those, that's that native code.
- 10:58Yeah.
- 10:59Yeah.
- 10:59A third example would be Jupyter, JupyterLab, Jupyter Notebook, all those things.
- 11:03When you talk to the contributors of those projects, they're down in TypeScript and JavaScript
- 11:08most of their day.
- 11:09So the data science folks don't have to write TypeScript and JavaScript.
- 11:13They just work in the tooling that's on the front end.
- 11:16And so it's, you know, it's kind of like, to me, it's kind of like, let's take one for
- 11:20the team.
- 11:20Yeah.
- 11:21We'll do this.
- 11:22So we all benefit, but you don't have to.
- 11:23You don't have to do it.
- 11:24I actually think it's one of the kind of, one of the real strengths of Python is the interoperability
- 11:31around like native code and extension modules.
- 11:34It's like a big, it's actually like a big part of Python and it's a big part of why Python
- 11:39has succeeded.
- 11:41And I think that will actually become more, I mean, this is sort of like going off on a
- 11:45tangent a little bit, but I think that will become a bigger and bigger part of like what
- 11:49Python looks like and what it looks like to work with Python.
- 11:53Because, you know, and I think Rust can actually play an interesting role here because at least
- 11:58from my perspective, like I do not have a systems programming background.
- 12:01Like I've not, I've definitely not written any C professionally.
- 12:05I don't think I've ever really written any C++ and Rust was my first sort of foray into
- 12:13that kind of programming.
- 12:14And I think at least me, you know, for me personally, I found it much more accessible.
- 12:20And so I think Rust and Python actually have this interesting story where Rust to some
- 12:24degree is this kind of like superpower, low level layer that you can drop into and then
- 12:29expose with a Python CLI for everyone to consume.
- 12:32So anyway, my prediction is I think that will only become more and more of a part of what
- 12:37Python looks like.
- 12:38And that's actually, I think it's actually a good thing.
- 12:40Yeah.
- 12:40I do too.
- 12:41I do too.
- 12:42Jake out in the audience, Jake Collahan, who says in another comment, great timing.
- 12:47I just released a video on these changes yesterday, so that's awesome.
- 12:50But the progress made in Ruff and uv sensor introductions clearly demonstrates that there's
- 12:55a strong contributor base, even when it's based on Rust, right?
- 12:59Yeah.
- 12:59Yeah.
- 12:59I'm not trying to dismiss that it's hard to learn Rust because I actually think it is pretty
- 13:04hard to learn Rust.
- 13:05And I think the learning curve is pretty steep.
- 13:07But yeah, I think the thing we found is there are people who are interested and who want to
- 13:10do it.
- 13:11Sure.
- 13:11Sure.
- 13:12I agree.
- 13:13I think another thing that it shows regardless of Rust or not is if it's your full-time job
- 13:19and there's funding and a team rather than part-time work, it can go many times faster
- 13:25towards a goal than before.
- 13:27I'm sure you've felt that way.
- 13:29Yeah.
- 13:29I mean, we're in a very unique, I mean, not completely unique, but fairly unique position
- 13:34whereby we can fund people full-time to work on this stuff.
- 13:39And it's actually just kind of wild to look at how much, not to sort of talk up our own
- 13:45work, but just how much you can accomplish in a relatively short period of time with that
- 13:49level of when people are kind of unlocked to work in that way and work on those kinds
- 13:54of problems.
- 13:56So, you know, just thinking it's like the amount of time we've been able to put into
- 14:00rough and uv is like sort of hard to fathom for some open source projects.
- 14:05It's like, wow, that's incredible.
- 14:06You know, but from the perspective of a company, it's actually like quite reasonable.
- 14:10And in fact, not even like that much.
- 14:13So, you know, I think it's pretty like the leverage that you have with open source, like
- 14:17when people are able to invest in it and really focus on it is pretty amazing because, you
- 14:23know, we work on these things, we improve these things and they ship out to,
- 14:25you know, I don't know, millions of users or whatever it is and really can provide a huge
- 14:31boost to the ecosystem.
- 14:32So, yeah, I mean, being able to work on this stuff full time, that was actually something
- 14:35that I decided pretty early on with rough was the project was growing more and more popular.
- 14:40And I was like, I don't know if I can keep up with this if I don't work on it full time.
- 14:45And so I'm at least going to see where that where that goes.
- 14:48And it's possible, right?
- 14:51And here you are.
- 14:52I mean, it is.
- 14:53But yeah, it's I mean, I just feel like,
- 14:55I just have a lot of respect for people who, you know, commit significant amounts of their
- 15:00time to open source alongside everything else.
- 15:03Because, yeah, it's I mean, it's an amazing thing, but it's also very challenging.
- 15:07And it's definitely is.
- 15:08It's 24 seven.
- 15:10Well, I think it's really positive that there's a group of people putting their full effort into
- 15:17especially the uv side of things.
- 15:20That's going to that's going to make a dent.
- 15:23Yeah, I mean, I think the other thing that's been cool about, you know, building this as a as a company is that we've been able to bring in a lot of people from like outside of Python to come and work on Python tooling.
- 15:36And I think that's like a really healthy thing for the ecosystem, because not only are these people, you know, I think, like really talented and really great, but they also bring like very different ideas and experiences.
- 15:46And so we have a lot of cross pollination on the team.
- 15:49The team's kind of a mix of people who have who fall everywhere on the spectrum of like or axes, I guess, probably not the spectrum of like how much rust experience, how much Python experience they have.
- 15:58You know, some of them have mostly worked in like TypeScript and the JavaScript ecosystem.
- 16:02So that was sort of an intentional thing for me when thinking about like building a team to work on this stuff was I want to have like some people on the team who are like super deep Python experts.
- 16:11And I want to have some people who like bring a totally different perspective to the problems.
- 16:15So that's been another like very cool piece of putting together a team to work on this stuff.
- 16:21I think that's a great perspective.
- 16:22This portion of Talk Python To Me is brought to you by Posit, the makers of Shiny, formerly RStudio and especially Shiny for Python.
- 16:31Let me ask you a question.
- 16:33Are you building awesome things?
- 16:35Of course you are.
- 16:36You're a developer or data scientist.
- 16:37That's what we do.
- 16:38And you should check out Posit Connect.
- 16:40Posit Connect is a way for you to publish, share and deploy all the data products that you're building using Python.
- 16:47People ask me the same question all the time.
- 16:51Michael, I have some cool data science project or notebook that I built.
- 16:54How do I share it with my users, stakeholders, teammates?
- 16:57Do I need to learn FastAPI or Flask or maybe Vue or React.js?
- 17:02Hold on now.
- 17:03Those are cool technologies and I'm sure you'd benefit from them, but maybe stay focused on the data project.
- 17:08Let Posit Connect handle that side of things.
- 17:10With Posit Connect, you can rapidly and securely deploy the things you build in Python.
- 17:15Streamlit, Dash, Shiny, Bokeh, FastAPI, Flask, Quarto, Ports, Dashboards.
- 17:21And APIs.
- 17:21Posit Connect supports all of them.
- 17:24And Posit Connect comes with all the bells and whistles to satisfy IT and other enterprise requirements.
- 17:30Make deployment the easiest step in your workflow with Posit Connect.
- 17:34For a limited time, you can try Posit Connect for free for three months by going to talkpython.fm/posit.
- 17:40That's talkpython.fm/P-O-S-I-T.
- 17:44The link is in your podcast player show notes.
- 17:46Thank you to the team at Posit for supporting Talk Python.
- 17:51One thing before we move on to talk about uv proper, closing the loop here.
- 17:55You mentioned those rules, those 800 Lint rules.
- 17:58And this resource you have over at docs.astral.sh slash rough slash rules is awesome.
- 18:04So even if you don't use rough, you know, you care about say PEP 8 naming or something, you get a warning from Flake8 or whatever.
- 18:13And it says Dunder function name.
- 18:15Like what is this error, right?
- 18:17What is this thing?
- 18:18And then you've got each one of these rules has a, what is this?
- 18:22Why is it bad?
- 18:23How should you change it?
- 18:25Here's the bad version.
- 18:26Here's the good version.
- 18:27And so on.
- 18:28And I think this is just a really good resource.
- 18:29I know you all put a ton of time and energy into it.
- 18:32I appreciate you calling that out.
- 18:32Yeah, it takes a lot of time.
- 18:33I mean, once you cover all the rules, maintaining it incrementally is slightly easier.
- 18:38But, you know, when we started this, we definitely had a few hundred rules.
- 18:41And so, you know, it was a lot of contributors who contributed us getting to full coverage here.
- 18:46It's almost like the Wikipedia of Lint rules or something.
- 18:50How to Python.
- 18:50Yeah.
- 18:51Yeah.
- 18:52I guess maybe one thing I'll say is like, we have a lot of rules, but you don't have to use them all.
- 18:57And like the default rule set is actually pretty small.
- 18:59So even when I work on projects, I don't necessarily enable all of the rules.
- 19:03I typically enable like a couple subsets.
- 19:05So I just think sometimes it can be intimidating to imagine 800 rules being applied over your code face.
- 19:09So, you know, the default rule set is pretty small.
- 19:12It covers things like unused imports, you know, things that are pretty common.
- 19:16Pretty common and relatively unobjectionable.
- 19:17And then we have all these different categories for ways that you kind of level up the level of coverage.
- 19:22Yeah.
- 19:23I take pretty much the defaults as well on all my projects, except for wider lines of code, more columns.
- 19:30Yeah.
- 19:31Yeah.
- 19:32On a 32-inch monitor, 80 columns is just down the little corner.
- 19:37We actually took that out of the defaults.
- 19:38Did you?
- 19:39Oh, beautiful.
- 19:40Yeah.
- 19:40I don't need a ruff.toml or whatever it was I was putting in there for a configuration.
- 19:45Yeah.
- 19:45We got rid of that.
- 19:46Because the thinking there is like, if you have long lines, they should generally be handled by a format or not a linter.
- 19:52So by default, we don't enforce that.
- 19:54Yeah.
- 19:54Okay.
- 19:55Interesting.
- 19:56And then the single quotes versus double quotes, which we discussed on GitHub.
- 20:00I remember, I think we talked about it last time.
- 20:02Yeah, probably.
- 20:02Maybe as well.
- 20:03Yeah.
- 20:04I talked about that with everyone.
- 20:05Yeah.
- 20:07And Miguel also agrees here.
- 20:10Amazing docs.
- 20:10The rules are top notch.
- 20:11Nice work.
- 20:12I appreciate that.
- 20:13Okay.
- 20:13So I know we're going to talk to you, V, but Tushar does have a good question out there.
- 20:17And I don't know if speak to it or don't speak to it.
- 20:20Are there plans for rough to become a PyLance alternative?
- 20:24So a language server of some sort.
- 20:27Is this anything that you're willing to talk about?
- 20:29I would say, I mean, yeah, I think that's like an interesting thing that we'll consider.
- 20:33It's not something that we are committed to doing or committed not to doing, like building a language server.
- 20:41I would say that's probably like a few steps away from where we are today, because before we would build a language server, we would probably build, you know, something that could something like a type checker, like something that could deal with type inference and like better understand the relationships between different parts of your code.
- 20:57I view that as like, it's not strictly a prerequisite to building a language server, but I view that as like a little bit more of a path.
- 21:03More mypy.
- 21:05Yeah, more mypy.
- 21:07I think there's like a lot of interesting stuff around building a, well, first of all, of course, there's like building a type checker, but there's also building what I would call like a type aware linter.
- 21:17Like you could imagine that rough itself could actually get a lot more powerful if it could do all sorts of type inference.
- 21:23Like we have some rules that are only supposed to activate on dictionaries and we do some sort of bad local type inference and heuristics to figure out if we think a variable is a dictionary.
- 21:33Like if you call it on it, it might be a dictionary, right?
- 21:36So if we knew there's just a lot of interesting things we could do, we could build a much better tool.
- 21:41So it's not just about building a type checker.
- 21:43It's also about how can we build a much better linter and sort of like set of tools.
- 21:47But yeah, we're thinking about that a lot.
- 21:49There's a lot of discussion happening about that, both internally and publicly on the repo and the discord.
- 21:56We're thinking a lot about sort of type inference and how to evolve rough in that direction.
- 22:00So yeah, language server may be something we can do eventually.
- 22:03It's obviously a huge undertaking.
- 22:05And we want to make sure that like anything we decide to build, we feel a lot of conviction, you know, that it can be great because it's not, doesn't necessarily make sense for us to try and build something that we think is like 5% better than what's out there.
- 22:19It's very hard to get users to switch to something that's 5% better.
- 22:21So, you know, when we look at the opportunity set, we're kind of thinking about where can we have a big impact?
- 22:26What do users really want, you know, cross-referenced against?
- 22:29Where do we think there's opportunity to build something that would be an improvement in ways that users care about?
- 22:34So yeah, very interesting, not something we're focused on right now, the language server piece at least.
- 22:38Yeah.
- 22:39You guys are going to need at least a few weeks to get to that, huh?
- 22:41We're going to need a few weeks to get to language server.
- 22:43All right.
- 22:45I've been out there in the audience.
- 22:46It says, excellent tool.
- 22:48Ruff and uv have changed my life.
- 22:49I've talked about Ruff.
- 22:50That's very nice.
- 22:51Yeah.
- 22:52UV, maybe a quick summary for what it is.
- 22:55And then we could talk about your post, which adds layers of features and capabilities as we start.
- 23:01Yeah, totally.
- 23:01So I came on the show back in March and we talked a bit about what uv was at the time.
- 23:08We released uv in like mid-February.
- 23:10So that was a couple of weeks after.
- 23:11And uv is our Python packaging tool.
- 23:16And it's built in, you know, under a lot of the same sort of design goals as we had for Ruff.
- 23:24So we wanted it to be extremely fast.
- 23:27We wanted it to try and bundle a few more things together so that you could use fewer tools to work with Python and be productive with Python.
- 23:36And we wanted it to be really easy to adopt.
- 23:38That was another principle that we thought about a lot.
- 23:41So when we released uv in February, it was framed as a pip alternative.
- 23:49So the idea was if you've used pip before, you know, pip install, pip uninstall, or tools like pip compile or pip sync, it should be really familiar to you.
- 23:59So the API that we started with was like uv pip install, uv pip uninstall, uv pip compile.
- 24:04And it was meant to kind of mirror the pip API.
- 24:07And the idea there was we wanted it to hopefully be immediately obvious to people like how this tool works and what it does.
- 24:14And also, I guess, to some degree what it doesn't do.
- 24:17So we released that in February and it grew extremely fast.
- 24:22It's yeah, it's just the adoption both in terms of like raw numbers and just like the companies that we talk to that are using it like very quickly.
- 24:31A lot of people were using it.
- 24:32I consider it a big success.
- 24:35I'm really happy with how that went.
- 24:36But it was also like, I think, a pretty small.
- 24:39It was sort of a small portion of like what we wanted to build for packaging.
- 24:42You know, ultimately, we weren't trying to build just a faster pip.
- 24:46I think that's like a really I think it's a really good starting point for a couple of reasons.
- 24:52One, much easier for people to adopt.
- 24:54Two, it required us to build a lot of the like fundamental pieces that you need for Python packaging.
- 25:01Like in order to build a pip alternative, we had to be able to resolve Python dependencies, like install Python packages, understand virtual environments, right?
- 25:10Manipulate all those things.
- 25:11We had to implement a bunch of standards around introspecting built distributions and source distributions and virtual environments.
- 25:18So we had to invest in all these things that I view as kind of like fundamental primitives of working with Python packaging.
- 25:25But the ultimate goal for us was always we want to build something that's, you know, like a single static binary that you download install that just that just gives you everything you need to be productive with Python.
- 25:36And from that perspective, like a pip alternative is pretty low level.
- 25:40And we wanted to build something that was a little bit more high level, something that can install Python for you, something that can manage the virtual environment for you, something where you just do run this file and it figures out the dependencies, installs them.
- 25:53It creates the environments and it runs this file in the environment.
- 25:55Like that is what we wanted to build.
- 25:56So that's what we've been building up to over the past couple of months.
- 26:00Yeah.
- 26:00Amazing.
- 26:01Of course, you've got to have the uv pip features as a foundation, right?
- 26:05Because even if you don't kind of like we talked earlier, even if you don't expose it directly as a CLI thing that from a project management perspective, it's needed, right?
- 26:16Yeah.
- 26:17And like, it's part of kind of like meeting people where they are to a certain degree.
- 26:22Like everyone has workflows that are built around pip, like even people that do other package that have other packaging workflows.
- 26:28Often those workflows are actually built around pip commands.
- 26:31And like I said, I view those as a little bit low level, like with pip, the operations are kind of like install this package into this environment, as opposed to here are my dependencies, make sure the world is like in sync with my dependencies.
- 26:42That's what I would consider to be like a little bit more high level.
- 26:45So, you know, we built and released that pip interface in February.
- 26:49And since then we've, you know, it's basically been like hammered, right?
- 26:53By users.
- 26:54So it's just gotten like better and better, right?
- 26:56Because they find problems with it and then report them and it just gets, you know, it gets better.
- 27:00It gets faster.
- 27:01It's like more feature complete.
- 27:02So we've had a few months to kind of improve and build on top of it too.
- 27:05Yeah.
- 27:06That's one of the benefits of such it taking, they can hold so much and people using it so much as they hit the little edge cases all the time.
- 27:14Yeah.
- 27:15A lot of edge cases.
- 27:16It gets smoothed out quick.
- 27:16I bet.
- 27:18I bet.
- 27:18Yeah.
- 27:19Yeah.
- 27:19Yeah.
- 27:19Yeah.
- 27:19But it's, it's, it's, yeah, it's super fun, like set of problems to work on by the way.
- 27:24And like really different from rough too.
- 27:27Like, yeah, rough is rough is more like a, it's more like a compiler.
- 27:33I would say like, we have like a parser and a Lexer, you know, all that kind of stuff.
- 27:38And with uv, it's a lot more, how do we do IO really fast?
- 27:42Like we have a lot of networking.
- 27:43We're like reading and writing from disc a lot.
- 27:45There's a lot of interfacing with standards.
- 27:48A lot of interfacing with the registry.
- 27:50Everything's async.
- 27:52So it's just like a very different set of problems.
- 27:55And it's, it's fun to get to kind of work on both of them.
- 27:57Cause you know, they're just really different.
- 27:58Yeah.
- 27:59I'm sure they're both fun projects.
- 28:00And there's some really good ideas and questions in the audience, but we're not ready for them.
- 28:05So I think when we spoke back in March, one of the things we discussed is how you structured the CLI API in a way to leave space.
- 28:16So for example, it's not uv install package.
- 28:20It's uv pip install package.
- 28:22And it's not uv compile --update for dependence.
- 28:26It's uv pip file or whatever the command is, right?
- 28:29I have it alias to a couple of letters and I never think about it again, but something, you know, that's,
- 28:34you've left space in the CLI with these sub commands.
- 28:37And I think now we're starting to see why you left space.
- 28:41Is that right?
- 28:42Yeah.
- 28:42Yeah.
- 28:43That was like pretty controversial at the time and users really hated it.
- 28:46I mean, they still used it, but it's so much better.
- 28:51I'll use it.
- 28:51A lot of people complained about it.
- 28:53I even found it, you know, I even found myself saying like, maybe we should, maybe we should stop doing this.
- 28:58Like maybe we should just give up because like people, people were complaining and like I was annoyed by it and stuff.
- 29:03But yeah, it's either like a huge, obviously like it's either like a terrible mistake or it was genius.
- 29:08I don't, I don't actually know, but, but what it did was right.
- 29:12Like one effect, which I said before was it immediately conveyed the sort of rough shape of the commands like uv pip install.
- 29:18And then if you've used pip install, you know, that the next argument is like a package name or a requirements file.
- 29:24But the other thing it did is it left space in the CLI for these new APIs that are sort of first class uv APIs.
- 29:31So instead of, yeah, instead of doing uv install, when we released in February, it was uv pip install, which meant that today this new set of APIs that we, that we launched, let's see, two weeks ago, I think today.
- 29:42Scroll up.
- 29:44Is there a date there?
- 29:44August 20th.
- 29:46So this new set of APIs that we released are, you know, uv lock, uv sink, uv run.
- 29:53They're all, they can all be top level because they're really like the first class uv workflows.
- 29:58The pip API, by the way, still a hundred percent there.
- 30:02And like, we're going to invest in it a lot and like continue maintaining it.
- 30:06Cause like that is how most people use uv.
- 30:08And maybe eventually we want that to be less true.
- 30:11Right.
- 30:11Like, right.
- 30:12Like we hope more and more people use the new stuff.
- 30:14But like, we're going to keep building that.
- 30:16But for, for projects that can, we now have this new interface that if you can fit into it, it's just sort of more powerful and does more for you.
- 30:24So we saved space in the CLI exactly for this reason, which is we had a bunch of stuff we knew we wanted to build.
- 30:30And if we polluted, well, not polluted, it's the wrong word, but if we polluted, you know, the interface with uv install.
- 30:37Clogged.
- 30:37If you clogged it.
- 30:38Yeah.
- 30:39Yeah.
- 30:39If we, if we lost all that space to those existing commands, it would make things harder.
- 30:43So I think it's worked.
- 30:45It's done.
- 30:45It's had the intended effect for us of it kept the space open.
- 30:50It let people use it.
- 30:51It conveyed how it works.
- 30:53And now they kind of exist alongside each other and the pip API, you know, you can kind of use them together in certain ways.
- 30:58And when you use them together, you sort of realize that the pip API is more low level.
- 31:02It's like the new APIs, you know, you have a PI project tomo file with your requirements in it and you just run uv sync and it will resolve them, create a lock file, install them in a virtual environment.
- 31:11It's like one command.
- 31:12You could then like modify the virtual environment.
- 31:15Like you could do like uv pip install, blah, blah, blah, and like start making edits to it.
- 31:19But that kind of illustrates what I mean by it's like a low level pip API is where you're kind of manually manipulating things versus these higher level APIs where you, you tell us what your dependencies are.
- 31:29And then we figure everything out for you.
- 31:31Yeah, that's excellent.
- 31:31Just one comment on the, it's too many words or it's too long or whatever.
- 31:37Like I hinted at before, I just have aliases for these.
- 31:40So for example, I just type PIR and that means uv pip install -r requirements.txt.
- 31:46And like, I don't care if it's uv pip that or it's pip install dash, like whatever.
- 31:51I don't want to type any of those.
- 31:52So it's just three that PIR, let's go, you know?
- 31:54Yeah.
- 31:55And I've got three or four of those, you know, one to make virtual environments with uv and a couple of things like that.
- 32:00And one to compile the changes and, you know, you, you look up for me, I look up the docs.
- 32:04I go, okay, well, here's, here's how I'm going to shorten that to something I never think about again.
- 32:08So it doesn't matter.
- 32:10That's totally fine.
- 32:11Right.
- 32:11That's totally fine.
- 32:12But you do got to consider, I guess, the workflow for new people.
- 32:16Yeah.
- 32:17Maybe that's a good place to talk about the features here.
- 32:18So one of the things that really, there's a lot here.
- 32:22One of the things that even though it's number three on the list of four things is the Python command.
- 32:28So uv Python install, uv Python list, all of those kinds of things.
- 32:33I mean, maybe we should start there because without that, we don't have any Python.
- 32:38Although, yeah.
- 32:39So that runs sort of implicitly under some circumstances, right?
- 32:42Correct.
- 32:43Yeah.
- 32:44Okay.
- 32:44So part of what we wanted to do with this release was make uv sort of self-bootstrapping,
- 32:50which sounds complicated.
- 32:51But the idea there is if you don't have Python installed, uv doesn't depend on Python.
- 32:56It's just a binary.
- 32:58So you download it.
- 32:59And then when you run a command like UVVM and you give us a Python version, if you don't
- 33:04have any Python installed, if you don't have that version installed, we will download and
- 33:07install it for you.
- 33:08So you can sort of seamlessly run these commands without worrying about how do I install Python?
- 33:13Where is my Python, et cetera, et cetera.
- 33:14Which means that we can achieve this really cool experience where the whole set of commands
- 33:21you need to create a Python application are like, you curl install uv, and then you just
- 33:26run like uv init --Python.
- 33:28And we create a project for you.
- 33:30We download and install that version of Python.
- 33:31You can just start running things.
- 33:32You don't have to think about how do I install Python?
- 33:34How do I get it on my machine?
- 33:36Do I have the versions I need?
- 33:37Anything like that.
- 33:37So you can obviously turn this stuff off, right?
- 33:40And you can use your own.
- 33:41It also respect pythons that you have on your machine already.
- 33:44But part of the goal was we wanted to get to this, I won't call it the holy grail, but this
- 33:49experience of you just download the binary, you do uv run, and everything just works.
- 33:54So that was a big part of it.
- 33:56And if you look at the full list of things that we put in this release, there's kind of
- 34:02a lot of stuff, right?
- 34:04There's like four bullets of things that each of those could be a big release.
- 34:09You know, one is like the Python installation.
- 34:10One is we have this sort of like tool install, kind of like pipX.
- 34:14So if you want toinstall ruff globally, you can do uv toolinstall ruff and we'll install
- 34:20it for you.
- 34:20It'll get put in your path, everything like that.
- 34:22We have these project management APIs that I've hinted at a little bit throughout this conversation,
- 34:26like uv run, uv lock, uv sink.
- 34:28Yeah, we'll get into it.
- 34:29And we have, yeah, we have this thing around script execution.
- 34:31So, you know, I thought for a long time, I thought that these would actually all be separate releases,
- 34:36that we would do like a staggered series of releases.
- 34:40And I was excited about that because, well, first of all, that's always fun.
- 34:43Like you kind of like have a bunch of things and you're like shipping like one week, one
- 34:47week, one week, and everyone's like, oh my gosh, we're shipping so much stuff.
- 34:49But the thing we found was like, they're all kind of interconnected in subtle ways.
- 34:53And like the project management and the tool API, they're just not as interesting if you
- 34:57don't have like the Python.
- 34:58Like they are interesting, but the fact that we have the complete story of like you do uv run
- 35:03and we install Python, we've resolved your dependencies, we install your dependencies, we run the command
- 35:07in the environment, like that whole picture, like everything's a little bit interconnected.
- 35:10So that's how this release came to be so much stuff is we had this vision for what we wanted
- 35:15the full stories to be, and they all became somewhat interconnected.
- 35:18And, you know, in the end, they're all like individually, I think really powerful things,
- 35:22but they kind of come together to give this, what we want this Python experience to be.
- 35:27And we're not like totally there yet.
- 35:28You know, we're missing stuff for sure.
- 35:30But this was our attempt to capture kind of a couple of different workflows that are intertwined
- 35:35in different ways.
- 35:36Yeah.
- 35:37I see how they all interconnect, but they are also interesting on their own, right?
- 35:43Yes.
- 35:43The Python installation thing is interesting.
- 35:45And usable on their own, by the way.
- 35:47Yeah.
- 35:48Yeah, exactly.
- 35:48They're all independently.
- 35:50If you just had one of those, you'd be like, that's pretty cool.
- 35:53Okay.
- 35:54I like that.
- 35:54That's pretty cool.
- 35:55So let's talk just a bit more about the Python one.
- 35:59So there's analogies here to other tools that people may know.
- 36:03And the closest one for this would be PyE and V, do you think?
- 36:07Yeah, probably.
- 36:08It's like, there are obviously differences, but that's a very popular one that most, you
- 36:14know, a lot of people know.
- 36:14Yeah.
- 36:15Yeah.
- 36:15I'm not saying that they're identical, but it's, it fulfills a role that a lot of people
- 36:19were, were solving with it.
- 36:20Now, when I tried to do INV, I don't remember what I was doing wrong, but this was the early
- 36:26days of Apple Silicon and maybe I had the Intel X64 version of Homebrew, but I had the build
- 36:34tools for ARM.
- 36:35I can't remember, but I could not get it.
- 36:37Yeah.
- 36:37Trying to do something under Rosetta or something.
- 36:39Again, I couldn't get it to install anything with PyE and V because it would, it would download
- 36:45it and would try to compile it.
- 36:46Then there'd be some weird compiler bug.
- 36:48And I'm like, you know what?
- 36:49I'm not debugging the source of, I'm just not debugging this.
- 36:52I'm out.
- 36:53I'm just going to go download it.
- 36:54And also that's a real, I compiled Python for some of the server stuff I'm doing and it
- 36:59takes a while.
- 37:00It's not that fast.
- 37:01And when I get it from you guys, if I say uv Python install 3.12 or something, boom,
- 37:09I get it.
- 37:09Like in your standard style, it's fast.
- 37:12How is it fast?
- 37:13Yeah.
- 37:14So that comes down to like sort of a fundamental difference between what we're doing and what
- 37:17PyE.
- 37:18I don't know if it's PyE or PyE by the way.
- 37:20I think it's PyE by the way.
- 37:22Okay.
- 37:22So I'm just going to say that.
- 37:23Let's go with that.
- 37:25If I try to do the other, I will mess up.
- 37:27So like the way that PyE typically works is, you know, it's a great tool.
- 37:31A lot of people use it.
- 37:32It's building Python from source and there are trade-offs around this, but the idea is it
- 37:36will build the version of Python that you need.
- 37:38What we're doing is we're building a top of project called Python build standalone by originally
- 37:46created by Greg Sork.
- 37:47And that's a project that we've started contributing to.
- 37:49So I think I did the last two releases maybe.
- 37:52But the idea here is we have these standalone, easily redistributable Python builds.
- 37:58And when we do a release, it will create Python builds for, you know, for a bunch of Linux
- 38:03architectures for macOS, for Windows on all the different Python versions.
- 38:08And it will also run a bunch of optimizations over there.
- 38:11So it'll do, you know, it's not these acronyms.
- 38:14It's not important that you understand them, but, you know, it can do like link time optimization
- 38:17or LTO and profile guided optimization, PGO.
- 38:20So we build all the binaries in advance.
- 38:23That's pretty impressive.
- 38:23Yeah, that's impressive.
- 38:24That all happens in advance.
- 38:26So if you go to like the releases page here, like scroll up a little bit and just go to,
- 38:32just click their latest release.
- 38:33Yeah.
- 38:33Right.
- 38:33Yeah.
- 38:34You'll see like all the, yeah, like 773 artifacts.
- 38:38That's like 773 Python builds.
- 38:40So it's a lot of different Pythons.
- 38:43Yeah.
- 38:43Yeah.
- 38:43It's a lot of different Pythons.
- 38:44Yeah.
- 38:44773 different.
- 38:46So like, you know, we build all this stuff.
- 38:48And then when you run Python install, we figure out the correct, see, we have like arm, we
- 38:52have like all this stuff.
- 38:53So then we figure out the correct Python for your machine.
- 38:55We just download and unzip it.
- 38:56I see.
- 38:57The same way you get a wheel is the way you get this.
- 38:59Yeah.
- 39:00I mean, it's actually the same code pretty much like under the hood for us.
- 39:02Right.
- 39:03It's like we stream and unzip it down into disk.
- 39:05And that's great.
- 39:07It's like super fast.
- 39:08It's also, they're already optimized.
- 39:11Like Pythons by default does not compile with optimizations.
- 39:14You can compile with optimizations, but it's not what it does by default.
- 39:18So these will be, you know, noticeably faster than, than what you would get by default with Pythons.
- 39:24There are some downsides, like some people like to build from source, right?
- 39:27They like to have like effectively the full chain of like reproducibility in the build.
- 39:31And now you're kind of trusting us to give you your Pythons.
- 39:34So that's, that is a downside to some people.
- 39:36Yeah.
- 39:36But then the next thing you do is you pip install something that has a binary wheel anyway.
- 39:41So yeah, yeah, no, that is true.
- 39:43There are also like a couple of quirks with these builds that we're, we're working on a little bit.
- 39:50Some of it has to do with like licensing the fact that you want to have kind of
- 39:54a statically, you want to have a self-contained Python.
- 39:56And there are some things in the, in, you know, in there that, that require licensing changes.
- 40:00So, you know, it uses all terms.
- 40:02Some, there are some slight deviations from what you would get with building from source
- 40:05from CPython.
- 40:06And those are documented in Python build standalone.
- 40:09But, you know, the general idea is we pre-build and pre-optimize these Pythons.
- 40:13And then we, you know, we download them on demand and it makes it really fast.
- 40:17Awesome.
- 40:18When I go to python.org and download a DMG package or
- 40:23and MSI for windows or whatever, it runs this installer process that takes a good long while.
- 40:28And, you know, Jake just pointed out a similar experience I had.
- 40:31It says it took me less than two seconds to install 3.10.
- 40:34Yeah.
- 40:34Same thing for 3.12.
- 40:35So what is, are we missing anything compared to running a proper installer that seems to
- 40:42take 20 seconds, even on a fast computer?
- 40:44I think those installers also have to do some operations from source, most likely because
- 40:49they're not shipping.
- 40:51Okay.
- 40:51I could be wrong about that.
- 40:54I haven't looked at them closely.
- 40:56But Python in general, like, you know, Python.org does not distribute these kind of pre-built
- 41:04binary distributions for all these different architectures.
- 41:06And we, there's interest in doing that.
- 41:10And I'm also interested in doing that.
- 41:12And, but, you know, it needs to be, you know, there are some things that need to be decided,
- 41:17standards that potentially need to be set.
- 41:20So, you know, it's possible that eventually we can just read, you know, grab these basically
- 41:24from, from python.org.
- 41:27I think our PyPy downloads come from python.org, if I'm not mistaken.
- 41:32PYPy, that is.
- 41:33Yeah.
- 41:33Or it actually might come from PYPy.org.
- 41:36Now I can't remember.
- 41:37Okay.
- 41:38Anyway, those come from some sort of official source.
- 41:41Yeah.
- 41:41Yeah.
- 41:41Yeah.
- 41:42Yeah.
- 41:42So, okay.
- 41:43Yeah.
- 41:44Yeah.
- 41:44Maybe eventually.
- 41:45But, but for now, yeah, we're using Python built standalone and we've just been trying
- 41:49to grow our familiarity with the project too.
- 41:51Right.
- 41:52Okay.
- 41:52So let's give people a sense here, like they do not have Python at all, or they can't count
- 41:57on having Python or the right version of Python.
- 41:59They can run a single shell command to get uv, which uv can then manage itself.
- 42:05They could pip X install the uv.
- 42:07Can you homebrew?
- 42:08Yeah.
- 42:09What other ways, how, what other ways can I get?
- 42:10Yeah, you can get uv on your machine however you want.
- 42:12Like uv doesn't need to be in the virtual environment that it's manipulating.
- 42:17Yeah.
- 42:17It can just be anywhere on your machine and it can operate on any environment.
- 42:20External tool sort of deal.
- 42:22Yeah.
- 42:22Yeah.
- 42:22Yeah.
- 42:23So once you have that.
- 42:24You can install it with pip.
- 42:25We have our own standalone installers that you can, you know, curl.
- 42:28It's on homebrew, right?
- 42:30It's on, you can, you can install with pip X, you can install it however you want.
- 42:33And then ultimately it can operate on any environment on your machine.
- 42:37So I actually don't recommend installing it in a virtual environment.
- 42:40I recommend installing it globally.
- 42:41Yeah.
- 42:42That's how I have it as well.
- 42:43Kind of working from there.
- 42:44Yeah.
- 42:44I believe I've pip X installed it.
- 42:46Cause anything that falls into that category for me, it goes under pip X, at least for now.
- 42:50Yeah.
- 42:50Well, we'll talk about that in a minute.
- 42:51Yeah.
- 42:52I mean, one interesting thing is if you use our installers like the curl installers, then
- 42:57you get access to self updates.
- 42:59So you can run uv self update and we will update to the latest version.
- 43:05That's right.
- 43:06Cause I tried to really try that.
- 43:07If you, yeah, you can't do that.
- 43:09If you installed through a different package manager, because we don't really like know how
- 43:13it was installed.
- 43:15So if you install it through the installer, right.
- 43:17We write a receipt that, that we understand like where we installed it and all that kind
- 43:20of stuff.
- 43:20Yeah.
- 43:21So that's, that's one benefit.
- 43:23But it's not, you're not required to do that.
- 43:26Sure.
- 43:27I ran into that when I just wanted to see what it would do.
- 43:30Yeah.
- 43:31And it's, it's a, you installed this from a package manager type thing.
- 43:35So go do that thing.
- 43:36But that's fine.
- 43:36But that's fine.
- 43:36I have automation for like all those things.
- 43:38So it's not a big deal.
- 43:39And so on.
- 43:39So to give people a sense, like once uv is on your system and in the path, you can say
- 43:44UV, V and V --Python, and put up some variation of a Python version.
- 43:50And if you have it great, it'll use it right to create the virtual environment.
- 43:54If you don't have it, it will then do this two second download install deal.
- 43:58Assuming you have fiber and then create a virtual environment based on it.
- 44:01Right.
- 44:01Yep.
- 44:02That's right.
- 44:03And you can turn that off, but that is the default behavior.
- 44:05Yeah.
- 44:05That's awesome.
- 44:06And then you can also pass commands like managed only, I think it is, or something like that,
- 44:11where you say, don't use the system Python even.
- 44:14Yeah.
- 44:15Yeah.
- 44:15Only use the pythons that uv will install or like only use the pythons that are out my machine.
- 44:20Ignore UV's pythons.
- 44:21There's some customizations around that.
- 44:22Right.
- 44:23Like you could do the opposite.
- 44:24I will also say this version, by the way, this version format request thing is like so hard.
- 44:32Yeah.
- 44:33It's just like, you'd just be shocked.
- 44:35Like how much engineering work has gone into like understanding those requests and then discovering all the pythons on your machine.
- 44:41Yeah.
- 44:41And the discovering all the pythons on your machine part problem, by the way, is a problem that like a bunch of tools have had to solve.
- 44:48And we've talked with the pythons on your machine.
- 44:56And we've talked about it in different places that they could be.
- 44:57And like on windows, it's also like totally different than on Unix.
- 45:01So anyway, a lot of work has gone into that.
- 45:08Like you can say, yeah, you can say cpython greater than or equal to 3.12.
- 45:13Right.
- 45:13And then we'll look for cpython rather than pypy rather than grailpy.
- 45:16Yeah.
- 45:17Yeah.
- 45:17So anyway, a lot of work has gone into that.
- 45:18What if I just say uvvv and I have no python whatsoever?
- 45:24I think we would install the latest python.
- 45:26Would you just go, yeah, just do a latest like maybe a implicit --python space 3.
- 45:32Yeah.
- 45:33I think that would kind of give me any python from the list of downloads.
- 45:37And then we sort by version.
- 45:39So I think you would effectively get the latest compatible version.
- 45:42But now you're kind of quizzing me a little bit.
- 45:44No, I don't mean to be quizzing you.
- 45:45I'm just kidding.
- 45:47All right.
- 45:48So we'll move on.
- 45:50I know there's so much more and we don't have a ton of time to get it.
- 45:54But I just pulled up my my warp terminal and I typed uv python list and it shows me a bunch of options for arm 64 for macOS 312.5 312.0 311.9 310.3.8 and so on that I could pick.
- 46:10However, I'm just wondering where your cutting edge needle or setting is going to go here.
- 46:17I don't see a 3 of 13.
- 46:19Yeah, we're working on it.
- 46:21We're working on it.
- 46:22We're working on it.
- 46:24And one of the things that is tricky about any of these package manager stories is if I homebrew it, I'll see that there's a new python, especially a major release, but I might have to wait a week before it's available on homebrew.
- 46:36And but homebrew auto updated.
- 46:38But if I install it for the installer from python.org, it won't auto update it.
- 46:41And you know, there's just there's always a little drawback of it.
- 46:44Yeah.
- 46:44Yeah.
- 46:44Yeah.
- 46:44Yeah.
- 46:45And so when I saw this feature, I'm like, well, if this thing could just really soon have the newest one that would just be icing on the cake.
- 46:52And so what is your what is your policy on how quickly to adopt new things?
- 46:57I'll go get it.
- 46:58Yeah.
- 46:58Yeah.
- 46:59Yeah.
- 46:59Yeah.
- 46:59At least candidates and betas and things like that.
- 47:01Yeah.
- 47:01Like with 3.13, I mean, I would like to have it out as soon as there's an RC.
- 47:06That's what I would like to do.
- 47:08Okay.
- 47:08our policy or our, our goal is to make sure that it's out before the stable release.
- 47:16Okay.
- 47:17So we would like to not be lagging on the stable release.
- 47:20And, you know, we view like the minor releases in Python, similarly in rough historically,
- 47:27like we'll be like, okay, we want to make sure that we support all the 3.12 language features before 3.12 is stable.
- 47:33and there were like a bunch of language features in 3.12.
- 47:35There was like some new grammar, there were new typing features.
- 47:38And so the goal there again was like, the goal is to have it out by time.
- 47:41It's stable.
- 47:42So that's typically like the contract we try and uphold and that's still our plan for 3.13.
- 47:46Okay.
- 47:46Awesome.
- 47:47Yeah.
- 47:47Good to know.
- 47:48Yeah.
- 47:48Jay Geller says, it would be, it would be nice to have an option to install pre-release build.
- 47:54And, Tushar says, the thing is Python build standalone builds 600 releases per version number.
- 48:00Having that run daily is too much.
- 48:01But if anyone could do some interesting caching, surely the astral folks.
- 48:05You know, it's kind of amazing though.
- 48:08That project runs, it's not, we like, we don't, we don't own it.
- 48:11It's not under our org.
- 48:12Yeah.
- 48:12Yeah.
- 48:12Yeah.
- 48:12Yeah.
- 48:12That project runs completely for free on GitHub action.
- 48:15Wow.
- 48:15Isn't that remarkable?
- 48:16It's kind of crazy, isn't it?
- 48:17Yeah.
- 48:18GitHub is ridiculous.
- 48:19Yeah.
- 48:20So anyway, that's kind of.
- 48:21How much traffic it handles and yeah.
- 48:24Yeah.
- 48:24How much data.
- 48:25Yeah.
- 48:25They're, they're pretty awesome.
- 48:26Okay.
- 48:27Yep.
- 48:27So if you don't have Python, you can also, you don't have to do a V and V, you can just say,
- 48:31UV Python install, give it a version.
- 48:34And then you'll just have that.
- 48:35Like that's what Jake and I were referring to earlier, but you can also create a V and V.
- 48:40And this is sort of a philosophy that I'm, I'm getting.
- 48:43And sorry, someone said this earlier, but it's scrolled off the live stream comments that this
- 48:48prefer or require virtual environments by default, rather than prefer to try to jam stuff into system
- 48:55Python or the core Python.
- 48:57And then it could be a virtual environment if you really know the incantations.
- 49:00Yeah.
- 49:01Yeah.
- 49:02That's probably like, you know, we did the release in February.
- 49:05We tried to steer pretty closely to the way pit behaves to make it easy for people.
- 49:11But we did pick a few battles where we wanted to intentionally diverge.
- 49:16And this was, this was one of the bigger ones, which is uv by default requires a virtual environment.
- 49:22So if you try and uv pip install and there's no, we can't find a virtual environment in the current
- 49:25directory or an active virtual environment, we'll throw an error.
- 49:28And you can opt out of that by passing a system flag, but unlike pip, right, it's opt out.
- 49:34So you have to, by default, use a virtual environment and you can escape from that if you want to
- 49:39intentionally.
- 49:40So we're trying to, like with these APIs too, like these are all virtual environment.
- 49:47Well, the tool stuff, it is, but in a different way, like uv run, uv lock, uv sync, these all create
- 49:54a virtual environment in the project directory where the project is defined by a PI project tunnel.
- 49:58So if you run uv run in that directory, it will look at the dependencies, resolve them, create a lock file,
- 50:04create a virtual environment, install their locked versions into the virtual environment, run the
- 50:08command.
- 50:08And it does that every time, but it's so fast that we will hopefully so fast that we can do it.
- 50:14So like if the dependencies haven't changed, it will still make sure that everything's up to date.
- 50:18So if you just use uv run, we try and keep the whole environment in sync for you.
- 50:22And you don't have to think about how do I manage my environment?
- 50:25How do I activate it?
- 50:26How do I install stuff?
- 50:27But we're pretty like, we're pretty pro virtual environment.
- 50:32And one thing I want to do, and it's sometimes hard to hold these lines because you have users
- 50:38who come to you and want something really different.
- 50:40And it can be hard not to say yes to a lot of the things that users want.
- 50:46But some lines, I think we have to hold because if we can see it on them, sorry, I may sound like a
- 50:53battle, but if we can see it on them, it just limits the things we can do in the future.
- 50:58Like if we make things too flexible, it limits some of the things, some of the possibilities
- 51:02of what we can do in the future.
- 51:03And like one thing that I kind of want to change the perception around is like, I think virtual
- 51:08environments are like, they're here to stay really.
- 51:11And I am, so we like embrace them, but I want to change some of how people like think about virtual
- 51:18environments.
- 51:19In particular, I want to change this whole idea of like activating a virtual environment.
- 51:22Like I want it to feel more like node modules, which people don't necessarily think, you know,
- 51:27highly of node modules.
- 51:28Like I think when people think of node modules, they think of a huge node modules folder with
- 51:31like a ton of bloat.
- 51:33But the idea there is like when you're in a project, you just sort of run commands and all the packages
- 51:39just get installed there.
- 51:40And it just runs in the correct environment with the correct dependencies.
- 51:42And that's actually what I kind of want.
- 51:44That's actually what I want Python to feel like is, yeah, there's a virtual environment,
- 51:47but it's actually just kind of like the directories of, you know, it's kind of just like full
- 51:50of packages, full of your dependencies.
- 51:51And it just, you just use the right one at the right points in time.
- 51:55So that's, that's part of the shift that I want us to move towards a little bit.
- 51:59And it's part of why we're very virtual environment first and why we put the virtual environment
- 52:03right in the project in a specific known place, because we want to get away a little bit from
- 52:09this idea of where's the environment, how do I activate it?
- 52:11Do I have the wrong one activated?
- 52:13I want it to feel a little bit more like it is just sort of native to how the project works.
- 52:18Okay. If you're in the context of that thing, then it just uses the right one.
- 52:21Yeah.
- 52:22Is it, do you have intentions to do something?
- 52:24I can't remember the path, but something to the effect where if you're in a directory and
- 52:28there's no PyProject, Toml or virtual environment, but if you went up one or two, if we're both,
- 52:32would it fall to that one or would it just go, oh, we don't know?
- 52:35We do do that with uv run.
- 52:37So with uv run, we sort of find the root of the project.
- 52:41Yes, exactly.
- 52:41And we'll look up at parent directories.
- 52:43But we don't, but if you just run Python, you know, blah, blah, blah, obviously we don't hook
- 52:49into anything there.
- 52:50And so, you know, like with a lot of other things, like with uv run, uv lock, uv sync,
- 52:54like we, we create a virtual environment.
- 52:56If you use our commands, it's kind of just like everything just works, but you can also just like
- 53:00activate the virtual environment and like do whatever you want, because we're kind of trying to
- 53:03embrace the fact that virtual environments are like, everyone knows, not, you know, not everyone
- 53:08knows how to use them, but like people are familiar with them, editors and tooling like revolve around
- 53:13them.
- 53:13Right.
- 53:14Yeah.
- 53:14So things that try to eject from virtual environments tend to cause a lot of problems for editors and
- 53:20workflows.
- 53:21So part of embracing virtual environments, I think again, is like meeting the ecosystem where it is a
- 53:25little bit and being like, okay, the fact that we use virtual environments and they're just like in
- 53:29your project means that you don't need like a special, like editor integration to
- 53:33use uv, like, you know, like PyCharm.
- 53:35We'll just like let you use that virtual environment, which is a virtual normal virtual
- 53:38environment.
- 53:39Yeah.
- 53:39That's perspective.
- 53:40So that's, that's part, again, part of what we're trying to do is like build things that just
- 53:43work for people, and try and embrace, you know, the standards and the conventions while also,
- 53:49you know, maybe influencing or changing parts of them that we think could be, could be improved
- 53:55or could be made more user-friendly.
- 53:57Yeah.
- 53:57I don't know why I didn't book you for two and a half hour podcast, because that's what we're going to need.
- 54:01So Vincent from Comcode says, UV
- 54:03run is such a game changer may work on.
- 54:05He may work on a Jupyter runner for that this week.
- 54:08Feels like such a game changer, which is awesome.
- 54:10Cool.
- 54:10Yeah.
- 54:11Yeah.
- 54:11There's a lot of cool ideas too, around this sort of, sorry, good.
- 54:14Well, I was going to say with, with that in mind, let's dive into this whole project
- 54:18management stuff here.
- 54:20Right.
- 54:20Like this is, I think this is one of the, this is one of the three big pieces of functionality
- 54:25that comes.
- 54:25So, and you've been talking about this sort of, some of the features like uv run and so on,
- 54:30but let's, let's talk through, let's talk through like, yeah.
- 54:33I want to create a new project.
- 54:35Yeah.
- 54:35Yeah.
- 54:35Yeah.
- 54:36I want to create a project.
- 54:37I don't have the Python installed.
- 54:39It's a new project.
- 54:40I want to create a pyproject.toml, but I don't even remember the format for that.
- 54:44Yep.
- 54:44Let's go.
- 54:45How's that work?
- 54:45Yeah.
- 54:46So, so we have like a series of commands that kind of manage the project life cycle
- 54:51for you.
- 54:51So you can run uv init to create a new project.
- 54:54And it has a couple of flags based on whether you want to build like a library or command line
- 54:59application, whether you want it to be structured as like a Python package, or just kind of, maybe
- 55:04it's just an application that you're running on your machine.
- 55:06But uv init will create the project.
- 55:09You can then run uv add flask, uv add FastAPI, whatever to add dependencies.
- 55:14And when you run uv add, we'll automatically generate the lock file and sync the, sync the
- 55:18dependencies to your system.
- 55:19So we do have commands like uv lock to generate the lock file and uv sync to download the correct
- 55:27dependencies into your environment.
- 55:28But you can also just kind of use these life cycle commands and uv will make sure that everything's in
- 55:32the right state as you go.
- 55:33So you can run uv add, uv run.
- 55:36If you do uv run and then Python, blah, blah, blah, it's, it's, you know, what happens behind the
- 55:41scenes is we resolve the dependencies.
- 55:43We make sure the environment's up to date, and then we run that command in the environment.
- 55:46So the whole life cycle of working with your project can be managed through uv init, uv add,
- 55:51UV remove, uv run.
- 55:53There's a lot that goes into that.
- 55:56And there's also a lot of kind of powerful features built in here too.
- 56:00Like when you run uv run, it accepts a flag --with, so you can do uv run dash dash
- 56:06with and put a dependency there.
- 56:08And it will basically just download that, put it in an ephemeral virtual environment and make
- 56:14it available for the command.
- 56:15So you can just pull in one off dependencies as you need to run things.
- 56:19Like I never actually think about activating environments anymore.
- 56:23Like most of the time when I'm running Python commands to run one off tooling, I'm running,
- 56:28you know, uv run --with requirements.
- 56:30And I give it a requirements file.
- 56:32And then, you know, I pass the name of the file I want to run.
- 56:34And like, it, it just like builds the thing you need and runs the command and then throws it away.
- 56:39And because you have, again, we were talking at the beginning of this episode about how like
- 56:43really fast tools change the ergonomics.
- 56:45Like part of what we're trying to build here is like, if we have this packaging system, that's
- 56:49really fast, especially for like repeated operations.
- 56:52Like I need to keep pulling in, you know, I've downloaded this package before.
- 56:57I need to download it again, use it for this one command.
- 56:59Like we can just like throw away virtual environments and create new virtual environments,
- 57:02you know, in like in milliseconds.
- 57:03Yeah.
- 57:04So if this was a Python dash M V and V sort of, it would be way too much overhead.
- 57:11Yeah.
- 57:11Yeah.
- 57:12Yeah.
- 57:12Yeah.
- 57:12And so, you know, we can, we can just like, even like a bunch of dependencies,
- 57:16like they've been installed on your machine already.
- 57:18It's really, really fast just to pull these things together, use them and throw them away.
- 57:22So there's just a lot, there's a lot of things that we can do.
- 57:28And I think even like looking forward to the future, there's a lot of things we can do because
- 57:31we have this like performance foundation.
- 57:33Like, you know, I'm thinking about what if you want to test code on like a bunch of different
- 57:38Python versions.
- 57:38Yeah.
- 57:39Yeah.
- 57:39And maybe you don't want to like have to keep destroying and recreating your virtual
- 57:44environment or something like that.
- 57:45Like there's just, there's just a whole lot of stuff that we can build that would be really
- 57:48hard to imagine if you didn't have a really fast tool.
- 57:51Yeah.
- 57:51It's, it changed.
- 57:53It definitely changes what's possible.
- 57:54It's too sure.
- 57:55I'll put out an example that it's very near and dear to my heart.
- 57:58You know what would be great?
- 57:59If uv could build standalone binaries and embed Python into them.
- 58:04Yeah.
- 58:04Yeah.
- 58:05Yeah.
- 58:05That's an interesting space.
- 58:06It's not something we've built anything around, but yeah, I know it's being described there.
- 58:10Yeah.
- 58:11Yeah.
- 58:11I think one of the, what I've seen most of the things do is we'll do something like zip
- 58:16up a virtual environment or site packages or something and, and then put that in a binary.
- 58:22And then when you run it, it'll spit that out or maybe do a memory mapped sort of magic to try
- 58:27to map into that and unzip it into memory or all sorts of weirdness.
- 58:31And I think really for this to be easy, some somewhere along the way, I could be wrong, not
- 58:37a core developer, but I feel like Python's import behavior needs to be able to import from an embedded
- 58:44resource in a compiled binary rather than stick in a binary and have the binary do like weird things
- 58:51where it fakes out the path.
- 58:52Cause there's always like something that falls apart.
- 58:54But if the pip itself like say, okay, we can import from a memory stream and not just
- 58:59from file system, then these things would be like, oh, well, if that's the case, here's how you just
- 59:03embed those and off it goes, you know, it'd be more like go or so here's your one thing you run it.
- 59:08You know what I mean?
- 59:08Yeah.
- 59:09Yeah.
- 59:09There's definitely interesting stuff to explore there.
- 59:11And there's some interesting tools that exist already to try to facilitate some of those things.
- 59:17Yeah.
- 59:18It's also we've invested time in yet though.
- 59:20Yep.
- 59:21All right.
- 59:21Well, yeah, I was thinking in high app is similar.
- 59:23Yeah.
- 59:24Yeah.
- 59:24Py app is definitely, I've used py app before.
- 59:26Actually I have an app running in my system right now.
- 59:28It's in a little menu bar thing.
- 59:29That's a py app app and it works well.
- 59:31It does work well.
- 59:32Yep.
- 59:32Okay.
- 59:33so the project API is kind of like, you know, if you use you, if you've used like poetry or
- 59:39PDM, like these tools that are oriented around working on a project, and you have a py project
- 59:45toml that defines your dependencies and you might have some sort of structure.
- 59:48it's based around that kind of workflow of working on a project.
- 59:52which, you know, is that's like one way that people work with Python, but there's a
- 59:56lot of ways.
- 59:57There's a lot of things that people do with Python, which is why we have a couple of different APIs.
- 1:00:00Right.
- 1:00:00So we also have this tool API, like uv tool install, uv tool run, which we've alias to uvx.
- 1:00:09These are for running.
- 1:00:10This is interesting.
- 1:00:11Yeah.
- 1:00:12Yeah.
- 1:00:12These are for running like one-off, not one-off commands, but like things that you want installed globally.
- 1:00:17So like you might want rough installed globally on your machine so you can run it on a bunch of different projects.
- 1:00:22We call those like tools, and you install them, you know, similar if you've used pipX before we install them into dedicated environments, and put them on your path.
- 1:00:32and there's a lot of really cool stuff here.
- 1:00:35Like I now use uvx all the time when I want to run things.
- 1:00:38So I'll do like uvx ruff check and that translates to uv tool run ruff, you know, run the check command behind the scenes.
- 1:00:46What it does is it finds latest version of rough.
- 1:00:48It creates an environment with that version, and then it runs the command using, using the rough binary in there.
- 1:00:53and there's very, there's really no overhead to that.
- 1:00:57if you're kind of running it repeatedly.
- 1:00:59So, you know, this, this is oriented around like a different way of working with Python, where you have these tools that you need to run on your machine.
- 1:01:08And you use them for different things.
- 1:01:10so we have like the project interface for working on a project, and then we have the tool interface for running Python, you know, command line tools.
- 1:01:17Yeah.
- 1:01:18So uvx run, well, uvx is the run version.
- 1:01:22Yeah.
- 1:01:22And you've also got the install.
- 1:01:24I have some thoughts on when I might do one or the other, but the uv tool install seems like something you might want to run and have around and have auto complete in your shell.
- 1:01:34So I could type R U tab and get rough, or I could.
- 1:01:37Yep.
- 1:01:37Yeah.
- 1:01:37UV tool.
- 1:01:38I think for things you're going to run it repeatedly, it makes a lot of sense to install them.
- 1:01:42also if you have, like, if you ran uv toolinstall ruff, and then you ran like uvx rough, we would use the installed version.
- 1:01:51So if you already have the tool installed, we'll still pull the installed version, assuming it's compatible with the version request that you made.
- 1:01:58Yeah.
- 1:01:59Yeah.
- 1:01:59So like, yeah, I generally like uv tool install things that I'm going to run, you know, multiple times.
- 1:02:05the other really nice thing about uv tool install is we have uv tool upgrade.
- 1:02:10So you can do like uv tool upgrade --all and we'll upgrade all the installed tools.
- 1:02:14so you don't have to think about like, which tools do I have installed?
- 1:02:18Like what versions are they at?
- 1:02:19Are they out of date?
- 1:02:19so, you know, it kind of gives you a way to manage all the Python tools that you're using,
- 1:02:24at a, at a kind of global level.
- 1:02:26so, you know, we have a lot of commands, like in our docs, we have a lot of like automation tooling
- 1:02:32built around Python, like, you know, rough and uv are written in rust, but a lot of our like
- 1:02:35documentation tooling, like we have a lot of scripting in Python.
- 1:02:38and all of our docs now in the doc string at the top have like the uvx command that you run to
- 1:02:44like run the script.
- 1:02:45Nice.
- 1:02:46And so I just like copy that and paste that.
- 1:02:48And then the script just runs with all of its dependencies.
- 1:02:50So, so it's like, it's just super, it's just very, very convenient.
- 1:02:57I think, like all these are APIs and the way they come together.
- 1:03:00and, there's a lot, I know it's a lot of different stuff.
- 1:03:04And that was actually my biggest fear with this release was it's hard to succinctly explain
- 1:03:09what this release is, because it's a lot of different things.
- 1:03:13And it's not like when we released uv or in February, when we released uv in February,
- 1:03:17it's like, this is a new tool.
- 1:03:19It, if you know, Pip, you understand what this is, right?
- 1:03:21It was much easier to explain, I think in a succinct way, like what we're doing.
- 1:03:25and in this release, it's like, it's actually like a lot of different stuff that comes together
- 1:03:30to tell what I think is a very coherent story, but it's hard to succinctly explain exactly what,
- 1:03:36what, you know, what we did.
- 1:03:38and I was very like the response to it.
- 1:03:42I was really heartened, you know, to see that people were, people were like getting
- 1:03:48it and they were getting different parts of it.
- 1:03:50Like different parts of it were speaking to different people.
- 1:03:52because I actually think different parts of it are like relevant to different ways that
- 1:03:55people work with Python.
- 1:03:56So a lot of people were excited about, you know, the lock files, the uv run.
- 1:04:00A lot of people were excited about the fact that we have this like scripting API.
- 1:04:04So you can like have these standalone scripts where the dependencies are embedded in them.
- 1:04:08And if you do uv run that script, you know, we just resolve the dependencies, download,
- 1:04:13download them and run the command with those dependencies available, run the script with
- 1:04:16those dependencies available.
- 1:04:17So you can have these like hermetic Python scripts.
- 1:04:19you know, we had the Python install API.
- 1:04:22So there were just different things that were resonating with people, which I think is what
- 1:04:24made me happiest in the response to it.
- 1:04:27Did you read, I'm sure you read Armin's Ryan uv August is harvest season of Python packaging.
- 1:04:33Yeah.
- 1:04:33Yeah.
- 1:04:33That's a pretty positive take and a pretty wide ranging recommendation there.
- 1:04:39It's, it's pretty interesting.
- 1:04:40Yeah.
- 1:04:40The relationship with Rye is something we get a lot of questions about.
- 1:04:43and you know, I think like,
- 1:04:47when we, you know, when we took over Rye, the goal was always like, we want to build
- 1:04:52UV up until to be a suitable replacement that people can migrate from ride to uv.
- 1:04:57but, and we're getting further along that path, but there's still like things we're
- 1:05:03missing.
- 1:05:03we don't plan on like deprecating Rye any, you know, anytime soon, but all of our
- 1:05:07like new feature development is really happening in uv and riots mostly like bug fixes, like keeping
- 1:05:12things up to date.
- 1:05:12so, you know, Rye has actually benefited a lot from uv.
- 1:05:16Cause it uses uv under the hood.
- 1:05:18So like Rye has just gotten like, there's new features or there's, you know, it's gotten
- 1:05:22faster.
- 1:05:23but you know, our goal is really to like find the things that are missing from Rye and
- 1:05:27make sure we can support them in uv.
- 1:05:29Yeah.
- 1:05:29Last one we've got to cover here is you have any, points out single file scripts with dependencies.
- 1:05:36That's the last one, the script execution.
- 1:05:38So yeah, one of the huge problems is I, one of the reasons I think, Tushar was suggesting
- 1:05:44it and I'm also really excited about it is if you could bundle your code into an application,
- 1:05:49one of the benefits is you don't have to have a conversation with everyone that runs it.
- 1:05:53Yeah.
- 1:05:54How to do virtual environments, how to do package management, all this kind of stuff.
- 1:05:57You just say, run, click it or, or whatever.
- 1:05:59And somewhat short of that is I want to give you just a script of some sort, but, and just say,
- 1:06:06run this, right?
- 1:06:08Here's the script app.
- 1:06:09You have an example.py to run that.
- 1:06:11But if you put some sort of magical incantation, which it's backed by a PEP to say what it actually
- 1:06:17requires then uv --script, something, it'll just see that and go, okay, or uv run rather.
- 1:06:23It'll see that install the pieces ephemerally, right?
- 1:06:26And run.
- 1:06:27That's, that's pretty cool.
- 1:06:28Yeah, exactly.
- 1:06:28So as our kind of our last thing before we run out of time.
- 1:06:31It's really cool.
- 1:06:31This is, this is backed by a PEP.
- 1:06:33I think it's seven, two, three, if I recall correctly.
- 1:06:36So this is like a standardized, this syntax at the top of the file is standardized.
- 1:06:40might not be mentioned somewhere.
- 1:06:42Yeah.
- 1:06:43There's a bunch of PEP conversations, but not the one.
- 1:06:46Not a real.
- 1:06:47Yeah.
- 1:06:47We sometimes try and like shy away from talking about user facing features in terms of peps.
- 1:06:52yeah.
- 1:06:52It's because.
- 1:06:53There you go.
- 1:06:54It's not.
- 1:06:54It's not.
- 1:06:54It's not.
- 1:06:55Three.
- 1:06:55That's it.
- 1:06:55Yeah.
- 1:06:55Okay.
- 1:06:55Well, there it is.
- 1:06:56but anyway, the, so the idea here is like, you can declare the dependencies for the
- 1:07:02script, right in the script.
- 1:07:04And then when you do uv run that script, we read that dependency data and we've run the script
- 1:07:09in an environment with those dependencies.
- 1:07:10so, the other, I think really cool piece here
- 1:07:16is I talked before about uv ad.
- 1:07:19So if you're in a project with a PI project, you can do like uv ad, FastAPI or whatever,
- 1:07:24but you can also do that for scripts.
- 1:07:27So if you scroll, if you look for like uv ad --script.
- 1:07:31So you referred to this like magical incantation at the top.
- 1:07:33We will actually like create that for you.
- 1:07:35So if you do uv ad --dash script, and then the script name and the dependencies, like we'll actually just like put that stuff in there for you.
- 1:07:42So you don't actually have to like remember how to do that.
- 1:07:44Like you can just do uv run ----script, and we will actually like populate that field.
- 1:07:50So you can create a script.
- 1:07:52You can manage the dependencies in it with uv.
- 1:07:54You can run it.
- 1:07:54This is like super useful.
- 1:07:57There's some interesting conversations happening now too around like, what if we want to have a lock file for these?
- 1:08:02Because it's a little bit different, right?
- 1:08:05This is a, this is the list of dependencies.
- 1:08:07It's not the list of resolved versions.
- 1:08:08So if you wanted to have like full reproducibility, you probably want a lock file.
- 1:08:12And the, not just these things versions, but they're the transitive closure of all the dependencies.
- 1:08:19Correct.
- 1:08:19You know, everything they depend on.
- 1:08:22Yeah.
- 1:08:22Yeah.
- 1:08:23So, you know, we do that for projects.
- 1:08:25Like if you do uv lock in a project, we create this lock file.
- 1:08:28That's all the transitive dependencies.
- 1:08:30It locks the exact URLs, the hashes, the versions, everything.
- 1:08:34We don't do that right now for scripts, just because there's no,
- 1:08:37there isn't really a place to put it.
- 1:08:38Yeah.
- 1:08:38But we're kind of thinking about, like you could go on scripts.
- 1:08:40Have you considered the Windows registry?
- 1:08:42I mean, you could always just like integrate that and import that over to Mac and Linux.
- 1:08:46That'd be fine.
- 1:08:46Yeah.
- 1:08:47Just put everything in the Windows registry.
- 1:08:48Yeah.
- 1:08:49That's a, that's a winning idea.
- 1:08:51Yeah.
- 1:08:51No, I totally get it.
- 1:08:53Yeah.
- 1:08:54I mean, the other thing that's interesting too, is like the notebooks, like people are thinking about
- 1:08:57how can we add this kind of functionality to notebooks and, you know, being able to declare
- 1:09:02the dependencies for a notebook right in the notebook, being able to lock them too.
- 1:09:06There's a lot of cool stuff that we can build now that we have all these primitives connected.
- 1:09:10Yeah, for sure.
- 1:09:11I mean, you could do something like take a hash of the file and then use that hash as the name
- 1:09:15and as long as the file doesn't change, it'll run the same.
- 1:09:18I don't know.
- 1:09:18Yeah.
- 1:09:18Yeah.
- 1:09:19There's, I'll leave that to y'all.
- 1:09:21So I think, I mean, we didn't even talk about the speed for some of these things and there's,
- 1:09:26there's a whole lot of stuff here, but.
- 1:09:28There's a lot of good stories to tell about how we made some of these things,
- 1:09:31the problems we had to solve to like really some of this stuff, but they'll make for,
- 1:09:37you know, if I dream they'll make for good blog posts.
- 1:09:40In reality, they'll probably make for good Twitter threads.
- 1:09:42Yeah.
- 1:09:43Yeah.
- 1:09:44Absolutely.
- 1:09:44All right.
- 1:09:45Well, Charlie, thanks for being here.
- 1:09:47Maybe give us a final thoughts and words for folks who are interested in this, this new layer of uv.
- 1:09:53Yeah.
- 1:09:53I mean, I think like this is, this release is really different from the previous release in
- 1:09:59part, because we designed and built a lot of stuff that's pretty new for people and also requires
- 1:10:05people to, to change their workflows in a lot of cases.
- 1:10:07Like the previous release, it was like, this is a lot like pip.
- 1:10:10So kind of just drop it in.
- 1:10:12And now it's like, here's a bunch of ways to use this tools.
- 1:10:14If you work, you, it does require you to work a certain way and kind of think a certain way,
- 1:10:18but we think it's really powerful.
- 1:10:19And that's all stuff we're like kind of trying to figure out.
- 1:10:23Right.
- 1:10:23So we're very eager for, you know, I'm sure, I'm sure all this stuff will change and I'm just
- 1:10:28eager for like, like every release.
- 1:10:30I'm just excited to have it out, have people testing it, have people using it so we can get feedback.
- 1:10:34And so, you know, I would love for you to try it out.
- 1:10:38I'd love you even more for you to come file issues about the things that don't work so we can make
- 1:10:42it better and better.
- 1:10:42But I think we have a really cool foundation here.
- 1:10:47We can build a lot of things that hopefully make working with Python a lot, you know,
- 1:10:52a lot easier in the sense that the tools kind of get out of your way rather than getting in your way.
- 1:10:58So yeah, that'll be our focus for the next, for the next while is, is seeing how people are using
- 1:11:03this stuff and seeing where we can make it better.
- 1:11:04Well, I think it's pretty awesome what you're up to.
- 1:11:07Big fan of uv.
- 1:11:08So happy to see the project.
- 1:11:10Thank you.
- 1:11:11I appreciate it.
- 1:11:11And always happy to have you on.
- 1:11:13So thanks.
- 1:11:13Thank you.
- 1:11:14Yeah.
- 1:11:14See you later.
- 1:11:15Bye.
- 1:11:15Bye.
- 1:11:16Bye.
- 1:11:16Bye.
- 1:11:17This has been another episode of Talk Python To Me.
- 1:11:19Thank you to our sponsors.
- 1:11:21Be sure to check out what they're offering.
- 1:11:23It really helps support the show.
- 1:11:24This episode is sponsored by Posit Connect from the makers of Shiny.
- 1:11:28Publish, share, and deploy all of your data projects that you're creating using Python.
- 1:11:33Streamlit, Dash, Shiny, Bokeh, FastAPI, Flask, Quarto, Reports, Dashboards, and APIs.
- 1:11:39Posit Connect supports all of them.
- 1:11:42Try Posit Connect for free by going to talkpython.fm/posit.
- 1:11:46Want to level up your Python?
- 1:11:49We have one of the largest catalogs of Python video courses over at Talk Python.
- 1:11:54Our content ranges from true beginners to deeply advanced topics like memory and async.
- 1:11:59And best of all, there's not a subscription in sight.
- 1:12:01Check it out for yourself at training.talkpython.fm.
- 1:12:04Be sure to subscribe to the show, open your favorite podcast app, and search for Python.
- 1:12:09We should be right at the top.
- 1:12:10You can also find the iTunes feed at /itunes, the Google Play feed at /play,
- 1:12:16and the direct RSS feed at /rss on talkpython.fm.
- 1:12:19We're live streaming most of our recordings these days.
- 1:12:23If you want to be part of the show and have your comments featured on the air,
- 1:12:26be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
- 1:12:30This is your host, Michael Kennedy.
- 1:12:33Thanks so much for listening.
- 1:12:34I really appreciate it.
- 1:12:35Now get out there and write some Python code.
- 1:12:45I'll see you next time.
- 1:12:46I'll see you next time.
- 1:12:47Bye.
- 1:12:47Bye.
- 1:12:48Bye.
- 1:12:49Bye.
- 1:12:50Bye.
- 1:12:51Bye.
- 1:12:52Bye.
- 1:12:53Bye.
- 1:12:54you
- 1:12:54you
- 1:12:55you
- 1:12:55Thank you.