#458 I will install Linux on your computer - podcast episode cover

#458 I will install Linux on your computer

Nov 17, 202523 minEp. 458
--:--
--:--
Download Metacast podcast app
Listen to this episode in Metacast mobile app
Don't just listen to podcasts. Learn from them with transcripts, summaries, and chapters for every episode. Skim, search, and bookmark insights. Learn more

Episode description

Topics covered in this episode:
See the full show notes for this episode on the website at pythonbytes.fm/458

Transcript

Michael Kennedy

Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds. This is episode 458, recorded November 17th, 2025. I'm Michael Kennedy. And I'm Brian Okken. And this episode is brought to you by us. All the things that we're doing. We have many fun and useful things to offer you.

pytest books, pytest courses, Python training courses, the agentic AI programming course about how you take agentic AI and turn it from like weird wizardry smushiness into engineering. It's going incredibly well. So check that course out. Follow us on the socials. Put them by set up slash live if you want to see this live or streaming live or see the old shows. And be sure to sign up to our newsletter. We have tons of people really getting a lot of value with that. Brian's putting that out.

And yeah, it's truly nice. It's not just the links of the show notes, but it's extra deep information, background information, that kind of stuff. And the joke, always the joke, Brian.

Brian Okken

Always the joke. And we put a link to the joke, if we can find a link to the joke, in the newsletter as well.

Michael Kennedy

Exactly. Sometimes the joke has a link, and sometimes it's just like a dad programming joke, and it just has words. What do you want to talk about first?

Brian Okken

I actually want to talk about Django. Oh, really? Okay. And actually, kind of lightweight, I want to talk about the Django website. I guess I heard about this, but there was a discussion about maybe redesigning the Django website. It's been the same for a while. And it works. It's good. But I noticed Adam Hill put out a mock-up for what the Django website might look like. So here's his new one. And I'm kind of liking it. I like the animated thing at the top. It's the task framework.

It's the web framework.

Michael Kennedy

Did Django just jump like 20 years into the future? Yeah, it looks... From where it was to the current day, it was. It looks pretty good.

Brian Okken

It's got like search documentation at the top that's really easy to find. I mean, I guess there was... Yeah, there's no... I don't know where you have to... The search documentation isn't at the top here. I like the search there. I'm liking it. I like just the life of it. Feels good. I think that maybe we should go with it.

but you know it's just my vote but that you can you can join the discussion too if you'd like to help out and and there is some assistance that that adam hill is okay with so there's and it's not just him if you i'm putting a link to a discussion uh where he announced what his little his demo um he said i'd love help with in the form of prs to the repo explicitly not looking for drive-by critical feedback without PRs. It's fine. I guess here's my drive-by feedback. I like it.

I know that's not really, but I do like it. And, but you can read, it looks like he kind of picked this up off of other, there was other work. Just a reminder that this doc informed my approach. So there's another document about things. I didn't look at it actually, but the discussion's been going on for a while, if I scroll to the top, there's been a discussion on, let me do this, up to September 21st. Oh, it looks like he started it, that maybe we ought to redesign the website.

It's not too long, man, September 21st to now. But I think that it'd be cool to give. Why not? Let's go for it.

Michael Kennedy

You know what? I think, look, Django's a web framework. It should not look like it's, you know, 15 years old and outdated and rusty. I mean, it's a project that's getting tons of love and attention. And I think it's a really good idea to make it feel like it belongs at the cutting edge of web development these days. And, you know, just that website is aged. Yeah, it's like a long time,

Brian Okken

right? Yeah, it is a long time. But also, even if the it should be a the to make it feel alive, also the website could be in progress. It could change also. Not that, I mean, even if this one doesn't, I mean, maybe this is great and this will be great for, the new one will be great for a long time. But I think that we should be tweaking it on a regular basis just to make sure people understand that it's still moving. Yeah, absolutely.

Michael Kennedy

And hat tip to Adam Hill. That is a very nice looking website.

Brian Okken

Yeah, I think it's neat. Plus, I love that. I got to say, I love the documentation at the top, the search docs, because I often just go there, because I'm used to going to a project homepage to search the docs. So, yeah. Yeah.

Michael Kennedy

All right, what you got? I want to dive into some concurrent database stuff. So I want to talk about aiosqlitepool. So there's three concepts here. Async IO, SQLite, and then a connection pool type of thing. So normally you just work with SQLite And it just says, hey, let's go open up all the infrastructure to talk to the SQLite database and do your work. And then it closes it. Then it opens it. Then it closes it. Then it opens it. And that's not necessarily the fastest way to do that.

