Latest / Talk Python To Me / #431: Visualizing CPython Release Process
Transcript
- 0:00Every year, Python has a new major release. This year, it's Python 3.12, and it'll come out on
- 0:04October 2nd, 2023. That's four days from when this episode was published. There is quite a process
- 0:11involved to test build and ship Python across the many platforms and channels. We have Seth
- 0:16Michael Larson here to give us a detailed rundown on exactly what is involved in releasing CPython.
- 0:21This is Talk Python To Me, episode 431, recorded September 28th, 2023.
- 0:27I agree.
- 0:27Welcome to Talk Python To Me, a weekly podcast on Python. This is your host, Michael Kennedy.
- 0:44Follow me on Mastodon, where I'm @mkennedy, and follow the podcast using @talkpython,
- 0:49both on fosstodon.org. Be careful with impersonating accounts on other instances. There are many.
- 0:55Keep up with the show and listen to over seven years of past episodes at talkpython.fm.
- 1:00We've started streaming most of our episodes live on YouTube. Subscribe to our YouTube channel over
- 1:06at talkpython.fm/youtube to get notified about upcoming shows and be part of that episode.
- 1:11This episode is brought to you by JetBrains, who encourage you to get work done with PyCharm.
- 1:19Download your free trial of PyCharm Professional at talkpython.fm/done dash with dash PyCharm.
- 1:25Hey there. Before we jump into talking about building CPython, I have a new course to tell you about.
- 1:31HTMX plus Django. Full web apps hold the JavaScript.
- 1:35This is an excellent new Django course written by Christopher Trudeau.
- 1:39In just a few hours, you'll learn how to make your app much more interactive,
- 1:43and the code even a little cleaner than pure Django.
- 1:46You may be familiar with our HTMX plus Flask course I released a while ago,
- 1:52and this one is its Django sister course.
- 1:54And it is out now at talkpython.fm/HTMX dash Django.
- 1:59The link is in your show notes.
- 2:01If you Django and have been wanting to adopt HTMX, you should definitely give this course a look.
- 2:06And a heartfelt thank you to everyone who has purchased one of our courses or library bundles.
- 2:11It truly makes this show possible.
- 2:13Now, on to that interview.
- 2:15Hey, all. Hey, Seth.
- 2:17Hello.
- 2:17Awesome to have you here on the show.
- 2:20Yeah, thanks for having me.
- 2:22Absolutely. I'm looking forward to talking about the details, the steps of releasing CPython.
- 2:28And for those of you who have not been watching and paying attention, by the time this comes out,
- 2:34it'll probably have already happened.
- 2:35I'm sure it's already happened.
- 2:37By the time this video is up, though, it's not quite happening.
- 2:40So as of the recording, next Monday, this whole process that we're going to talk about goes into action, right?
- 2:46Releasing Python 3.11.
- 2:48Yeah.
- 2:48This, not 3.12.
- 2:50This will have happened.
- 2:513.12.
- 2:52I got to get used to it.
- 2:53It's like, you know, in January, you always write the year on.
- 2:58So 3.12, the new version, the still faster, faster CPython 3.12 with lots of cool features is going to be out.
- 3:06And how does that happen, right?
- 3:08There's a lot going on behind the scenes.
- 3:10And you wrote a really cool blog post called Visualizing the CPython Release Process or something like that.
- 3:16I'm getting off memory.
- 3:17And it has a great diagram with a whole bunch of boxes.
- 3:20And so we're going to go through and kind of just talk about how that happens and so on.
- 3:24But before we get into it, maybe a quick intro for folks who don't know you yet.
- 3:27Yeah.
- 3:28So I'm Seth Larson.
- 3:30Online, everywhere, I am Seth M. Larson.
- 3:33That's my handle.
- 3:34And I am the security developer in residence at the Python Software Foundation, the inaugural security developer in residence.
- 3:41Hopefully for more, obviously.
- 3:42But yeah, this whole role is funded through the OpenSSF Alpha Omega project specifically.
- 3:50And it's kind of a project that's focusing on Alpha being really, really important projects that everyone agrees, yep, that's a really important project to secure.
- 3:59So among them is Python and PyPI.
- 4:01And then Omega is kind of like the long tail, right?
- 4:04Like all the other projects.
- 4:05Because there's open source is huge.
- 4:07There's millions of different projects.
- 4:08How can we secure those?
- 4:10And so, yeah, this role exists because of them.
- 4:13So I'm very thankful.
- 4:14And it's mostly.
- 4:15As are we all.
- 4:16Right.
- 4:16Speaking for the community.
- 4:17This has been something.
- 4:18Yeah.
- 4:19There's been a lot of places where it's like, well, why doesn't someone take care of this?
- 4:22Like, well, there's nobody whose sole job it is.
- 4:25But like Python has been slowly rolling in these new roles, which is fantastic.
- 4:28Like Łukasz Langa at the developer in residence.
- 4:31You're the security developer in residence.
- 4:33We have Mike Fiedler, who I spoke to about on PyPI security.
- 4:36Like there's people.
- 4:38There's developers working on stuff.
- 4:40It's awesome.
- 4:40There's something to be said.
- 4:42Like having someone working on stuff full time, like you can get a lot done.
- 4:47It's quite nice because we're so used to, you know, how the speed of open source.
- 4:52Right.
- 4:52Which is not.
- 4:53I guess when someone says the speed of open source, they don't immediately think, oh, yeah,
- 4:56that's going to be that's going to be fast and snappy because people have lives.
- 4:59Sometimes it is.
- 5:00Yeah.
- 5:00Well, sometimes it is.
- 5:01When things are brand new, they can have a lot of momentum.
- 5:05But, you know, my personal view is like on all these software projects, there's these
- 5:09little gnarly edges that is just as fun for no one.
- 5:12Right.
- 5:13And like, I want to add this new feature or I want to add async to this thing so people can
- 5:17do this and like you can get so inspired, even if it's not your job and it's just your
- 5:21project and really go on it.
- 5:22But like, you know, really polishing out that little bit of documentation or or updating that
- 5:28detour.
- 5:28Like it's it's all the fine polish, I guess, that I think you all are bringing to
- 5:33Python, which is awesome.
- 5:34Yeah.
- 5:35There's tons of work.
- 5:36That's like it really does need that amount of time investment and like a sustained time
- 5:42investment.
- 5:42So like when you're working with external groups or like, you know, developing processes and
- 5:47stuff like that, like you just need you just need to be there a lot more than, you know,
- 5:51weekends.
- 5:52So it's good to have that full time presence.
- 5:55Yeah.
- 5:56Yeah.
- 5:56I think it is, too.
- 5:57Although it's absolutely mind blowing how much stuff gets done in traditional pure open
- 6:02source.
- 6:02It really is.
- 6:03Honestly, it gives a whole new perspective to it.
- 6:06Right.
- 6:06It's like, oh, yeah.
- 6:07You know, all of this is happening.
- 6:09But, you know, almost all of the people that I interact with on a day to day basis are volunteers.
- 6:16And so like I when I kind of wrote about this a little bit in my opening when I announced
- 6:20myself as a security developer in residence, but it's like you need to you can't have expectations
- 6:26and like assign people work.
- 6:28You know what I mean?
- 6:28Like this is not a traditional work environment where you can just tell people what to do.
- 6:32And, you know, it it's a certain way of working.
- 6:36And I'm used to it because I am an open source maintainer myself.
- 6:39So it makes a lot of sense to me and I feel very comfortable with it.
- 6:43But it's very different than a regular security developer job would be.
- 6:46Would you say fewer TPS reports?
- 6:48Yeah, a few fewer.
- 6:51Yeah, yeah.
- 6:51Just a couple fewer.
- 6:53Hey, you since you brought it up, maybe we'll come back to this if we have time at the end.
- 6:57But, you know, you've got some pretty notable projects that you're working on here.
- 7:01Like give a quick shout out to some of your open source work that predates.
- 7:04Yeah.
- 7:04So I am the lead maintainer of your lib3, which is one of the most downloaded Python packages
- 7:10on PyPI.
- 7:10I also help maintain requests.
- 7:13It's a user of your lib3.
- 7:15And then in addition to that, I have a library, which I quite love, which is called TrustStore,
- 7:19which is being adopted by a lot of package managers right now, like pip and Conda and PDM,
- 7:25which allows those those packages to use system certificates as opposed to something like Certify
- 7:33so that you can take advantage of all of the benefits that you get for using a system trust store for HTTPS as opposed to like a static bundle of certificates.
- 7:42Because operating systems are actually constantly checking, updating all of these things.
- 7:47It's just a little bit better.
- 7:48Some certificate store or some certificate authority turns out to be shady and they get revoked and.
- 7:54Or just not have not have the best practices.
- 7:58And so, yeah, just like, OK, we're going to pull that one.
- 8:01But we're even pulling us.
- 8:02Yeah, they even get stolen.
- 8:04Right.
- 8:04Sometimes these certificates get stolen.
- 8:06They get stolen.
- 8:07You know, there's all sorts of things that can go wrong.
- 8:10Thankfully, it doesn't go wrong very often.
- 8:12Otherwise, it would be a lot bigger of a problem.
- 8:14But yeah, it does happen every once in a while.
- 8:17Yeah, that's cool.
- 8:17Yeah.
- 8:18And you were on Python Bytes, my other podcast I do with Brian to talk about trust store, which is cool.
- 8:23All right.
- 8:23Back to this.
- 8:24So tell us a bit about this developer, security developer in residence role.
- 8:29Like people were like, oh, this maybe they've heard of it or is maybe even new to them.
- 8:33But like, what is your what is your job here in the PSF space?
- 8:37Yeah, it's it's it's kind of funny talking about my role, too, because people see security through so many different lenses.
- 8:44And this is even like outside of talking to people online that are in the open source space.
- 8:48So whenever I talk about this job, people will say, oh, so you do IT security for the PSF.
- 8:54I'm like, well, no, I don't do that.
- 8:55And then they'll say, oh, so you secure.
- 8:57Yeah, right.
- 8:59I'm in.
- 8:59No, no, no.
- 9:00So I don't do that.
- 9:02I don't do IT security for the PSF.
- 9:04And then the next question they usually ask is like, oh, so you make it so that Python is more secure, like the code of Python is more secure.
- 9:13And I'm like, not really.
- 9:16Honestly, I don't do that either.
- 9:17And what I really do is try my best to make it so that bad stuff doesn't happen to Python users.
- 9:24And so, you know, obviously those things are important, like securing Python, the actual code itself.
- 9:30But on like the scale factor, maybe those are a little bit less important than some things like making sure that when you download something from Python.org, it is the correct thing.
- 9:42Right.
- 9:42Making sure that when a release is happening for Python, nothing can subvert that release and get injected in and then distributed to everyone.
- 9:51And then it goes beyond Python when you start thinking about like the packaging space.
- 9:55So like making sure that HIP release process is good, making sure that the all of these like tools and stuff that are using all of these binary libraries.
- 10:06How can you be sure that those libraries that are bundled along with them don't have vulnerabilities?
- 10:11And then a lot of things around like process.
- 10:13So vulnerability management and making sure that, you know, vulnerabilities that are discovered in Python and reported to us, they actually get to the end of the process where they're fixed and released.
- 10:24There's just a whole bunch of things like that where it's more of like a scale and safety and like making sure that my effort goes towards things that are going to keep on churning as opposed to things that are like spot fixes.
- 10:36Right.
- 10:36Because sure.
- 10:37Spot fixes, they're important, but they don't have the scale and they don't have that like keep on giving you the value aspect of them.
- 10:45Yeah.
- 10:46And the consequence of a lot of what you described sounds like supply chain type issues.
- 10:51The consequence of that is so bad.
- 10:54It doesn't matter how patched your computer is or how good your firewall is.
- 10:58If CPython itself ships with a virus.
- 11:01Right.
- 11:02Right.
- 11:02Yeah.
- 11:03Or somebody snuck it in right at the build.
- 11:05Yeah.
- 11:05Yeah.
- 11:05Right.
- 11:06Right.
- 11:06Right.
- 11:06And so it's good that you focus on those.
- 11:09Nobody wants that.
- 11:10Well, almost nobody wants that.
- 11:11Very few people want this.
- 11:13So those are not good people.
- 11:14We don't want them to want this.
- 11:15We don't.
- 11:16We don't take them into consideration for their use cases.
- 11:19We sure don't.
- 11:21Awesome.
- 11:21And let's see.
- 11:23I believe you're on.
- 11:24Well, when I read the article, you're on week nine.
- 11:26So you're on week 10.
- 11:27Is that where we are?
- 11:28I think I'm on week 12 at this point.
- 11:30Oh, man.
- 11:30Time flies.
- 11:31Yeah.
- 11:31I know.
- 11:32I'm actually drafting up like a quarterly review.
- 11:35And it's a big thing.
- 11:36So, yeah.
- 11:37Okay.
- 11:38See, a quick question from the audience here on the live stream.
- 11:40You know, Lewis asks, is there a visibility or will there be a public visibility for CVEs in packages?
- 11:47That is an excellent question.
- 11:49It is a good question.
- 11:50And I bring this up because didn't the PSF just get certified as like a CVE authority or whatever that is?
- 11:56Like ability to create CVEs?
- 11:57I don't know.
- 11:58Yeah, I can I can talk so much about this.
- 12:00Right.
- 12:00So there there's a whole bunch of stuff happening in that space.
- 12:03So I'll start off with stuff that I did not personally do, but I'm helping maintain now, which is there is an advisory database called if you go on GitHub, it's GitHub.com slash PyPA slash advisory database with a dash in between advisory and database.
- 12:21And that database is essentially trying to categorize all of the CVEs and what versions they affect for every single package on the Python package index, which is an impossible task.
- 12:35But so we're trying our best there.
- 12:37But yeah, so one of the packages, no problem.
- 12:40No problem.
- 12:41Right.
- 12:41Like that's a that's a manual task right there.
- 12:43Yeah.
- 12:43No.
- 12:44So what this actually does is for the bulk of it, what it will do is it'll go out and it'll pull the CVE feed from NBD and MITRE.
- 12:51And it will parse it and try to find references to Python packages and versions inside of CVEs.
- 13:00So obviously that's sometimes there's false positives, but a lot of the times there's just it just works out OK.
- 13:04And there's a little bit of triage involved.
- 13:07There's a little bit of manual submission of this, too.
- 13:09But yeah, so tools like pip Audit, which is a tool that I love so much, uses this database in addition to other scanning tools like any scanning tool can use this database.
- 13:21But yeah, this is the canonical location for vulnerabilities affecting Python packages.
- 13:27So for Python itself, the Python Software Foundation just recently, like a few weeks ago, announced that we are now a CVE numbering authority, which means that we are we kind of have like a scope of just Python and pip right now.
- 13:44So those are the only two projects that we're emitting CVEs for.
- 13:46And what that means we can do is it means that people have to submit reports to us, which is good because then they can't submit them to other places and get CVEs that way.
- 13:55It can be kind of frustrating because in the past, sometimes that would happen.
- 13:58And then we wouldn't know about the vulnerability until it got published as a CVE.
- 14:02And we'd be like, what just happened?
- 14:03Like one of the big deals is you're supposed to be told in an ideal world, you're supposed to be given like a come knock in the back door like that WebP code.
- 14:13We're going to need to talk about the WebP code before.
- 14:16Yeah.
- 14:16Oh, gosh.
- 14:17Don't get me started on WebP.
- 14:18Don't get me started on WebP.
- 14:19This portion of Talk Python To Me is brought to you by JetBrains and PyCharm.
- 14:25Are you a data scientist or a web developer looking to take your projects to the next level?
- 14:30Well, I have the perfect tool for you, PyCharm.
- 14:33PyCharm is a powerful integrated development environment that empowers developers and data scientists like us to write clean and efficient code with ease.
- 14:43Whether you're analyzing complex data sets or building dynamic web applications, PyCharm has got you covered.
- 14:48With its intuitive interface and robust features, you can boost your productivity and bring your ideas to life faster than ever before.
- 14:56For data scientists, PyCharm offers seamless integration with popular libraries like NumPy, Pandas, and Matplotlib.
- 15:02You can explore, visualize, and manipulate data effortlessly, unlocking valuable insights with just a few lines of code.
- 15:10And for us web developers, PyCharm provides a rich set of tools to streamline your workflow.
- 15:14From intelligent code completion to advanced debugging capabilities, PyCharm helps you write clean, scalable code that powers stunning web applications.
- 15:23Plus, PyCharm's support for popular frameworks like Django, FastAPI, and React make it a breeze to build and deploy your web projects.
- 15:31It's time to say goodbye to tedious configuration and hello to rapid development.
- 15:36But wait, there's more.
- 15:37With PyCharm, you get even more advanced features like remote development, database integration, and version control, ensuring your projects stay organized and secure.
- 15:46So whether you're diving into data science or shaping the future of the web, PyCharm is your go-to tool.
- 15:51Join me and try PyCharm today.
- 15:54Just visit talkpython.fm/done-with-pycharm, links in your show notes, and experience the power of PyCharm firsthand for three months free.
- 16:04PyCharm.
- 16:05It's how I get work done.
- 16:10The real, like, the ideal process is someone would Google, like, Python and security, or, like, Python and reported vulnerability, and then they would find these, like, really lovely instructions that someone else wrote up to say, just send an email to security at python.org with whatever information you have, and then we triage that.
- 16:28And if we decided it's a vulnerability, we would ask for a CVE on your behalf and, like, credit you and all this stuff, and then fix it.
- 16:35And then the release and publication of the CVE would happen at the same time.
- 16:40So that's what we call coordinated vulnerability disclosure.
- 16:43And so instead of, like, oh, there's a vulnerability, but there's no fix available for that vulnerability, like, that's what you want to avoid.
- 16:49Because it causes panic, and in theory, it could cause exposure, right, where there's some dwell time in between when people, or it doesn't minimize the dwell time between when people are able to patch and when the vulnerability is known to potential attackers.
- 17:05Right.
- 17:06There's already a latency boom from when it's announced to somebody actually fixing it.
- 17:10But if when you hear it, you can't actually fix it for two more weeks because it's not released.
- 17:14Well, that just gives people two weeks to try to dissect, like, what exactly do they mean by there's this image problem?
- 17:19Exactly.
- 17:20Exactly.
- 17:21Oh, yeah.
- 17:21I'm going to look at my image, yeah.
- 17:22We're going to start talking about LibWebP, actually.
- 17:25Yeah, the...
- 17:26No, I'm just using it.
- 17:27Like, it's the most recent example, because last night there was a...
- 17:30And it's really relevant to CVEs because there was some drama that Apple patched some of their code.
- 17:36When Google announced it, it looked like it was only applied to Chrome, but it actually applied to anything that used WebP, which, looking at the updates, is like, everything.
- 17:43Everything on my computer needs to be updated because of it.
- 17:46You know, like, that mismatch was, like, caused a lot of drama.
- 17:50I definitely agree.
- 17:51Yeah, there was, like, a week of time in between when that CVE just mentioned Chrome and Apple, and then when it actually ended up mentioning LibWebP.
- 18:02And then right when it mentioned LibWebP, I'm like, oh, I know a lot of Python packages use that.
- 18:06And so I then went out and go and talk to those people.
- 18:09Oh, interesting.
- 18:09And they fixed those things now.
- 18:10So.
- 18:11Yeah, that's great.
- 18:12Another good reason to stay on top of dependency management and stuff, right?
- 18:16Like tools.
- 18:17One of the things I think we're coming to sort of understand and manage better in the Python space is not your dependencies, but the transitive closure of your dependencies.
- 18:28Right?
- 18:28So I might use, let me just say, I guess, what if I use Pillow to work with images, but Pillow itself uses some other library that it pip installs that itself might have some kind of image code.
- 18:39If I say I use Pillow, oh, I need to update it.
- 18:41Pip install --upgrade.
- 18:44Pillow doesn't upgrade its dependencies and those dependencies of the, right?
- 18:49So like, but that could be where a lot of silence issues live.
- 18:53And so things like poetry, flit, pip-tools, there's a lot of tools coming on that I think are gaining popularity that treat not just what you directly wanted to pip install, but its friends and its dependencies.
- 19:04Yeah, definitely.
- 19:05What do you think about that from a security perspective?
- 19:07Yes.
- 19:07So having the most important thing from like a kind of dependency management side of things is having those lock files and having them have hashes.
- 19:17Like it's, it's less of a problem now.
- 19:21Like I, it likely won't come to fruition that those hashes end up being important, but luckily lots of lock file formats do generate hashes anyways, which is great.
- 19:29So that subverts attacks against PyPI partially.
- 19:32We're in the middle DNS madness.
- 19:35Right.
- 19:36Yeah.
- 19:36Like if somehow you've been tricked into using a bad certificate or something, right?
- 19:42Like it, it saves you from a lot of stuff like that.
- 19:44So having hashes, they're basically free.
- 19:46They're great.
- 19:47Just use those.
- 19:48The other side of it is running a vulnerability checker against those dependencies.
- 19:53Cause then you'll, or either that or having a tool that's doing that for you.
- 19:57So like depend a bot is a tool that does that for you.
- 20:00It will check vulnerability databases and then give you like a security notification or a PR to say,
- 20:05Hey, this is affected by a medium severity vulnerability, or you can run them your own via pip audit with.
- 20:12It can either check an already installed environment or it can check like a requirements file.
- 20:17I don't know the full extent of all the different file types that I can check.
- 20:21I know that it works on requirements.txt, but yeah, it, it'll check those files for known vulnerabilities and all of the transitive dependencies, just everything that's available.
- 20:30And then from there, it'll tell you, Hey, these are the things that you need to fix.
- 20:34Here are the fixed versions.
- 20:36Like try upgrading to at least this, doesn't mean that it's easy.
- 20:39advisory database you talked about.
- 20:41It does go back to that advisory database.
- 20:43Yeah.
- 20:44And it also can hook into OSV, dot dev, which is kind of like this global, aggregation of tons of different vulnerability databases.
- 20:53So for example, we have one for Python that I pointed out, but then like rust has one.
- 20:59Debian has one.
- 21:00what is it?
- 21:01Rocky Linux, I think has one.
- 21:03Like there's just a whole bunch of them and you can kind of interface with this database using the same API and it's, it's kind of nice.
- 21:09So, yeah.
- 21:10So making this a security show, we just talked to Mike Fiedler a little while ago about that as well.
- 21:17Diving into it.
- 21:18I mean, we'll come back to the release process, but I do want to ask you about this is one of the challenges I see is like I got to depend about a warning.
- 21:24Luckily it was for basically the requirements dash dev side, not the true requirement.
- 21:31You know, like I'm going to use a bunch more tools to do like Jupyter stuff on my data, but I'm really just running a website and there's like a much smaller, a smaller set of things on there.
- 21:40But there was a vulnerability report for something, some package that was in my requirements, for the dev verge, the dev setup.
- 21:49However, when I tried to go update it, one other package that is the reason that was there said, no, it has to be less than something.
- 21:57And that something was less than the fix.
- 22:00And I'm like, how do I square these two things?
- 22:03Like I can pip install it, but then it keeps complaining that you're, you're running the wrong version.
- 22:07Like, no, I'm not.
- 22:08The other one has a remote CVE and, you know, a remote code execution in it.
- 22:12And I'm like, I really don't want that.
- 22:14I mean, not a server.
- 22:15So it's probably fine, but I really don't want that.
- 22:17No, I'm, I don't care if it's slightly more unstable.
- 22:20I want the new one.
- 22:21Give it to me.
- 22:22Right.
- 22:23And that's, that's a bit of a challenge.
- 22:24I think, when you say like, I've got 50 dependencies and I've got to somehow square, I need to get a brand new one right away.
- 22:32What are your thoughts on that?
- 22:32Yeah, this, this is a super tough problem.
- 22:35And I think it's one that open source will be coming to reckon with even more now, right?
- 22:40Because we're kind of at a, in a place now where there's a few really important libraries, which are kind of moving something that is very extensively and widely used to be not maintained anymore.
- 22:51For example, open SSL, open SSL one or 1.1.1, which is extremely widely used, is no longer maintained.
- 23:01There's going to be no more security patches for that.
- 23:03And it's, it's going to be tough because my guess is that there's also just a lot of software that's not built for open SSL three being the open SSL of choice.
- 23:13Right.
- 23:13Luckily, Python is not in that situation, but it's, it's certainly like a thing that other pieces of software might have to deal with.
- 23:20in terms of Python packaging, this is kind of why the guidance on don't specify an upper bound, unless you know that that upper bound like makes sense.
- 23:32And like, so like backwards incompatibility, like, yeah, maybe you want to say, okay, if this is version 2.1. whatever.
- 23:39And it's some ver, you can say, okay, anything less than three is probably fine.
- 23:43but even that, right.
- 23:45If you, if that package goes unmaintained.
- 23:47Yeah, this one from two to three and its main version, right.
- 23:49It's, it's major version.
- 23:50So.
- 23:51Right.
- 23:51Yeah.
- 23:52So this is, this is a difficulty.
- 23:54Yeah.
- 23:55There's a lot of packages that set hard upper bounds.
- 23:57And I just, I don't know why, because I, maybe it, it's going to break it, but I feel like it's speculative.
- 24:04Like, ah, we should probably not let a major version run, but you know, that, that leads into trouble.
- 24:09Right.
- 24:09Like, even if you just want to use some other library that says greater than or equal to three, and this one says less than three.
- 24:14You're like, great.
- 24:15Now, what do I do?
- 24:16Yeah.
- 24:16I think that the toughest thing is that you can't go back and then like amend it.
- 24:19yeah, that's the hardest part is because.
- 24:22So I will speak very, very highly of all of these, anything that can make pip automatically get the right thing is just magical is so good.
- 24:33And so people like that.
- 24:35And I totally get why people are doing these upper bound, sorts of things, but yeah, it does have the issues that you, that you talked about.
- 24:43But yeah, there's something to say about how great the, those bound checks are.
- 24:48I wish there was a way that you could add something like some sort of guidance to pip to say after the fact, like, okay, I said this was open, but now I'm going to go ahead and tell you that like, this definitely doesn't work with this version.
- 25:00Maybe that's something that can get recommended, but yeah, it's just so nice when it does work out.
- 25:05Yeah.
- 25:05Yeah.
- 25:05I, I can relate to Frank here who writes with 1.3,000 or 1,300 dependencies in our project because of this dependencies are at all times.
- 25:15Yeah.
- 25:16I have on Talk Python Training, the courses website.
- 25:19I think there's 248 packages.
- 25:21If you look at what's installed and then the dependencies, and then you try to throw in the data sciencey stuff.
- 25:26And it's just like, there's a 50, 50 chance that I can actually install everything.
- 25:30Cause like half the time, something has got a less than, something's got a greater than.
- 25:34And I'm like, Oh my God, as you upgrade, right?
- 25:36Like at any point in time, it's deterministic, but you're over at over the evolution of it.
- 25:41Right.
- 25:41Yeah.
- 25:41No, it's, it's tough.
- 25:42It's tough when you start getting to that number.
- 25:44Like there's just so many intertangled things.
- 25:47There are.
- 25:47And like, the reason I bring this up now is it's, it's a hassle when like, I want to use this library and that library and somehow I've got to like juggle things.
- 25:54So they work, but it's concerning when you get a depend about alert that says there's a remote code execution.
- 26:00You're going to need to deal with it and your dependencies won't let you upgrade.
- 26:04You know what I mean?
- 26:05Like that's, that's why I bring this up.
- 26:06It's, it's definitely concerning.
- 26:08Yeah.
- 26:08Another thing that you can do, and this is, I feel like they don't talk about this as much with depend about is that there are ways.
- 26:14to mitigate vulnerabilities that doesn't necessarily have to come from upgrading.
- 26:19Like I'm always going to say upgrading your dependency is the best way to go forward because then you know that there's no chance of at least that vulnerability in particular being exploited.
- 26:28But if it's something like remote code execution, but it's this one component, right?
- 26:33As long as you're not using that component, then you're fine.
- 26:35Or if it's remote code execution, when you get some sort of input, whatever, right.
- 26:40That's, that's malformed or whatever.
- 26:42And you're like, okay, well that component's not exposed to the network.
- 26:46It's, I only use it internally.
- 26:47So there is something to say.
- 26:50It's not even a server.
- 26:51It doesn't open a port, right?
- 26:52It's just a thing I run on my computer.
- 26:54It's like, it probably doesn't matter.
- 26:56Exactly.
- 26:56Yeah.
- 26:57And that's, that's kind of the hard part.
- 26:58I'm the one typing into it.
- 26:59And it's like, but if it's in your website, then all of a sudden it gets a little trickier, right?
- 27:03Then it gets dicier.
- 27:04Yeah.
- 27:04Definitely.
- 27:05Yeah.
- 27:05The stakes are higher when you attach the internet to anything.
- 27:07But when it's like a local script, it's probably going to be okay.
- 27:10Just look at your log file.
- 27:10Just tell your log file.
- 27:12And it's request, request, hack, hack, request, attempted hack, request.
- 27:16It's just nonstop.
- 27:16WP login.
- 27:17Yes.
- 27:17Yeah.
- 27:18WP admin.
- 27:19All them things.
- 27:20Yeah.
- 27:20It's usually, luckily it's WP something or something most of the time.
- 27:24So you're good.
- 27:24You're safe against 90%.
- 27:26We're all good.
- 27:27As long as you don't return a 200 to any of those, like your traffic will remain low.
- 27:31Yeah.
- 27:32Absolutely.
- 27:32All right.
- 27:34So that's what you're doing.
- 27:36You're focusing on these kinds of things.
- 27:37That's really, really awesome.
- 27:38And thanks for giving us an even more detailed look than I expected into it.
- 27:42Yeah.
- 27:44Let's talk about your, let's talk about, you know, the timely thing.
- 27:48I mean, security is always timely, but the CPython, let me see if I get this right.
- 27:52312 release coming up here on Monday.
- 27:54Dang.
- 27:55He's got it.
- 27:56Amazing.
- 27:56I got it, man.
- 27:57I'm ready.
- 27:58I'm ready for this new, new world.
- 27:59So there is a PEP and let's see who, who put this together.
- 28:03This is Barry Warsaw and Guido.
- 28:05And it is PEP 101.
- 28:07I love it.
- 28:08PEP 101.
- 28:09The one you need, right?
- 28:10Yeah.
- 28:11What a perfect number.
- 28:12But it's, it's the title is doing Python releases 101.
- 28:16That's kind of a circular.
- 28:18I love it.
- 28:19And it just talks about all the steps and it's kind of a manual of now you do this and now
- 28:25you do that.
- 28:25But it's just a really long doc.
- 28:28I love the stop, stop, stop, stop, stop.
- 28:31There's like, there's like all caps all across.
- 28:35Stop, stop, stop, stop, stop.
- 28:35Did you do this right?
- 28:37Right?
- 28:37Yep.
- 28:38That you can tell, you can always tell when there were problems in the past in a checklist,
- 28:43right?
- 28:43Like if there ever was something that happened incorrectly, it's, it's very obvious.
- 28:47And so, yeah, the stop, stop, stop.
- 28:49I feel that that, I don't personally know why that's there, but I do laugh every time
- 28:55I see it.
- 28:55So.
- 28:56Yeah.
- 28:56Let's see.
- 28:58Please note how PEP 101 replaces PEP 102.
- 29:00Time traveling was invented there.
- 29:02What is the.
- 29:03Yeah.
- 29:04At the very top.
- 29:04It's, I wanted to comment on that too.
- 29:06It said replaces PEP 102.
- 29:08And I wonder if it was more like a, oh, we should just use one-on-one sort of situation.
- 29:14Well, I think this is doing micro releases.
- 29:16Right.
- 29:17Is this one maybe more like full, like the full deal?
- 29:20I don't know.
- 29:21Yeah.
- 29:21I think security releases are, they're slightly different.
- 29:24We don't actually build binary installers for security releases.
- 29:28We only build source builds, like source tarballs for micro releases.
- 29:33And so maybe that was the distinction in 102.
- 29:35Sure.
- 29:36Okay.
- 29:37So this has existed since 2001, but you got to really dig into it.
- 29:43And you know, there's some interesting stuff there, but picture a thousand words, all these
- 29:47things, you put together a really nice graphic here and somehow you got this in like HTML.
- 29:52I'm impressed.
- 29:53Yeah.
- 29:54That's embedded SVG.
- 29:55I, I always use draw.io for my, my diagrams.
- 30:00I take pride in my diagrams.
- 30:01Yeah.
- 30:02It looks good.
- 30:03All right.
- 30:04So there are 10 steps.
- 30:06Some of the steps have ABCs in them.
- 30:08So, and you know, just for people who pull up this picture and obviously being a podcast,
- 30:15it's hard to see the picture.
- 30:16If you're not watching the live stream, I will put a link to the article, which has the picture
- 30:22in there.
- 30:22And if I remember right, I'll even put it as the chapter art.
- 30:25We'll see about that.
- 30:26but there's a legend in here.
- 30:28So you've got like different types of things.
- 30:30You've got human actors, which are golden release artifact, which is blue, a source of risk, which
- 30:36is where you're paying extra attention and the start and end state.
- 30:40And so, the colors mean stuff here and the legends at the bottom, but yeah, let's, you
- 30:45know, start with number one.
- 30:46What happens here?
- 30:47Yeah.
- 30:47So starting with number one, and I'm actually going to increase the size of my screen as
- 30:52well, because I'm going to pull it up separately myself.
- 30:54Yeah.
- 30:55There's a lot going on here.
- 30:57There's a lot going on here.
- 30:59You need some, you need some manager control plus on it.
- 31:01Yep.
- 31:02Okay.
- 31:03All right.
- 31:03So in the very beginning, what happens is essentially the release manager decides it's
- 31:09time to make a release.
- 31:10It'll be common source right now.
- 31:12So we're, we're deciding, okay, we're going to make a release.
- 31:15And so something that happens even before this is we kind of talk amongst all of the other,
- 31:21it says release managers in there, like windows release manager, macOS release manager.
- 31:24They kind of flip between that language and experts.
- 31:27So like windows expert, macOS expert.
- 31:30Someone who understands this weird windows things that can make a MSI installer.
- 31:34The people.
- 31:34Exactly.
- 31:34What do you do on Mac?
- 31:36I don't even know how to build that.
- 31:37Right.
- 31:37That person.
- 31:38Yeah.
- 31:38Yeah.
- 31:39Talk to, talk to them, get, get their, get their buy-in that indeed they're going to be
- 31:43around when you decide to do this, because this is kind of like a big coordinated thing.
- 31:47Everyone has to be around to do their part.
- 31:50And then if that is the case, then the release branch gets frozen.
- 31:54So in this case, that release branch would be 312.
- 31:57And so that's done by essentially putting a block on all future like pushes to the branch,
- 32:03like in GitHub, you use like branch protection.
- 32:06And that's basically to make it so that no one can merge pull requests anymore so that you
- 32:11have something that's stable that you can kind of work off of.
- 32:14And then after that, you'd move on to step two, which is the actual release manager will
- 32:19update their fork of the repo with whatever is on that branch.
- 32:23So like the 312 branch will get updated and then you'll pull that branch locally now on
- 32:29step three.
- 32:30So now you're on the actual release manager's machine.
- 32:33And so like I kind of have like gray boxes drawn kind of throughout.
- 32:37So those are kind of like security boundaries a little bit.
- 32:40The top most one is the GitHub like organization of Python.
- 32:45And then the middle, the tiny one that has the fork repo, that's the GitHub user for the
- 32:51release manager in particular.
- 32:52And then the furthest left, the gigantic one is the release manager's actual computer.
- 32:56It's not documented anywhere.
- 32:59It's just how I was thinking about it.
- 33:01But yeah, so then there's this thing called release tool.
- 33:03And so release tool is basically just a Python script.
- 33:06It's on GitHub.
- 33:07If you go to github.com/Python slash release dash tool, it's basically just a script that
- 33:13runs and then does all of the stuff that's needed to build the source distribution and documentation
- 33:20of a new Python release.
- 33:22And so you run that.
- 33:23And as a result, you kind of get like a huge amount of code that needs to be committed.
- 33:29And so there's a whole bunch of different little tools that kind of get run in addition to
- 33:33that.
- 33:33So things like blurb, Sphinx gets run as a part of that.
- 33:37Yeah, you need a whole lot of dependencies installed.
- 33:41So you like you need like LaTeX, you need a whole bunch of stuff installed for this to actually
- 33:45work.
- 33:45Do you make sure you've got like the right, right compiler?
- 33:50Is there a lot of concern about that?
- 33:52Like, is it clang or LLVM or GCC or, you know, I believe it's GCC.
- 33:58I believe it's GCC.
- 33:59You know, I didn't dig into that exact point, but I'm pretty sure it is GCC.
- 34:02But I feel like that's another part that you like that choice matters, right?
- 34:06Like you might get different outputs.
- 34:07You might discover bugs that weren't there.
- 34:09So you got to kind of get that gray box all set up as well, right?
- 34:13Yeah, definitely.
- 34:14And so the fact that it's on someone's machine, I would say reproducibility is quite tough in
- 34:20those sorts of situations, right?
- 34:22Like if someone were to build a release of Python and then a day goes by, like I guarantee you
- 34:28that if you try to do it again with the exact same starting input, it would be potentially
- 34:34different, right?
- 34:35And so that's actually a problem from a security perspective for reproducibility, because it means
- 34:40that someone else can't verify that what you did is correct, right?
- 34:46Like the hash might change or something like that, right?
- 34:48Hashes might change or if there's like somehow the time is getting embedded into a binary
- 34:53somewhere like that.
- 34:55There's just a whole bunch of different ways that reproducibility could be different between
- 34:59two different runs.
- 35:00Yeah.
- 35:01And so that after the release tool happens, you basically get handed a couple of source
- 35:07tarballs that just have everything in them.
- 35:09And then you also get a bunch of get like changes to the repository.
- 35:13So these are things like the change log has been generated from all of the blurb notes.
- 35:18And so what you do is then you take all of those changes and you create a big commit that
- 35:23says this is the release of CPython 3.2, 3.12.0.
- 35:28And then you tag it and you push that to the fork.
- 35:32You don't push that to the main repository yet.
- 35:34And so the reason you don't push that to the main repository, and this is actually something
- 35:37that this phenomena is, is an interesting one, especially because a lot of security build
- 35:44tooling doesn't take this work workflow into account, which is you don't push the tag to
- 35:52the origin until the very end.
- 35:55A lot of security tooling like salsa and all of these things will kind of like they won't
- 36:01assume because you can you can do it without tags, but like they'll have features that are
- 36:06Oh, we'll capture the get tag in the output of like this, like document that says that your
- 36:12builders came from this repository, this set of tooling, whatever.
- 36:15Right.
- 36:16But a lot of projects actually wait on the tag until the very end because they want things
- 36:21to be repeatable without causing confusion.
- 36:24So if something went wrong throughout this whole release process, you wouldn't want there to
- 36:29be a tag on the main repo that is now confusing people.
- 36:32Right.
- 36:32Because those tags cause notifications.
- 36:34I'm going to get the code.
- 36:35You're like, actually, no, the Mac build wouldn't build.
- 36:37We're going to fix that or whatever.
- 36:39Right.
- 36:39Right.
- 36:40Exactly.
- 36:41And so this whole thing is like very it's a common thing.
- 36:45So pip actually has this exact same workflow where they do everything in the release until
- 36:50the very end and then they push the tag to the repo because they know that if they push
- 36:54that tag and it needs to change, it's going to cause confusion.
- 36:57So, yeah, that kind of is like step five in there.
- 37:01It pushes that tag.
- 37:02And so that tag is highlighted red as a source of risk because that is a fork of CPython and
- 37:09tags tags are not in themselves verifiable because anyone can push a tag.
- 37:16If you if you're just looking at just the name of the tag, anyone can write a tag if you have
- 37:22right access to a get repository or a GitHub repository.
- 37:24And so if you push a tag and say someone has access to your account, someone could move that
- 37:31tag to a different commit, completely different commit.
- 37:33And if it were pulled in that time and no one decided to like check something else.
- 37:38So like the commit hash, for example, you would be like it would be able to inject code into the
- 37:44process.
- 37:44Right.
- 37:44Right.
- 37:44That's as far as we know, that has not happened.
- 37:46Yeah, that is bad.
- 37:47It is bad to inject arbitrary.
- 37:49Someone else's arbitrary code into Python directly.
- 37:52And it's also it's actually doubly bad because there's there's different degrees of bad in
- 37:57term like in supply chain security.
- 37:59One degree of bad is like if you're able to do bad stuff, but then people notice.
- 38:04Right.
- 38:05Or like people can see what happened.
- 38:07And so this is kind of like degrees of bad of you can inject code and then you can clean
- 38:11up after yourself afterwards.
- 38:13Right.
- 38:13Because you can tag back.
- 38:14You know, put the tag back.
- 38:16You have right access.
- 38:17Right.
- 38:17And so that that sort of like put the tag back or being able to circumvent it in that
- 38:22way is not good.
- 38:24Yeah.
- 38:25Don't give people ideas.
- 38:26These are not new ideas.
- 38:29So I feel less bad talking about these.
- 38:31Yeah.
- 38:32Another thing in this article is actually like tying every step of the release process back
- 38:38to a known attack that has succeeded against another project.
- 38:42So like SolarWinds was about build like release artifact poisoning, essentially.
- 38:48Right.
- 38:48You're like taking advantage of the fact that these release artifacts are being distributed
- 38:53and, you know, they're signed.
- 38:55Everything looks good, but you've gotten code injected into the actual artifact itself and
- 39:01it didn't get noticed.
- 39:01Right.
- 39:02And so like that sort of attack could happen against Python if if there's not mitigations
- 39:07against it.
- 39:07Right.
- 39:08And so, yeah, and then the next step is six.
- 39:10And so at this point, the release manager has sourced tarballs from the result of just
- 39:15running the release tool.
- 39:16And so they're kind of just waiting.
- 39:18They're sitting around waiting for the other experts to to do their thing now.
- 39:22And this is where Windows and macOS installers are actually built.
- 39:28And so these aren't built for security releases, but for 312.0, these will be built.
- 39:33And they're two completely different sets of build processes.
- 39:37One of them happens in Azure pipelines.
- 39:40So if you go to that release tool, there's actually like a Windows folder that just has
- 39:46100 YAML files in it for all of the different Azure pipeline configurations.
- 39:50Yeah.
- 39:51Yeah.
- 39:51Azure pipelines a little bit like GitHub actions.
- 39:53People who are familiar with that, but not Azure.
- 39:56Right.
- 39:56Something roughly.
- 39:58Yeah.
- 39:58Yeah.
- 39:58Yeah.
- 39:58And I think there was like a time where Azure pipelines and GitHub actions were like basically
- 40:02the same thing.
- 40:02Yeah.
- 40:03Yeah.
- 40:03Like in the very beginning.
- 40:07Yeah.
- 40:07So Azure pipelines, there's a whole bunch of stuff that happens there because there's
- 40:11Windows embeddable packages is something that gets uploaded to python.org.
- 40:15Windows installers also get uploaded to python.org.
- 40:18But that also there's like NuGet gets updated.
- 40:21The Windows store gets updated there.
- 40:23So like there's a lot happening there.
- 40:25And there's actually a lot of things that happen that require the actual release manager,
- 40:30the Windows release manager to like approve them.
- 40:33So like they're gated.
- 40:34These are things like signing keys that are, you know, as a part of the process, you have
- 40:39to like sign off to say like, yep, we want to give this job access to the signing key.
- 40:43So that's great.
- 40:43Do you know if Winget is kind of like the newer package manager for Windows?
- 40:49Do you know if Python goes there as well these days?
- 40:52Let's see.
- 40:52I haven't used Windows in a really long time.
- 40:55So I don't know.
- 40:56I do, but I only use it for play games and simple Windows tests.
- 41:00I don't know.
- 41:01All right.
- 41:01But yeah, so NuGet is like one of these kinds of package managers for Windows and maybe
- 41:05maybe Winget.
- 41:06People in the audience, if anyone knows, they can let us know.
- 41:08Yeah, definitely.
- 41:09I've not even heard of Winget.
- 41:11So I feel really out of the loop right now.
- 41:13It's only a couple of years old, I believe.
- 41:15Gotcha.
- 41:16Gotcha.
- 41:17And following on with that, those probably won't help you if you don't do a lot of Windows.
- 41:21Lewis asked, does Python maintain Chocolaty, which is similar to Winget, but more independent
- 41:27than Winget?
- 41:29They tried Winget and it was buggy and it wasn't great.
- 41:32Chocolaty is maybe a little older.
- 41:33I don't know.
- 41:34Same story probably, right?
- 41:35Yeah.
- 41:35I also don't know.
- 41:36Unfortunately, Windows is not my strong suit.
- 41:39Yeah.
- 41:40Yeah, it's all good.
- 41:42Definitely a tastier name.
- 41:43That's how I choose all my tooling is how tasty is the name.
- 41:47Yeah.
- 41:47And so then the counterpart to that is the macOS binary installers.
- 41:54And so there's basically just another set of scripts that get run on the macOS release
- 41:59manager, like their machine.
- 42:02And it builds just everything having to do with macOS.
- 42:06It does notarization.
- 42:07It does, you know, making, I know not as much about macOS either, but I know that notarization
- 42:13happens.
- 42:13And actually I've talked to a few folks about this one too, because this one, if you notice,
- 42:19it's just one square and it's just red.
- 42:21And I was like, yeah, there's a lot more to dig into there.
- 42:25Yeah.
- 42:26But yeah, the macOS notarization stuff is a serious pain as well.
- 42:29Like it's a little bit like submitting something to the iPhone app store where it, you know,
- 42:34like gets reviewed and yeah.
- 42:36Yeah.
- 42:36I think once you have it already notified, you can publish updates.
- 42:39Cause I was thinking as you were talking about that, like how do you design or deal with the
- 42:44latency, you know, of like I've submitted it and how long till someone picks it up and
- 42:48reviews it?
- 42:49I don't know.
- 42:49But I guess once it's kind of approved for notarization, then it, it just goes through
- 42:53pretty quickly.
- 42:54You just set a really long timeout on your CI job.
- 42:58Like exactly.
- 42:59Timeout seven weeks.
- 43:00Give it a week at least.
- 43:02Yeah.
- 43:03No.
- 43:04And so then after all of those things kind of happen, there's this stage in, you know,
- 43:10there's a stop, stop, stop line in the PEP 101 that just basically says for the release
- 43:14manager to wait for everyone to be done with their thing.
- 43:17And then once everyone's done with their thing and has uploaded everything to python.org, there's
- 43:22basically like this phase of testing everything.
- 43:24So you, you know, download everything, you make sure everything works on all the operating
- 43:27systems, the way that's expected to, you don't want to like blow the horn and then realize
- 43:32the very last mile that there's something wrong.
- 43:35And so like lots of testing happens.
- 43:36And then after the testing happens at that point, then everything that will get uploaded
- 43:41to python.org or that has been uploaded to python.org gets signed by the release manager in particular
- 43:46with sigstore and GPG.
- 43:49And then from there, all of those signatures get published.
- 43:52And that is the end of python.org.
- 43:54All of the artifacts are published.
- 43:56And only then does the release manager, this is step 10, do a git push to the actual upstream
- 44:02CPython repo.
- 44:03And at that point, then the branch can be unblocked.
- 44:07All of these things, the release is done.
- 44:08Everyone's happy.
- 44:09We can celebrate.
- 44:11Yeah, that's kind of the very high level view of what happens.
- 44:15Amazing.
- 44:16A couple of thoughts here.
- 44:18First of all, the Windows square is like tangibly different than the macOS square.
- 44:25The Windows square says, send off some source code to Azure pipelines, a external repeatable
- 44:32CI build system.
- 44:33Whereas the Mac one is like, build it.
- 44:35You know what I mean?
- 44:36That's actually pretty interesting.
- 44:39And I don't know that there's an Azure pipeline for macOS, right?
- 44:42Like that's just the sort of the story of Mac and servers.
- 44:45But just highlighting those differences, right?
- 44:48Like it's a different thing to say, I build on my machine with whatever I got versus I push
- 44:52to something like Azure pipeline CI, CD and get some results back.
- 44:56Yeah.
- 44:56Both the source tarball builds and the macOS builds are all local, right?
- 45:02And they're not done with a repeatable like CI provider.
- 45:07I was actually able to get like the actual source tarballs to work on GitHub actions.
- 45:12And so that's something that I've worked on and provided that to release managers.
- 45:18And we're talking about it right now.
- 45:19And macOS is actually, to my knowledge, is actually going to be revamped a little bit
- 45:25because that tooling has been around for so long.
- 45:28I think that there's going to be some work done on it.
- 45:30And so I haven't dug into it as deeply.
- 45:32I've kind of more just provided a bunch of context to the release managers about things
- 45:36that I want to see.
- 45:37Like if I were to do this myself, this is the other things I'm interested in, right?
- 45:42Provided that you actually had access to a macOS system.
- 45:46I'm sure you could do it all from the CLI because, for example, for the Talk Python courses apps,
- 45:50we use Flutter and you just say Flutter run.
- 45:52And it compiles that iOS or macOS version somehow through the command line.
- 45:59And then like out comes a thing that is already deployed onto a simulator or something, right?
- 46:04So it could happen.
- 46:06I mean, there is some hosting, but it's kind of like, here's your Mac mini in the cloud.
- 46:12Yeah, I mean, there is a GitHub Action supports macOS.
- 46:16Does it?
- 46:17Okay.
- 46:17So possibly, yeah.
- 46:19Maybe it could happen.
- 46:20I'm not saying it has to, I'm just, it was kind of a striking difference that one is like
- 46:24a CI, CD process and one is local and manual.
- 46:26Yeah.
- 46:27Actually, Windows is the most repeatable, most like actually isolated from any, from the,
- 46:34just the machine itself, right?
- 46:36The release manager themselves.
- 46:37So, yeah.
- 46:38Yeah, that's pretty interesting.
- 46:39And then we have binaries and they get published and everybody is happy.
- 46:43We all go and install it.
- 46:45And it's been in testing for quite a while, right?
- 46:47Like we've had a bunch of betas.
- 46:48We had alphas.
- 46:49We have had three release candidates and on Monday we'll have a dot zero.
- 46:54It's exciting.
- 46:55It's really exciting.
- 46:56It is exciting.
- 46:57The other question I would ask you is like, what is the time from like step one to step
- 47:0210?
- 47:03How much clock time has passed?
- 47:05Wall time.
- 47:05I would say that it is on, it's on the scale of hours.
- 47:11It's not like a day, which is kind of incredible, right?
- 47:15The fact that you get three volunteers together to do a bunch of all of this stuff.
- 47:21And it only takes a couple hours.
- 47:23It obviously depends on how many problems you run into on the way, because if you like get
- 47:27to the very end and then there's a problem that you find in testing, like you have to kind
- 47:31of start over, but yeah, if everything goes to plan, which has happened, I've coordinated security.
- 47:38Like there was a couple of security fixes that were in 3.115 that I coordinated.
- 47:42And yeah, I got to kind of witness the, okay, we've decided we're making a security release to the actual.
- 47:49It's out there.
- 47:49We can now talk about the vulnerabilities.
- 47:51Yeah.
- 47:52Was that the int parsing thing?
- 47:54It was the, what was it?
- 47:56There was an int parsing, or was it int parsing?
- 48:00No, it wasn't int parsing.
- 48:01Really long ints.
- 48:02I don't know.
- 48:02No, that's a different one.
- 48:03No, it was, there was a TLS, and this one sounds really scary.
- 48:09It's not as scary.
- 48:10It's a TLS bypass on the server side.
- 48:16So like if the client is supposed to be authenticated, for example, if you're using MTLS, you can,
- 48:23if you like send a handshake and then immediately close your socket, you can get lucky during like a,
- 48:30a brief period of time where the socket on the other side, like the server socket will say like,
- 48:35oh, it's closed.
- 48:37So it's fine.
- 48:38Right.
- 48:38And the data that whatever you sent over the wire won't, will still be readable, but then the
- 48:45handshake hasn't actually like completed.
- 48:46And so that sounds like scary, right?
- 48:49But it's, it's, it's actually not as bad because so many protocols, well, for one, so many protocols
- 48:56don't even use client authentication at all.
- 48:58So that's one huge point.
- 49:00The other side of it is that all protocols that people do end up using like mutual TLS with
- 49:07are protocols that like, you have to like send something back to, so like HTTP, for example,
- 49:14you have to send something back.
- 49:15And at that point the socket is closed.
- 49:17And so it can't send the data back.
- 49:20So there's like no data exfiltration.
- 49:22It's a pretty narrow scope of like what's actually vulnerable.
- 49:26But yes, the fix for that vulnerability is in 3.11.5.
- 49:31And there's another one too, but it's, it's a little bit more minor.
- 49:34Well, we'll start fresh with 3.12 and hopefully you will not have to witness one of these releases.
- 49:39Honestly, they're given how large CPython is and how wide ranging it, its standard library
- 49:44attempts to be.
- 49:45It's, it does not have many vulnerabilities.
- 49:48I mean, you go look at like a web browser upgrade.
- 49:50It's like, here's the 27, like remote code execution vulnerability.
- 49:55Maybe not quite that many, but here's the 27 security fixes this month.
- 49:59You know?
- 49:59Yeah.
- 50:00We've maybe, maybe it's a little more front of mind right now.
- 50:03Now that like Chrome is on their fifth zero day of the week, but yeah, it's, it's pretty
- 50:07tough week for Chrome right now.
- 50:09Yeah.
- 50:09And Firefox and the rest of us.
- 50:11Yeah.
- 50:11Yeah, for sure.
- 50:12let's see another, another comment from Frank says six door and GPG seem a bit at the
- 50:19end of the process.
- 50:20Considering these are billed locally in some cases, how does one guarantee of the sign sources
- 50:25are still right?
- 50:26Yeah.
- 50:27So this is kind of getting to the, like, I agree with you.
- 50:30How, how does one, how does one track that they're still right?
- 50:33so they, they get uploaded to python.org and at that point they're kind of like in a
- 50:39holding pattern for testing.
- 50:41And so those binaries are there, they're on python.org.
- 50:44They've got, you know, the hashes have already been taken.
- 50:46then the testing is happens.
- 50:48So like anything that happens between that and the six or starting, like, yeah, at that point
- 50:53it's kind of protected, but yeah, there is this really big dwell time.
- 50:56Where you just have artifacts sitting on someone's machine and they're going to get signed and
- 51:02sent out the door.
- 51:03And that's kind of like the due diligence of release managers.
- 51:06They need to make sure that those are the right artifacts that they've been tested properly,
- 51:10that the ones that you tested locally are the ones that are going to get ended up being
- 51:14signed.
- 51:14yeah.
- 51:16And so this is something, this is like a, a piece of the whole puzzle that gets mitigated
- 51:21by having those builds happen on external services, as opposed to on someone's local machine.
- 51:26Because at that point you're just giving, yeah.
- 51:28Yeah.
- 51:28You're just giving this like set of scripts, like very, very narrow set of input.
- 51:33Like I want this exact git commit and this version number to get built.
- 51:38And then out pops like a tar ball that's already been signed and verified and everything.
- 51:42And then from there, you just put that on python.org.
- 51:45Right.
- 51:45Like that, that is a lot less.
- 51:47there's a lot less of that risk where it's just on someone's machine.
- 51:51And how, how do, how does one know that that is the exact thing that they built?
- 51:55It's, it's not provable.
- 51:56Yeah.
- 51:57What about virtual machines for these gray boxes?
- 51:59I mean, obviously the Azure one, that's, that's its own thing.
- 52:02But have you considered like a, a Docker or an official just RLLs VM and go like, here,
- 52:09take this, run that.
- 52:11You know what I mean?
- 52:11yeah.
- 52:13To make it a little less dependent on the person whose role it is that year.
- 52:17It definitely would help with the reproducibility side of things because as we know,
- 52:21Docker is just the whole machine shipped in a box.
- 52:24Right.
- 52:24Yeah.
- 52:25so yeah, in, in theory, if you build the same thing again, in that exact same image,
- 52:29you would end up getting a pretty similar result.
- 52:31So it helps on that front, which, which is good.
- 52:33I think the tough thing is, is that you don't, you still don't have control of the
- 52:38inputs and the output.
- 52:39You also still don't have like this, like it comes out of the Docker container.
- 52:44You get a tar ball.
- 52:45There's still that time in between when the tar ball is out of the container and when it's
- 52:49actually on python.org where it's on someone's machine that is not in a container.
- 52:54and containers also aren't the best in terms of like, you, you did mention virtual
- 53:00machines as well, but even, even that like on a machine that is a high value target,
- 53:07you know, maybe it's worth it.
- 53:08Who knows?
- 53:09Yeah.
- 53:09Yeah.
- 53:10Who knows?
- 53:10All right.
- 53:11Well, it's pretty interesting and, it's, it's happening Monday.
- 53:15So very exciting.
- 53:16And I'm, I'm looking forward to all the new work.
- 53:19I mean, are there new features in three 12 that are you particularly excited about?
- 53:24You know, I, since being in this role, I actually haven't been paying attention to Python releases
- 53:30as much Python features as much.
- 53:32I'm, I'm mostly excited about it getting faster.
- 53:34I mean, the generic, it's just straight up faster.
- 53:37Like there's no one on the planet that's not happy about that.
- 53:40what are the major features this, this release?
- 53:43So there's like a, some more broad F string thing.
- 53:46So you used to be able to have a subset of the language in the F string.
- 53:49And now you can kind of like program in the F string.
- 53:51I believe, type statement is better generic types.
- 53:55Yeah.
- 53:56There's like a, a simpler way to express generics and the type system.
- 54:00And then I'm with you, you know, honestly, like f-strings being nicer.
- 54:05That's awesome.
- 54:06Thanks for that.
- 54:07But faster, faster, faster is good.
- 54:09this per interpreter GIL is kind of part of that faster CPython thing, right?
- 54:14Like it's hard to leverage, but if you could just say in your threads, new interpreter for
- 54:18this bit, right?
- 54:19All of a sudden you escape the GIL for computational stuff.
- 54:23That'd be pretty interesting.
- 54:24but you know, also this, this is another interesting thing.
- 54:27If you pull up this list, like the size of the scroll bar, I don't know.
- 54:31We were talking about scary scroll bars earlier.
- 54:33Like this is next level.
- 54:35Let me see.
- 54:36I'm going to, I'll throw this into omnivore.
- 54:38Are you a fan of omnivore?
- 54:39This app?
- 54:40Omnivore.
- 54:40Never heard of it.
- 54:41What is it?
- 54:42Omnivore.app.
- 54:44Kind of a Instapaper pocket replacement.
- 54:46Oh, I'm already logged into it.
- 54:47Look at that.
- 54:47Oh, super, super cool.
- 54:49So I go here and you say add a link.
- 54:52Actually, it just, I think it just went in there.
- 54:54Let's see.
- 54:5440 minutes just to read that what's new.
- 54:56That's what I was trying to pull.
- 54:58Oh, it just, yeah.
- 55:00It calculates that for you.
- 55:02It's like, it's going to take a while.
- 55:03So just a sense of like, what is new in Python 3.12?
- 55:07That's a ton, right?
- 55:08Yeah.
- 55:09A ton of stuff, like tons of fixes, tons of fixes and improvements.
- 55:13Mike, people are out in the audience says, Python dash M SQLite 3 is nifty.
- 55:17Mike, you're going to have to tell me more about this.
- 55:19Does that, does that open up a database now?
- 55:22That would be lovely.
- 55:23Yeah.
- 55:24That would be cool.
- 55:25Kind of like the HTTP server.
- 55:26Yes.
- 55:27Yeah.
- 55:28With the JSON tool.
- 55:29The JSON tool is the one I use the most.
- 55:31What's that one do?
- 55:31So you can like pipe JSON into it and it'll just make it pretty.
- 55:35It's pretty, it's questionable how useful it is, but it sure does make pretty JSON.
- 55:39Yeah.
- 55:40Which I really appreciate.
- 55:42Like two, two space indented JSON.
- 55:44That is, that's perfect.
- 55:46Indeed.
- 55:47All right.
- 55:47One more comment from the audience and then we'll maybe wrap it up.
- 55:50Karen says, let me, she's clarifying above like VM Docker for less, less changes and better reproducibility.
- 56:01VM Docker for less heterogeneity reproducibility than the current situation, which is affected by a given user's environment.
- 56:10Yeah.
- 56:10Like what web browser did you install today or something completely unrelated or, you know,
- 56:15or like you upgrade, if it's your personal machine and you're using tools, like if you upgrade those tools, it could pull some other system dependency.
- 56:23Right.
- 56:23That ends up being relevant to the build of CPython and yeah, it's just, there's just so much that could be different over the course of even a few days.
- 56:31Yeah.
- 56:32Yeah.
- 56:32Which is why it's interesting that the windows one goes to Azure pipelines.
- 56:36Cause it kind of pulls, puts that to the side, right?
- 56:39Yeah.
- 56:39All right, Seth.
- 56:40Well, this has been super, super interesting and thanks for giving us a look into this world.
- 56:46So yeah, very, very excellent.
- 56:48And I guess, you know, final two questions.
- 56:51You can write some Python code.
- 56:52What editor using these days?
- 56:54Oh yeah.
- 56:55I'm using PyCharm.
- 56:56I, I love PyCharm specifically.
- 56:58You know, the, I have the, what is it?
- 57:01I had the professional edition for a good long while and then I let that subscription lapse and I need to just redo it.
- 57:07But so I'm using the community edition right now, but yeah, I love PyCharm so much.
- 57:11So really good editor.
- 57:12Awesome.
- 57:13I'm there with you.
- 57:14And then notable pipe I package, something that I already talked about these.
- 57:20I, so pip audit, just use pip audit.
- 57:22There's so much work happening somewhere.
- 57:24With pip audit that it, it just makes sense for you to use it because there's just a ton of work happening.
- 57:30And if you just add it to your workflow, you'll just know that things are vulnerable or like what's vulnerable and like what versions you should update to.
- 57:36Yeah.
- 57:37I already have some tooling that like some aliases that do three or four steps to actually update my dependencies and install them.
- 57:44Like I might as well just throw this as like another and, and pip audit.
- 57:49Yeah.
- 57:49And you can actually, so you can, I think there's a way that you can tell pip audit to install packages, but then it will like say something.
- 57:58If there is a vulnerability in whatever you're installing.
- 58:00Right.
- 58:01So like you can even replace like use pip audit.
- 58:05I think that that is a feature.
- 58:06All right.
- 58:07I think so.
- 58:07It has a features thing.
- 58:09Let me look at it.
- 58:09Oh, let's see it.
- 58:10Oh, it's not going to work because it's not the read me.
- 58:12It's true.
- 58:14I got to, got to go to the homepage, which will take some here.
- 58:17So I got to go to the source.
- 58:20No, where's the GitHub?
- 58:21Let me go to the stars.
- 58:22All right.
- 58:22You know what?
- 58:23Maybe I don't want to click this thing.
- 58:24Features.
- 58:25There we go.
- 58:25Multiple emitting.
- 58:27We haven't talked about S bombs, but seamlessly reusing.
- 58:31Yeah.
- 58:33If it reuses the pip caches, maybe, maybe, maybe.
- 58:36All right.
- 58:37I'll play with it.
- 58:38We'll see.
- 58:38People can check it out.
- 58:39Citation needed.
- 58:40Citation needed.
- 58:42Exactly.
- 58:42Citation needed.
- 58:43That's right.
- 58:44All right.
- 58:44Well, yeah.
- 58:45People check out pip audit.
- 58:47That looks excellent.
- 58:47And yeah.
- 58:49Final call to action.
- 58:50People are interested in this.
- 58:51I mean, give a thought to it on Monday, theoretically, at least in the past, if you've listened too
- 58:57far in the future, but you know, the next release.
- 58:59Yeah.
- 58:59No, I think the biggest, so in terms of like, what can you personally do?
- 59:04Because like, there's just, I just talked about so much stuff that is just kind of happening
- 59:08in the background, but there's also stuff that like individual people can do.
- 59:11And the most impactful URL that you can visit for security, if you're an open source consumer
- 59:17or like a maintainer, like it doesn't matter.
- 59:20This is just going to be impactful.
- 59:21If you work in software is best.openssf.org.
- 59:26So that is basically just like a webpage and it just has a few URLs and you click into
- 59:31any of those URLs and it's just gives you like a checklist of here's things to think
- 59:36about.
- 59:36Here's, and then if you click into those checklist items, it gives you, it's kind of like this
- 59:40recursive, nice, like guiding force of like, here's the things you could be doing.
- 59:46Right.
- 59:46And if you want to dig in more concise guide for developing more secure software, in other
- 59:50words, npm best practices and so on.
- 59:54Yeah.
- 59:54Excellent.
- 59:54Yeah.
- 59:55I'm hoping to put a like Python best practices guide there by the end of my, by the end of
- 1:00:00the, the year that I'm here.
- 1:00:02So don't you worry.
- 1:00:03Look forward to that.
- 1:00:04Excellent.
- 1:00:05I'll be right there.
- 1:00:05We'll get it above on the, on the list.
- 1:00:08Yeah.
- 1:00:08It'll, it'll somehow not sort alphabetically and it'll be okay.
- 1:00:14Tip the scales a little bit.
- 1:00:15Cool.
- 1:00:17Well, thank you for being here, Seth.
- 1:00:18Thank you.
- 1:00:19And thank you for all this hard work that you're doing.
- 1:00:20It's, it's good to know that you're out there.
- 1:00:22keep an eye on all these things.
- 1:00:24Thank you.
- 1:00:24Thank you so much for having me on the show.
- 1:00:26This has been lovely.
- 1:00:27Yeah, you bet.
- 1:00:28Catch you next time.
- 1:00:29Bye.
- 1:00:29This has been another episode of talk Python to me.
- 1:00:33Thank you to our sponsors.
- 1:00:35Be sure to check out what they're offering.
- 1:00:37It really helps support the show.
- 1:00:38The folks over at JetBrains encourage you to get work done with PyCharm.
- 1:00:44PyCharm professional understands complex projects across multiple languages and technologies.
- 1:00:49So you can stay productive while you're writing Python code and other code like HTML or SQL.
- 1:00:54Download your free trial at talkpython.fm/done with PyCharm.
- 1:00:59Want to level up your Python?
- 1:01:02We have one of the largest catalogs of Python video courses over at Talk Python.
- 1:01:06Our content ranges from true beginners to deeply advanced topics like memory and async.
- 1:01:11And best of all, there's not a subscription in sight.
- 1:01:13Check it out for yourself at training.talkpython.fm.
- 1:01:16Be sure to subscribe to the show.
- 1:01:18Open your favorite podcast app and search for Python.
- 1:01:21We should be right at the top.
- 1:01:22You can also find the iTunes feed at /itunes, the Google Play feed at /play,
- 1:01:28and the direct RSS feed at /rss on talkpython.fm.
- 1:01:33We're live streaming most of our recordings these days.
- 1:01:35If you want to be part of the show and have your comments featured on the air,
- 1:01:39be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
- 1:01:43This is your host, Michael Kennedy.
- 1:01:45Thanks so much for listening.
- 1:01:46I really appreciate it.
- 1:01:48Now get out there and write some Python code.
- 1:01:49I'll see you next time.
- 1:02:10Thank you.