Python Bytes - #400 Celebrating episode 400

Episode Date: September 9, 2024

Topics covered in this episode: Python 3.13.0RC2, 3.12.6, 3.11.10, 3.10.15, 3.9.20, and 3.8.20 are now available! Docker images using uv's python 10 years of sustainable open source - Read the Docs... humanize Extras Joke See the full show notes for this episode on the website at pythonbytes.fm/400

Transcript
Discussion (0)
Starting point is 00:00:00 Hello and welcome to Python Bytes where we deliver Python news and headlines directly to your earbuds. This is episode 400. Woo! How about that? Yay. I'm Michael Kennedy. And I'm Brian Ocken. And this episode is brought to you by Scout APM.
Starting point is 00:00:16 Check them out. Links to the podcast players' show notes are on the website and we'll tell you more about them later. Connect with us over on Mastodon. Links in the show notes. And hopefully you're watching us live now on Mondays. Usually you can find out by going to pythonbytes.fm slash live. And usually we have the next one scheduled and you can get notified about that. And for those of you who would like, even if you missed the show, a quick digest, an
Starting point is 00:00:41 artisanal handcrafted digest of all the things we talked about for the week Just become a friend of the show sign up for the newsletter by them by set up M's click on newsletter Well before we get into the topics Officially Brian, I think we got to say a little bit something about 400 Yeah, it's quite a big number so big that you are an amazing how the butterfly. Yeah It's cool. Well, I honestly I want to start by saying one, thanks to you, too. Thanks to the 1000s and 1000s of people who listen every week make this possible, honestly, and I really, really appreciate
Starting point is 00:01:15 it. Yeah, thanks to you, too. I'm whatever year it was, when we started, you reached out to me and said, Hey, well, do you feel like doing a podcast together? And I really wouldn't have thought we would have been at 400 episodes. This is pretty cool. I know it's, it's incredible. And I thought, well, we don't have really any guests or a lot of like, uh, you know, forum stuff, so let's celebrate this.
Starting point is 00:01:35 I asked chat GPT to say, I said, look, there's this big milestone. Could you just give us a quick celebration sort of thing? And I think there's a few things that are notable before I read this off. It's pretty short. So, but I think it's notable that it knows about you, knows about me, knows about the show, knows about what the show is about and the topics we've covered. So anyway, here we go. This is ChatGPT celebrates episode 400 of Python Bytes. Welcome to the big four zero zero Pythonistas. It's hard to believe we're celebrating the 400th episode of Python bytes from the early days of bite-sized Python news to becoming the source of all things Python. It's been a wild ride. We've laughed over the quirks gasp at new libraries and said,
Starting point is 00:02:14 farewell to the gill together, whether you're a seasoned developer, a curious learner, or just here for the witty banter, you've been an essential part of this journey to Michael and Brian. You've built a community that turns import this and more than just Zen. It's a family of passionate Pythonistas. Your dedication, insight, and humor makes this show more than just tech news. It's a weekly celebration of what we love about Python and why we keep coming back for more. Here's to the next 400 episodes.
Starting point is 00:02:39 May your code be bug free, your test pass on the first run and your Python version always be up to date. Rocket snake emoji. That's pretty good, isn't it, actually? Yeah, yeah, I'm touched. Chat GBT, I didn't know you loved me that much. I know, thank you, Chat GBT. And Michael, that's just touching.
Starting point is 00:02:57 It is. It's pretty cool, actually. I like that. Turns import this into more than just in. Indeed. I see some thank you out in the audience and thank you
Starting point is 00:03:07 all you guys out there. With that, shall we talk about whatever you want to talk about first? Sure. As we've done 399 other times,
Starting point is 00:03:16 apparently. Yeah. Let's talk about Python. Specifically, Python 3.13. It's just right around the corner. The official release is scheduled for
Starting point is 00:03:27 uh the 313.0 is supposed to come out in october on october 1st that's just right around the corner that's hard to believe so 313.0 candidate release or rc2 is out um so that was released September six, a few days ago, and I'm linking to a Oh, I didn't link to the right thing. But there is Oh, well, I'll just talk about it here. Anyway, it comes out October 1, Lucas Langa, which we will link to his post has a post to talk about it as well. Also talks about three, a few other releases, there's, there's security releases for 312 311 310, three, nine and three, eight. It's a lot of releases. And an interesting thing about the older releases, I'll cover those first, is that three, let's see 312 has a has a Mac release has has binary releases and the Mac release is only for 10.13
Starting point is 00:04:28 or newer. If you've kept up to date, like fairly recently, it should be fine. Cause I looked at mine and it was way past that. Um, but there, there is a limited, there are limits to the Mac OS, uh, binary version and all of the, um, all the others like three 11 through three, eight, they don't they're not they don't have binary distributions built, which is interesting. But anyway, so so those what we're really excited about is 313. Of course, it's coming out right around the corner, there's a call to action here. That is a strong encouragement for third party Python projects, and maintainers of third party projects
Starting point is 00:05:05 to prepare your projects because people will be upgrading in October because all the last upgrades have been so easy. People are going to upgrade. So make sure your projects are ready. Go ahead and start testing on them. And if there's any issues, submit to the bug tracker um and then also please keep in mind that this is a the rc2 is a preview release so it's close to the final release but it's not recommended for production environments so yes test with it don't run in production yet so that's cool the one thing that i thought was interesting so i i i've i've kind of migrated we We talked about this recently. Is upgrading your local Python with uvPython? You can't use that for 3.13. So you still have to use python.org or some other mechanism to install 3.13.
Starting point is 00:05:56 You can't do that through uvPython yet. Yet. Yeah. Actually, one of my items touches on that. So we'll talk about that shortly. Okay. So, yay. I'm excited.
Starting point is 00:06:06 Yay. Henry Schreiner out in the audience says, we're also going to have to change building wheels with 3.12 to be 10.13 plus and see how build wheels. Interesting. You know, you think about the cascading effects of all these requirements, you know, and 10.13 being the Mac OS version. Yeah. Was that when they split and didn't like the Intel versus
Starting point is 00:06:27 whatever the other thing is, or it may have been, but the current version does support the Intel ones. I'm pretty sure it's just, well, as of today, they're supposed to announce a lot of that Apple's, uh, Apple intelligence, their AI, uh, boy, so that I believe is going to be one of the hard splits as well it's like that stuff i don't think it's going to work on intel but we'll see what they say okay i think that's literally going on right now as we speak the apple keynote thing which is a weird one hour ad that people look forward to okay such is the world we live in all right let's carry
Starting point is 00:07:00 on with a a pretty sweet transition from UV to talking more UV here. So I wrote up, you know, we've been talking about UV recently and a couple of different, this is kind of a little mini extra, extra, extra all around one topic. So I wrote up an article about how I'm using the UV Python thing that you just mentioned, Brian, using that to basically dramatically improve how we build Docker images, one of which runs or several of which I guess run Python bytes. Python bytes.fm gives you the RSS feed, the files, all that kind of stuff, right? Yeah.
Starting point is 00:07:36 So people can check that out. But the short and long of it is if you get down to the bottom one, it comes with an example, a little Flask app, multi, multi-tier, well, multi-image, not multi-tier, Flask app that shows how to go from basic Ubuntu image to having whatever version of Python you want with a virtual environment set up on it, including setting up your dependencies and a web server and all of that in seven seconds
Starting point is 00:08:00 from nothing, like a dash dash no cache style, a build. And that gives you a base image. You can just kind of keep chilling. And then if you take an app and you build it on top of that, like a Flask app or some other kind of Python app, I got it building around 700 to 800 milliseconds. So less than a second, which is awesome. Hey, so, you know, we talked about this back on 396 and 398, and we've been kind of hitting a lot.
Starting point is 00:08:26 But I just recently had Charlie Marsh from Astral on, and we talked about this. And I asked him things like, so I see you don't have the, it didn't have the latest 312 for a couple of days. And I noticed that you don't have a 3.13. And basically his thinking, if I remember it correctly, is more or less, we plan on supporting a version before it becomes final, before it becomes stable and gets released. So by the time 3.13, gold master, whatever it comes after, the official 3.13.0 release, I guess, comes out, it should be available in UV. But I'm not sure how much before then.
Starting point is 00:09:08 Yeah. Well, and we also heard from, uh, so Henry Schreiner says three 13 just got merged in the same place, which is, um, which is that Python build standalone. Also the three 13 T is now in a PR. So it, oh, interesting. We should free threaded version. Yeah. So hopefully, um, yeah, I think, and that was my final thing to point out is if so it oh interesting we should free threaded version yeah so hopefully um yeah i think and
Starting point is 00:09:25 that was my final thing to point out is if people are like well okay when i say uv python or what i actually i don't say uv python necessarily what i do is i create a virtual environment with uv and i just i want it i tell it i wanted this version of python oh okay right and it goes oh you want that version of python either we've already cached it or if we don't we'll just download it from python build standalone and then put it there for you so if your common working artifact is a virtual environment then you don't have to necessarily have it doesn't even matter if you have system python like literally you could not have python on your machine and this would still get you a virtual environment with the right version of
Starting point is 00:10:03 python that you ask but the source of all this also I learned about this from talking to Charlie last week, is Python build standalone. And if you look at the releases, like let's see, for example, on the latest release, there are 773 different builds or something. Wow. Look at that. So you can see here, there's CPython 3.10.14 with something on x86-64, four PCs on Windows. With this thing, you know, there's just so many variations. So basically when you say UV, create me a virtual environment with this Python, it's going to go through those 773, find the one that's the right fit and just download it and put it there if it's not already cached. So anyway, that whole story okay okay so that thing has that that one thing as has a
Starting point is 00:10:50 313 it just hasn't been released yet then so i guess we're waiting on that release yeah so so thank you henry that that uh gives us some more information i imagine that it's really down to just what python build standalone is doing and then then UV just give me the list of options and, and let me find things that, you know, match this operating system, something like that. It sounds like both of us went down the same rabbit hole, but it is kind of neat to find out where the source of this is so that I know that wasn't that hidden, but it did take a little bit of looking to figure out. Um, yeah, well, I mean, they could have been building it themselves.
Starting point is 00:11:23 You don't know right now. Like you don't know what setting. There's all sorts of stuff that's interesting. And there's also, I recall correctly, Charlie said there are different build optimization settings for Python build standalone than say what you get off of python.org or out of Homebrew. It's interesting.
Starting point is 00:11:41 For example, like profile guided optimizations and things like that. And I don't remember which had which, which is better, but I feel like the build standalone came out pretty strong there. Yeah. Before we move on, Brian, let me tell you real quick about Scout APM.
Starting point is 00:11:55 They're big supporters of Python Bytes, so we appreciate that very much. So if you are tired of spending hours trying to find the root cause of issues impacting your performance, then you owe it to yourself to check out Scout APM. They're a leading Python application performance monitoring tool, APM, that helps you identify and solve performance abnormalities faster and easier. Scout APM ties bottlenecks such as memory leaks, slow database queries, background jobs, and the dreaded N plus one queries that you can end up if you do lazy loading in your Thorium, and then you say, oh no, why is it so slow?
Starting point is 00:12:31 Why are you doing 200 database queries for what should be one? So you can find out things like that. And it links it back directly to source code, so you can spend less time in the debugger and healing logs and just finding the problems and moving on. And you'll love it because it's built
Starting point is 00:12:43 for developers by developers. It makes it easy to get set up. Seriously, you can do it in less than four minutes. So that's awesome. And the best part is the pricing is straightforward. You only pay for the data that you use with no hidden overage fees or per seat pricing. And I just learned this, Brian. They provide the pro version for free to all open source projects.
Starting point is 00:13:06 So if you're an open source maintainer and you want to have Scout APM for that project, just shoot them a message or something on their pricing page about that. So you can start your free trial and get instant insights today. Visit buythumbites.fm slash Scout. The link is in your podcast player show notes as well. And please use that link. Don't just search for them because otherwise they don't think you came from us. And then they'd stop supporting the show.
Starting point is 00:13:29 So please use our link pythonbyte.fm. Check them out. It really supports the show. All right. Over to you. Cool. Cool. I want to talk about read the docs for a little bit.
Starting point is 00:13:40 So it just seems like, you know, read the docs been around forever, right? They have? Yeah. So, so there's an article by Eric Holscher, 10 years of sustainable open source. And it's a, it's a little bit of some, some cool history here. So one, I, we totally rely on read the docs and, and and the all the tools around it. So read the docs apparently started in a with a 40 hour 48 hour open source sprint in 2010 48 hours. Well, so two days, I guess, it grew to become a successful part of the Python Python ecosystem and other open source projects. And yeah, obviously, it's just been around 2010 um but
Starting point is 00:14:28 i guess that's that's about the time that i really started uh jumping in and being part of the python community and not just part of just a user of python but but part of the community so um uh so that's why it looks like it seems like it's been there forever for me. And in 2014, they created read. So readthedocs.org is the open source thing. Readthedocs.com was the, is in 2014. And there's links to the announcements from 2010 for announcing read the docs and the announcement for read, read the docs for business, the.com. So this is kind of an interesting story about how to make a service that helps open source communities all over the place and how to make that sustainable.
Starting point is 00:15:14 So they're still sustainable, which is cool. So what is the sustainability model? How do they do that? Because there's four full-time people working on this, which is not that big. I mean, for people, there's probably a lot of volunteer volunteers on the open source side also. But for full time people, that's pretty cool.
Starting point is 00:15:33 Anyway, there's the.org side has single non tracking ads. And I think they were one of the first that I was aware of that did, did like a single just like ethic ad ethical ads or something that just had ads but it wasn't tracking you at all which is how ads should be i think um and i'm totally okay with that to help them sustain their model and then the dot com is a paid service it helps companies for private repos and additional they have other benefits also but sort of read the docs for companies. And then it also talks about things that didn't work,
Starting point is 00:16:09 which I love this. I love discussing the parts that didn't work. I'm like, have you tried this? One of the things was just trying donations and other optional support, and it just didn't work at all. And it left people with mental health issues and burnout. This is, that's terrible. The other thing was consulting services where you think about that, like maybe offer services
Starting point is 00:16:32 for people to pay. But the bad downside of that was it took away from time that they wanted to work on the main project. They experimented with grant funding and that was cool because they got some like a blob of money at a time, but it's a one time thing. And it's not that easy to keep going and getting more grants. So the current model is the paid service plus the advertising. And that's cool. Talk about some lessons learned, which is neat. Basically, you don't get extra points for being bootstrapped. People compare you to VC funded companies anyway,
Starting point is 00:17:05 which is, it's cool that they call it out because that's obvious, but also sometimes not obvious. Even if you're community driven bootstrapped, you don't get any points for that. We still expect you to be perfect. The other thing was that keeping trust in the community was the most important thing.
Starting point is 00:17:24 And yeah, they said that it's cliche, but trust is hard to earn and easy to lose. Definitely. And they can't maximize profits unless you keep trust with the community, which definitely support that. The one part that I thought was one of the reasons why I highlighted this is because this is because this is a lesson, I think that can go not just for people trying to sustain a funding model, but just lots of open source projects can listen to this. And the lesson is contribution is easier
Starting point is 00:17:58 in less complex parts of the code base. So they've noticed that they've got their core stuff, the readthedocs.org repo, the core stuff. That has got some complex stuff in it, and it's hard to get people to help out. But there's other things like contributions to the Sphinx theme or extensions or small Python or JavaScript projects that work alongside of it that are easier to get people to contribute to because they're smaller, I guess, less complicated bits of code. I think a lot of open source projects probably could do something like that of separating out where the code is and say, if you'd like to contribute, maybe don't touch this part because it's kind of hairy and it takes a while to get into. You can, but it's going to be difficult um and uh i've noticed that with us lots of projects so anyway um congratulations to all of them for 10 years that's awesome
Starting point is 00:18:52 and and then i was reading something and i found i i learned something is that there's there's i kind of associate read the docs with sphinx only but that's not true. There is now, there was an effort to separate some of the customization and they have a different build process going on now. And you can, the Sphinx or the Read the Docs build system now supports any documentation tool or it should, which I didn't know about. So that's-
Starting point is 00:19:20 Yeah, that's cool. Almost like a general static site platform probably. Yeah. Yeah. Congratulations. It's a general static site platform, probably. Yeah. Yeah. Anyway. Congratulations. It's a pretty important section of the Python community. And also got some cool Python, some Portland ties as well, which is cool. Yeah.
Starting point is 00:19:35 Really helps humanize the Python space, wouldn't you say, Brian? Yeah. Which is what I want to talk about next. This project by Hugo, I know you pointed this out before, Brian, I believe, but I can actually get to him. There we go. Hugo van Kinnamande, CPython core developer, and mini, mini project maintainer. One of projects is humanize. And I recently, when I've written this code for in small scale before because I kind of needed it. And if I knew about this, I just wouldn't.
Starting point is 00:20:07 But also I recently just started using it and it's super simple, super easy to adopt. You see examples of it right here on the GitHub screen if you visit their GitHub repo, right? See where it says seven months ago, last week, last year, that kind of stuff, instead of just putting a date. It's that kind of stuff that Humanize does, but for different things.
Starting point is 00:20:28 So if I go over to, I love all these ties from following on from you, from Read the Docs. If I go over to Read the Docs for them, and I wait, apparently, and it comes up. Okay, so then they basically have four areas that are relevant. It works in different languages,
Starting point is 00:20:42 many, many different languages, which is cool. It mostly works on numbers, but as I pointed out, it also works on time. So if we look at time, it has a natural date. Some of these don't have great examples. For example, the time and file size could have really nice dates. So the one I mentioned with the GitHub is natural Delta. It would say things like a year ago or two years ago, or in 13 seconds, stuff like that. It has a similar natural time and precise deltas. If you want those kinds of things also as for file size. So it'll say things like 300 bytes, 3.0 megabytes, 2.9 kilobytes or whatever.
Starting point is 00:21:23 Right. So you can just give it a number and tell it, you know, here's how many bytes it is. Make this friendly and it'll kind of figure out the right scale as a megabyte, kilobyte. You don't want 0.000 megabytes. You just want, you know, switch that to kilobytes or bytes, right? So file size is cool,
Starting point is 00:21:40 but the one that has tons of stuff going on is number. So you can have an associated press style number i guess this must be the way they're the convention when you're writing articles on how to speak about numbers so if it's a small number use written out words like f-i-v-e for five but if it's you know one zero zero one two one seven you don't you don't write that out as a huge long thing you just put the straight number right so i think the cutoff is 10 which is pretty cool it has clamp and so you can talk about percentiles for example if you say a really really small number and you say the floor is 0.01 percent it'll or just that number as a ratio it'll say the number that you
Starting point is 00:22:22 have for this the value is less than 0.01 oh nice or you can do it as a percent here and you can say this one this particular value is greater than 99% or it's in the top 10% or you can just say like under 1 million which is pretty awesome right yeah yeah so what else have we got here fractional so this just takes you know floating-point numbers and puts them into fractions like one and three tenths or one and a third or something like that. Into comma. This one I would just do with formatting, but you can have it put commas in for separators.
Starting point is 00:22:54 Into word. This one is really nice. So if I have one with seven zeros, it'll say 1.0 million. Or if you put in 1.2 billion, but as like integers, it'll just say 1.2 billion or all kinds of things. You can give it precisions, et cetera. Nice, right? It's very cool.
Starting point is 00:23:11 I like the scientific stuff. The scientific is good. The metric, this is really nice. If you give it a base measurement, like watts or grams or something, and then you say, give me this number in that unit system so for example if you say 1500 in terms of volts it'll give you 1.5 kilovolts that's pretty fancy
Starting point is 00:23:33 yeah or watts and you give it some huge number or say this many megawatts or a really really small one micro i don't know what f is in metric because to me that's fahrenheit so whatever um and the micro stuff is cool because i always have to hunt it down i have no idea how to type a micro symbol yeah so um i clicked to the scientific one the the 10 to the powers are pretty cool um the 10 to the minus one the with the little superscript that's yeah yeah instead of having 10 e3 it actually has 10 superscript 3 so a thousand is 1 times 10 to the you know 3 with actual the 3 like you would write it not the way computers have to write it so yeah it's really nice anyway it's just if you need this kind of stuff really
Starting point is 00:24:17 easy to adopt and understand if not then you know it's still interesting however if someone is out there looking to contribute to this project, I would say the numbers have awesome examples, and all the other ones are kind of, you may or may not even know what it's going to do. So, hey, let's get some examples as a PR and ship them over to you guys. That'd be cool. And, you know, documentation contributions are usually very welcome.
Starting point is 00:24:41 Yes, indeed. All right. Extras, Brian. I just have one extra. I wanted to shout out. So I talked about the Python test podcast is going to go back to test and code, even though, so it is.
Starting point is 00:24:53 So I finally finished that migration and actually put out an episode. So 222 is the second episode of a two-part series that started in June. Sorry. Serious cliffhangeranger, serious cliffhanger. So yeah, this so that's there. And then I got a question I sent out an email said, Hey, finally have another episode out. And somebody said, you should do transcripts.
Starting point is 00:25:20 And I guess I hadn't announced that. But transcripts are there. I've had transcripts in the last I don't know, like the last 30 episodes or something. So transcripts are AI generated, so they're not perfect. Like, this is great. I gotta find one of these db.py. That's fine. But there's like some, some dot pies that show up is.pi and some.pie is some. db like actually spelling out the dot this is terrible oh api.pie this is hilarious so um i could go through and try to fix this stuff um but i'm gonna probably try to hire my kid to go do it for me um but anyway so they're there that's all i wanted to say is it's in it i'm not not doing this weekly. Um, I actually talked to, to a friend of mine, Michael Kennedy.
Starting point is 00:26:08 Um, and he said, uh, he said it'd be kind of cool to, to do seasons. And so I'm, I'm kicking around the idea of doing seasons. Yeah.
Starting point is 00:26:15 Well, themes. I like it. I think it'd be great. Yeah. Anyway, that's just my extra. Awesome.
Starting point is 00:26:20 I have a couple of quick code in the castle event is almost over. It's almost, um, booked and happening. So if you want to be part of it, I'll put a couple of quick, the code in the castle event is almost over. It's almost booked and happening. So if you want to be part of it, I'll put a link in there, please. Uh, last kind of last call. So check that out. Yeah, I know. All right. We got some interesting email. I think I covered the Anaconda code plugin for Excel, how it runs locally. It runs on PyScript, all these good things gives you other features. Well, um, look who sent this in. I want to make sure I give some credits.
Starting point is 00:26:50 This was by rude Vanderham. Thank you for sending this in the sub project created. And basically when you have these Excel, I thought bits of code, you have to write all the code in one function and things like that. And there's other limitations as well. So basically he made it so you can have a lot more formatting variability, I suppose. And then you just have this bit of code that will just run a whole set of different bits of code that you can have into your workbook, which is kind of interesting. So as a follow-up to that, people are interested, they can check that out and just a quick out shout out to istats menu do you i stats menu brian for
Starting point is 00:27:30 your mac no if you want a real-time stats for what your mac is up to as they just released a new version looks super cool i'm just starting to play with it so obvious things like cpu and stuff but if you hover over them it'll give you tons of detail. Like Mac OS is kind of hard to get a lot of these pieces of information, but it'll have uptime. It'll have like how much power your CPU is pulling out of, or your computer's pulling out of the wall,
Starting point is 00:27:55 which is kind of interesting as a, you know, how hard is it working? Like how many watts is it pulling? And so anyway, that's- No, it's just cool. That's cool. Yeah. People can check it out.
Starting point is 00:28:03 It's pretty nice. Nice. Yeah, that is it. And you cool. Yeah. People can check it out. It's pretty nice. Nice. Yeah. That is it. And you want to close it out with a joke, our big episode 400. Definitely. All right. This come, this is sort of in the theme of I'm learning new programming languages.
Starting point is 00:28:16 Right. Mostly as beginners says, comes from dev humor says beginner programmers when they learn a new programming language. Just a shock. Is this Morty? I don't know. I think so. Anyway.
Starting point is 00:28:26 Well, that just sounds like Python with extra steps. Yeah. Yeah, exactly. Exactly. That's cool. But why all the stuff there? Anyway, thanks for episode 400. Thank you everyone for listening.
Starting point is 00:28:40 Thank you, Scott APM for supporting the show. Check them out as well. Thank you. Yep. See you, Brian. Bye.

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.