Maybe you could just leave it open. But you don't want to leak these connections or have a whole insane ton of them open. So instead, the idea is to use this connection pool. So you say, instead of giving me a connection, you say, give me a connection from the pool. Right. And it'll keep a certain number of them open and hand them over to you when it needs or wait. If there's already 10 connections running queries, you probably can just better off to wait and try to hit it with another.

So that's what this is. And it's not a replacement. Maybe people have heard of AIO SQLite. AIO SQLite is a way to talk async and await, but to SQLite. And all this is a little bit funky and interesting because SQLite is a file that runs in process. It's stored as a file and it's a thing that runs in your Python process. So you're not going out to the network and waiting and that kind of thing. But this AIO SQLite gives you an async programming model.

But the way it works is you create a connection, do a query, and then when you do async with, when that with block, that context manager closes, the connection's gone. So over and over, it's kind of up and down. And so the idea is this aiosqlitepool wraps this SQLite library for basically three core problems. One, it tries to eliminate connection overhead by avoiding repeatedly opening and closing syscalls, mem allocation, teardowns, all that kind of stuff, right? Which I already described.

It also has the advantage of potentially faster queries via hot cache. So long-lived connections keep SQLite's in-memory page cache hot, right? So once a database has seen a query, it has to look at the query and say, okay, we're going to come up with a query plan. Do we use this index? Are there any indexes? How are we going to sort it? Is it a table scan? There's all these things, right? And that has to be determined for a query. So it could be kept around and reused better, potentially.

And maximize the connection throughput. So there's a bunch of stuff in here and some examples and so on. Again, similar programming model with connection with async width, but you get a connection from the pool. Somewhere down here, though, there are some stats, I do believe. Yes, the very, very bottom. Let's see. It says just doing 100,000 complex read operations across 20 workers with a reasonable-ish database setup, 5 million comments, 10 million likes, 100,000 posts.

And so like real data, not just like there's three items, query them, which one is, you know, which one's bigger than one. Anyway, with all that, it says what's your throughput without the pool? You get 3,000 operations a second with it. You get 6,000.

basically for all the metrics you care about it's like a 2x improvement almost not quite but almost so like throughput's almost double the latency's almost half more than half um better than that um so on right so instead of 60 milliseconds it's 20 milliseconds response time that kind of thing so

Brian Okken

why not you know if this is easy to use so you're gonna like maybe i'm dense but the i can use this and I can have multiple async or multiple parts of my process accessing the same file at the same time?

Michael Kennedy

Yeah.

Brian Okken

Okay.

Michael Kennedy

Yeah, SQLite supports concurrent access. And especially if you're reading, there's no problem reading the file in parallel.

Brian Okken

Yeah.

Michael Kennedy

Right? So, yeah. Anyway, if you're doing SQLite stuff and you're doing async stuff, check this out. There may also be a SQLite pool that is not async. I have no idea. I haven't looked at that. But once you get to the point where you're like, I'm worried about concurrent speed access to my database, you know what, you're probably already in async land anyway. So here you are. Yeah.

Brian Okken

So the answer is, yes, you're dense. And I'm going to answer you anyway. But no, thanks.

Michael Kennedy

Yeah, yeah.

Brian Okken

All right, over to you. OK. I am going to-- I'd like to talk about dependencies a little bit. Last week-- I think it was last week-- We talked about pipdeptree and uv pip tree. And those are great things. This sounds similar, but it's not. I'm going to talk about DEPTRY, D-E-P-T-R-Y. And I'm pretty sure this was recommended by somebody, but I couldn't find the reference. So I'm sorry for losing your name, but thanks to everybody for suggesting topics. So Deptree is D-E-P-T-R-Y.

And what it does is it's a command line tool to check for issues with dependencies in a Python project, such as unused or missing dependencies. So the idea is like, so I appreciate the unused part. The missing dependencies I'm probably going to catch and test, but hopefully, but maybe you don't have thorough tests. So if you're importing something and it doesn't show up in your requirements file or your Python project.toml, it'll flag that. And the reverse is true too.

So if you have a dependency listed, but maybe you refactored your code and you're not using that dependency anymore, it'd be nice to find out that you don't need it. So that's pretty much what it does. But I really wanted one. And it's pretty easy. You install it in your project and then you run it. and it scans everything and lets you know if, hey, you've got, for instance, NumPy is imported, but you didn't declare it as a dependency.

And it does have this idea of development in dependencies versus project dependencies, and that's the part that tripped me up a little bit. That's the switch. It's either development dependency or a project dependency. And it's unfortunately super easy to get started and really easy to get tripped up by it. And I got tripped up because I use optional dependencies for tests often. So I'll do something like list test. In my project, I'll say project optional dependency.

For test, I've got pytest and all my pytest plugins. And then maybe doc for docs for all of my make docs or something to build the documentation. Pretty standard. But what Deptree does is it finds these optional dependencies and just includes them in your normal dependencies because it might be your CLI or your GUI, which is interesting. I guess I don't get why your GUI or your CLI would be optional, but maybe two choices.

Michael Kennedy

I don't like it either, but I think I've seen it like I want to install this and only have the CLI or I want to install this. And I do also want to have the GUI and the GUI install might be super heavyweight. You know what I mean? It's just a way to say I want less instead of like the union of all possible use cases.

Brian Okken

Actually, I. Oh, cool. I've got a. I wonder if I can work this as a test in test suites because there's times where I want some. Anyway, I'm getting off on a tangent, but I think this would be fun to play with with test suites. Why I'm going down this rabbit hole is because the most common thing in the usage and configuration, it's like buried in here. But if I look for a pytest, I'm going to have to look for it a couple of times, I guess. Here we go.

So optional dependencies test of pytest, you have to list it out as you have to add this big pip dep tree or tool dot dep tree and then pep621 dev dependency groups. this is kind of verbose guys, but that's what you got to do. And if you do that, it all works fine because I just like tried this out on a simple project and it said, you're in, you've included pytest, but you don't import it anywhere. No, I don't import it anywhere. I'm using it for my test.

Michael Kennedy

Do you understand what this is for?

Brian Okken

So I'm a little thrown that I think, I think maybe I'll suggest that this, that the, their example of using your depend that the dev dependency groups are at the very least test and docs. And I think that that should be the default. I don't think you should have to declare that. You know, if, if, if you've got a tests or docs, it's, it's probably a development dependency, not. But anyway, I had fun with it. I tried it out. I do like the, it's not a whole bunch of rules.

The rules are like projects should not contain missing dependencies, should not contain unused dependencies, should not use transitive dependencies. That's interesting. Yeah, I kind of agree. You don't depend on-- if something's depend getting imported or installed because you installed something else, that third party package might refactor and not include that. So yeah, you should-- Yeah. Yeah. --transitive. Anyway, I think a fun project.

Michael Kennedy

And yeah, I'm going to check it out a little bit more. Very cool. Henry out there says those tests and doc dependencies should be dependency groups nowadays.

Brian Okken

Okay.

Michael Kennedy

I appreciate that. I don't do nuanced stuff enough to know. So yes, thanks, Henry. Thanks for that homework, Henry. Yes, exactly. Thanks for the homework, man. So you know what? I could find myself on a server or just the terminal, and I'm trying to figure out why are some of my dependencies missing? Where are my files even? What's going on, Brian? And I came across this thing called Juftin Browser.

Drop the E. So it's a little bit too Web 2.0y, but it still has the O, so I don't really know what that means. Anyway, what it is, is this is a really neat tool that is basically an interactive keyboard-driven and mouse-driven experience, like a Finder or Windows Explorer, but for your terminal and works over SSH.

So if I SSH into a server, I can say Browser in a folder and it gives me a tree of all the folders i can arrow through them i can click through them and then expand and when you click on them it will show on the right the file and on the

Brian Okken

left the tree of the area starting from where you ran it and down isn't that cool that is pretty cool

Michael Kennedy

yeah and it has yeah it has um basically the viewing for the files it has context highlighting you can even show images and a couple other things like that so really neat and i think if you're doing anything super terminal based i know you can run on your local machine but i don't know here's a little tip for people who don't know if you're in a folder on mac os you can type open space dot and that will just bring a binder there in windows you can say start space dot and it will open up

windows explorer focused in that folder so if you're in the terminal you want like a brow like a GUI like thing you're pretty close you're pretty close to having it you got to type browser anyway if you want to get this thing to start. But if you're on an SSH connection to a server, well, there is no alternative but to just LS your way through. And this is a really nice way to just kind of flip through and exploit what is in here.

And as you move through the files, it displays them with syntax highlighting. I like it. I think it's super, super useful. It's going to be part of my server maintenance toolkit, I think is what I'll say.

Brian Okken

Yeah, it's fun. I, you know, I'm also one to possibly just use open. for that, but also or just cheat and just say code space dot and open and have the tree directory. I think the O is necessary in the name so that it's bro. So bros or maybe. Bro.

Michael Kennedy

Yeah. If you don't, it's not on the GitHub, I don't think, but if you click their domain, which is effectively like a read the docs type of thing, you can actually see it in action. with a little animated screen recording. We love animated screen recordings. Yes. So, so nice. So. Cool. All right. What you got extras?

Brian Okken

I just have a show and tell extra because I went to an estate sale a couple weeks ago and I got a fun gift that, or a fun little thing that I just picked up. And so I was going to show it off, show and tell. I got this book called Micro, Understanding the Micro. And it's microcomputers, how they work and what they can do. And I flipped. It's sort of fun. It's got like, you know, it's for kids and stuff. But in the back, there's a buyer's guide. And I flipped back.

I'm like, well, does it have mine? And yeah, sure enough, the TRS-80 color computer. That was when I started.

Michael Kennedy

Okay.

Brian Okken

Fun little book. And I haven't read much of it yet, though. but it should be fun. It even talks about basic programming and stuff like that. It's fun.

Michael Kennedy

Nice. You see, Brian, I was definitely later in the computer hardware game. My brother had a Commodore 64, but I saved up when I was in high school and I got myself a 486 DX, not the SX, but the one with the floating point processor and 33 megahertz. That's where I started off.

Brian Okken

I think that's close to what I had. I think I must've been ahead of you a little bit. I bought a 486 IBM 46 when I was in college so that I could do homework on it. And I think the first thing I bought was Turbo Pascal for it. Nice.

Michael Kennedy

I think the first thing I got was MechWarriors. Yeah. Yeah. All right. Awesome. Well, there's a whole bunch of stories from that era, but let's go back to this era. And I just want to say, since you gave the recommendation of John Papa's Peacock, I've been playing with it. It is so good.

that's fun right it is really really useful and what i didn't realize the way it works is if you are in something like cursor or vs code or whatever and it has you have to create a workspace not just open a directory but once you create the workspace it embeds your like styling for that project into the workspace file so it syncs across machines naturally by just doing git push get pull oh and So yeah, it's a little bit extra like that. So that's pretty cool.

Anyway, I just want to give a shout out to a follow up to that, I suppose. Like, yeah, that was awesome. Still is. Cool. I guess I have, do you have more extras? No, without further extras.

Brian Okken

I had one that I kind of forgot to say. I am still working on the Lean TDD book and I'm almost done with the building on test-driven development chapter. So finally, with a book like TDD in the name, I finally talk about TDD in it. I haven't released that yet, but I'm hoping to release that later today or maybe tomorrow.

Michael Kennedy

Oh, very cool. Awesome. I love it. Anyway. That's great. I love the idea. And Brutus out there says, Peacock is awesome. I used it since last week when you talked about it, Brian. Thanks. Cool. Yeah, I love it. Yeah, I do too. All right. Let's do our joke. So, you know, people have threats. They can be empty threats or scary threats. You know, like, I'm going to tell the world about this thing that you did weird. Or I'm going to find you. I'm going to punch you in the gut or whatever.

But that's not a very common thing that programmers do. Now, programmers have a different version. I will find you and I will install Linux on your computer.

Brian Okken

Yeah, that's extreme.

Michael Kennedy

Yeah, you know you've messed up when someone gets over and you're like, Aurora? All right. Who did this? What is this? Reminds me of the, I'm having the bios flavor

Brian Okken

of the slushies or the frozen yogurt or whatever. Yeah. I will downvote your Hacker News article.

Michael Kennedy

No. Oh yeah, exactly. I will definitely downvote your Hacker News article. Or, you know, this also reminds me of like some of the jokes people used to play. Oh my goodness. especially with Windows, if you could change the background image.

Brian Okken

Oh, yeah. To the blue screen of death.

Michael Kennedy

Change the background image to the blue screen of death. Or I know when Vista came out, people were super like, do not put this on my computer. And the IT people were installing it. I know someone who took a screenshot of Vista, put it onto someone else's computer, and then tasked their Explorer or something like that. And so they didn't have any. Oh, that's funny. They had no thing overlaying it, so it just, like, no, they didn't. And they, like, click around. Like, I told you it wouldn't work.

Nothing even clicks here. Yeah. I will find you and do stuff your computer is pretty fun. But this one is I will find you and install Linux in your computer.

Brian Okken

That's funny. Yeah. Be careful whose child you had booked.

Michael Kennedy

Exactly. Well, I'll tell you what. I'm not actually going to go install Linux on anyone's computers, other than particularly mine. So no threats here.

Brian Okken

Yeah.

Michael Kennedy

Although, Henry does point out that these days, maybe the opposite is more threatening. I'll find you and I'll steal Windows 11 on your computer. Yeah. Oh, there's a lot of bad ideas shown in the chat. We're not going to share. They're great, though. Made me laugh. No, they're good. Thank you, everyone. See you all later. Bye. Bye.

Transcript source: Provided by creator in RSS feed: download file
For the best experience, listen in Metacast app for iOS or Android