WEBVTT

00:00:00.001 --> 00:00:04.600
Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to

00:00:04.600 --> 00:00:12.760
your earbuds. This is episode 366, recorded January 9th, 2024. Welcome to the new year.

00:00:12.760 --> 00:00:14.920
I'm Michael Kennedy. And I'm Brian Okken.

00:00:14.920 --> 00:00:19.180
And Brian, this episode is sponsored by us. Support our work by taking our courses,

00:00:19.180 --> 00:00:24.500
the Talk Python training ones, the complete pytest course, and as well as through our

00:00:24.500 --> 00:00:29.000
Patreon supporters. All those links are at the top of your show notes and your podcast player,

00:00:29.000 --> 00:00:35.060
episode page, and so on. Connect with us over on Mastodon. You'll find us all on Fosstodon.

00:00:35.060 --> 00:00:41.860
That's right. Michael, Brian, and the show. It has its own pronouns and gets thrown into the group

00:00:41.860 --> 00:00:46.480
and has its own website and all that. So come see Python Bytes over there as well. And if you want

00:00:46.480 --> 00:00:52.020
to be part of the live stream, you're welcome. That's certainly not required to take part and

00:00:52.020 --> 00:00:56.100
enjoy the show. But if you want to be part of the live stream, pythonbytes.fm/live. Usually

00:00:56.100 --> 00:01:00.800
you'll see some scheduled upcoming one. You can click, you can, you know, smash the bell,

00:01:00.800 --> 00:01:04.820
crush the subscribe, all the things they say over there. Yeah, Brian, it's been a while. Welcome

00:01:04.820 --> 00:01:11.500
back to the show. It has been a while. I'm excited to be back. I am too. Thanks everyone for, you know,

00:01:11.500 --> 00:01:16.860
being patient with us while we took a little break over the winter break. It's always a little bit

00:01:16.860 --> 00:01:22.220
tricky to juggle that kind of stuff, especially Brian, when you're on a beach and it's 80 degrees

00:01:22.220 --> 00:01:27.840
Fahrenheit or 20 degrees Celsius, 22, something like that. It was, it was a windy day. It was,

00:01:27.840 --> 00:01:32.180
there was one day it was windy. It was, it was rough. I'm really sorry about that.

00:01:32.180 --> 00:01:39.340
Thank you. Thank you. I appreciate your balances. Yeah. Brian, can I, can we maybe not skip this

00:01:39.340 --> 00:01:45.640
episode because I'm in Hawaii hanging out on the beach, sipping drinks? Yeah, no, no, no,

00:01:45.640 --> 00:01:50.500
it was lovely. It's good to get away, but it's also really good to be back. So yeah. Yeah. And I

00:01:50.500 --> 00:01:56.620
missed you. Yeah. I missed you too. And everyone missed, missed the audience. shall we shit it

00:01:56.620 --> 00:02:06.140
off? Yeah. 2024. Let's get it. Let's get started. Let's get started. Okay. So, Anthony shot. So

00:02:06.140 --> 00:02:12.800
one of the things that's possibly hopefully coming into Python 13 is Python 3, 13, sorry, we're not

00:02:12.800 --> 00:02:18.640
all the way up to Python 13 yet. We're still in three, three that 13 is a jet compiler. It's,

00:02:18.640 --> 00:02:27.080
and, and I'm, I'm with, because of like, you know, Java and other languages, I'm familiar with

00:02:27.080 --> 00:02:32.420
jet compilers, but pythons is going to be a little different. So Anthony Shaw was kind enough to write up,

00:02:32.420 --> 00:02:38.060
um, a article kind of walking through it and it's a really nice. there's a couple of things that I,

00:02:38.060 --> 00:02:44.100
I recommend reading it. If, if you don't really know what a jet compiler is, or if like me,

00:02:44.100 --> 00:02:50.460
you didn't know what a copy and paste jet compiler or jet, whatever implementation is. So that's kind of

00:02:50.460 --> 00:02:55.380
where he goes with this. And he, he starts off talking about really what a, what a jet is. And

00:02:55.380 --> 00:03:01.700
really it's, it's something that basically generates your, your semi, your compiled code

00:03:01.700 --> 00:03:07.560
for a lot of times it's compiled code, machine code. but for Python, it's going to be, the,

00:03:07.560 --> 00:03:13.440
not the compiled code, but the byte code. So getting the byte code ready, I think I may have gotten this

00:03:13.440 --> 00:03:22.340
wrong. but, we, he walks through, kind of what a, what a compiler is or a jet compiler is

00:03:22.340 --> 00:03:29.180
with, with the, as if you were writing it in Python. So he goes through a little example of making your own

00:03:29.180 --> 00:03:34.800
Python version of the CPython interpreter, like, which is actually written in C, but if you were to write

00:03:34.800 --> 00:03:39.940
in Python, it might look like this, like, switching on op code of load instruct load constant,

00:03:39.940 --> 00:03:46.540
things like that. and you can see what those primitives are by using the disc, disc, module

00:03:46.540 --> 00:03:52.980
for disassembler. And, and that's fun. The, and then he walks through kind of, okay, so that's

00:03:52.980 --> 00:04:00.140
what a, what a JIT compiler might be. What is a copy and patch JIT compiler, not copy and paste copy and

00:04:00.140 --> 00:04:07.000
patch. And, and that's a little, a little bit more harder to describe over audio, but he, but,

00:04:07.000 --> 00:04:14.000
but Anthony does a really good job describing it. And, and then talking about really this thing,

00:04:14.000 --> 00:04:19.400
it, instead of like copying a piece and then running it, it copies like more than one bit,

00:04:19.400 --> 00:04:25.220
like the entire function and then bring the whole thing. And it's a little bit faster. And, and then

00:04:25.220 --> 00:04:30.400
we're going to do something like that. It's going to be something like that for Python inside of the Python

00:04:30.400 --> 00:04:37.280
C, interpreter and how to that's, it's just a good walkthrough to kind of understand what is going

00:04:37.280 --> 00:04:43.500
on. What are these people doing and why? And the why is it's going to be a couple of things. It's

00:04:43.500 --> 00:04:49.900
going to be faster. and in his, there's some benchmarks that show it's from like two to 9% faster,

00:04:49.900 --> 00:04:54.740
which is great. I mean, actually, anytime you can make things a little faster, it's good. but,

00:04:54.860 --> 00:04:59.960
but is it worth it for this in it's, it's worth it for this partly because mostly it doesn't make

00:04:59.960 --> 00:05:06.040
it slower, which is the good part because, because of this JIT compiler, there's other tricks that they

00:05:06.040 --> 00:05:11.360
can do down the line to make things a lot faster. So this is, this is great news and a good explanation.

00:05:11.360 --> 00:05:16.840
Yeah. It's super exciting. And you're on top of the news today, Brian, like this came out this morning.

00:05:16.840 --> 00:05:23.840
So, well, well done. This is brand new from Anthony Shaw. Anthony, excellent work. writing this up and,

00:05:23.840 --> 00:05:31.860
um, all the things. So one part that's interesting is two to 9% is great. Like that's still really good

00:05:31.860 --> 00:05:38.360
to make things faster. Yeah. But he also points out that this is just the foundation. Like once you have

00:05:38.360 --> 00:05:44.880
a JIT, there's all kinds of interesting things that JITs can do on a per hardware architecture,

00:05:44.880 --> 00:05:50.960
per platform story, right? They can say, well, you wrote this code, but I know we have these specific

00:05:50.960 --> 00:05:56.760
machine instructions, specialized machines, instructions on this CPU. So let's make it do

00:05:56.760 --> 00:06:01.980
that. Or I see that you could actually inline this function instead of just make it run faster. We could

00:06:01.980 --> 00:06:05.860
inline it over here and here and here, and then, you know, function calls in Python are expensive.

00:06:05.860 --> 00:06:11.040
So maybe they just become not function calls, right? there's, there's a lot of possibility for

00:06:11.040 --> 00:06:16.660
where things go. It would be interesting. I wonder if you could even do things like, you know,

00:06:16.660 --> 00:06:21.500
compile stuff to see, and you see optimizations as part of the JIT compiler, right? Like maybe there's

00:06:21.500 --> 00:06:28.040
a bunch of like layers that could happen. I don't know, but yeah, basically this is, you know, a foot

00:06:28.040 --> 00:06:32.520
in the door for compiler optimizations that we've not had before in Python.

00:06:32.520 --> 00:06:35.100
Yeah. Yeah. It's pretty exciting. So, yep.

00:06:35.360 --> 00:06:40.980
Excellent. Excellent. So the future is bright. Also compounding is interesting, right? Right.

00:06:40.980 --> 00:06:45.880
We're supposed to get Python much, much faster by making it like a little, a little bit faster over

00:06:45.880 --> 00:06:51.020
five years continuously. Right. And this is just part of that, right? So you keep adding the things up and

00:06:51.020 --> 00:06:57.360
the Python, I don't know, three, 14, 15 versus three 10 when they started could be super, super different.

00:06:57.360 --> 00:07:03.280
Yeah. All right. Let's, I hope people like deploying, packaging, bundling, talking about managing

00:07:03.280 --> 00:07:07.660
your projects because that's all I got this week, Brian. I got one after another. So let's start out

00:07:07.660 --> 00:07:15.500
with this, Mastodon post by Bass Neiholt. And Bass says, we're launching Unidep, which is a

00:07:15.500 --> 00:07:21.960
unified Conda and pip dependency management system. Okay. So we've got the Conda world, we've got the

00:07:21.960 --> 00:07:27.560
PIP world. Sometimes they kind of work together, but they're pulling from different sources. So you can

00:07:27.560 --> 00:07:32.080
like in a Conda virtual environment, you could pip install a thing, I believe, and it would still

00:07:32.080 --> 00:07:36.900
install, but here's the deal. Like you can create a single requirements.yaml file and say,

00:07:36.900 --> 00:07:42.200
I depend on these different projects. Those two come from Conda, Conda forge or something.

00:07:42.200 --> 00:07:45.560
These three come from pip IPI. Interesting, huh?

00:07:45.560 --> 00:07:48.800
I'm actually excited about this. This is very interesting.

00:07:48.800 --> 00:07:52.260
Yeah. It's super interesting. It works with pyproject.toml and setup.py.

00:07:52.260 --> 00:07:57.400
It also is good for monorepos. So why is this good for monorepos? Monorepos are,

00:07:57.980 --> 00:08:04.740
I don't want to have to switch projects on GitHub. I just want one ginormous one for a whole company.

00:08:04.740 --> 00:08:09.860
So let's just have one, right? Which is kind of an insane way of working, but it's also pretty

00:08:09.860 --> 00:08:13.540
interesting, right? Like I've got two libraries. They depend on each other. It's just all on the

00:08:13.540 --> 00:08:18.480
same project structure. So, you know, you just version them together, but that's literally every

00:08:18.480 --> 00:08:23.700
project for your company. And there's different teams potentially working with different versions

00:08:23.700 --> 00:08:29.920
different things. So maybe there's some data science folks and there's some web API folks and

00:08:29.920 --> 00:08:35.480
the web API folks are maybe pip and the data science folks are Conda. So here you could express all of

00:08:35.480 --> 00:08:40.900
the requirements for the different projects through these different sources, right? Because some might

00:08:40.900 --> 00:08:46.040
be Conda, some might be pip, but here's one, one way to express it. Also, it'll create consistent

00:08:46.040 --> 00:08:52.260
Conda lock files for multiple projects. It has a platform support and you can just,

00:08:52.260 --> 00:08:58.900
you need up install if you want, which is pretty cool. So looking over at the GitHub here,

00:08:58.900 --> 00:09:04.060
yeah, pretty much, honestly, pretty much says the same thing, but it shows you some examples of,

00:09:04.060 --> 00:09:10.220
you know, how you might express, you know, what is, what is a Conda dependency? What is a pip dependency?

00:09:10.540 --> 00:09:16.180
So like in your requirements.eml, you just have dependencies. Let's just say numpy, or you'd say

00:09:16.180 --> 00:09:22.960
Conda colon Python graph is, or you'd say pip colon graph is, if you wanted that one and so on. Right.

00:09:22.960 --> 00:09:29.000
And look at this, you can even include other, you have like nested requirements.eml, which maybe

00:09:29.000 --> 00:09:35.480
talks to the monorepo type of thing or multiple projects just in one repository, right? Like this

00:09:35.480 --> 00:09:39.420
thing actually requires these four other things. This, this is even interesting. You know, we were talking

00:09:39.420 --> 00:09:43.760
about courses and I know you're going to mention something about your course later. This is actually

00:09:43.760 --> 00:09:48.280
would be really nice for courses as well to do. And I suspect you probably could do with pip. I just,

00:09:48.280 --> 00:09:53.600
it never crossed my mind. Right. I might have chapter one, let's do FastAPI stuff. Chapter two,

00:09:53.600 --> 00:09:58.340
let's add Beanie and MongoDB. And like those have different requirements files. And you might want

00:09:58.340 --> 00:10:03.300
to just be able to express like, well, just run this one, just run this thing. You have everything you

00:10:03.300 --> 00:10:07.500
need for the course, but you also want to not like talk about everything before you get to it. Right.

00:10:07.500 --> 00:10:11.840
You could have like one at the top of your course repository and then every chapter have its own

00:10:11.840 --> 00:10:15.000
one of these and then just like pull them together with this, like this.

00:10:15.000 --> 00:10:15.840
Oh, interesting.

00:10:15.840 --> 00:10:16.920
That's cool. Right.

00:10:16.920 --> 00:10:18.340
Yeah. I've never really thought to do that.

00:10:18.340 --> 00:10:22.020
I haven't either, but it seems like I should, I've just been copying that stuff around. Seems

00:10:22.020 --> 00:10:23.020
like I shouldn't do that really.

00:10:23.020 --> 00:10:30.740
Awesome though. Yeah. So, uni depth, it's brand new. I don't know if this thing's gonna

00:10:30.740 --> 00:10:35.560
take off and be super, super popular or if it's going to be kind of niche, but you know,

00:10:35.560 --> 00:10:40.420
it seems like it's solving a unique problem. And it really is kind of a time of like a thousand

00:10:40.420 --> 00:10:45.700
flowers blooming in the packaging and dependency managing space. Like previously we talked about

00:10:45.700 --> 00:10:47.860
hatch. I have more to say about hatch later as well.

00:10:47.860 --> 00:10:53.580
Do you remember, did you say that it were, you, you can use a pyproject.toml instead of,

00:10:53.580 --> 00:10:56.220
yes, you can. Okay. Yes. It's a,

00:10:56.220 --> 00:11:04.000
because there's already enough YAML in my life. Yeah. Yeah. You can use a pyproject.toml. Cool.

00:11:04.000 --> 00:11:09.100
Alternatively, one can configure the dependencies in the pyproject.toml under the tool.uni depth

00:11:09.100 --> 00:11:17.220
section. All right. Nice. There you go. Yeah. All right. Well, over to you. well, I would like a

00:11:17.220 --> 00:11:23.420
lot of people I've been, doing some work over the holiday break since we also took a break from

00:11:23.420 --> 00:11:30.000
podcasting a bit. I've been doing some open source work and I ran into, this is timely because I

00:11:30.000 --> 00:11:37.560
ran into, some problems with, with pull requests and wanting changes, changes in pull requests

00:11:37.560 --> 00:11:44.500
and having some of the problems with if somebody, does a pull request and their fork is on main

00:11:44.500 --> 00:11:52.420
instead of on a branch. And so, and it causes problems. and so instead of having to write this

00:11:52.420 --> 00:11:58.400
up as to why you should not do this, Hinnick beat me to the punch and wrote this great article saying,

00:11:58.400 --> 00:12:05.120
don't start pull requests from your main branch. and it's, it's tempting, right? when I first

00:12:05.120 --> 00:12:12.560
started using get at work, even at work, the, so personally, I, when I was started using get,

00:12:12.560 --> 00:12:18.060
I just used main and, and just checked. I just had one branch and that's no big deal with my,

00:12:18.060 --> 00:12:24.080
my own stuff with a, with a team. We had to decide, well, we're going to use, branches or forks.

00:12:24.140 --> 00:12:30.500
and, possibly not both, but you can use both. And in open source, it's common to use both.

00:12:30.500 --> 00:12:37.960
And what we mean is you fork the repository and you create a branch. why do you do both? Because

00:12:37.960 --> 00:12:41.780
it seems like if you're going to make a change, you just need one or the other, right? And you can't do

00:12:41.780 --> 00:12:46.940
a branch because you don't have permission. So you, you do a fork, but you do both a fork and a branch

00:12:46.940 --> 00:12:53.380
for reasons. And the reasons are spelled out, here first. if you, if you didn't do that,

00:12:53.380 --> 00:13:00.400
he's, he's giving the reasons in the sense of if you did main instead, why that's bad is first,

00:13:00.400 --> 00:13:04.660
um, you can only do one pull request at a time. If you were going to do your pull request off of

00:13:04.660 --> 00:13:11.020
your main branch and it's not been accepted yet. Well, you can't, you can't go and do another pull

00:13:11.020 --> 00:13:15.760
request for a different change. You can't do another fix because you've already used up your

00:13:15.760 --> 00:13:20.180
main. whereas if you do a branch off of that, you can have as many fixes as you want.

00:13:20.180 --> 00:13:24.960
So that's reason number one, but people might think, ah, I don't care about multiple stuff.

00:13:24.960 --> 00:13:30.880
I'm just fixing the one thing I care about. Great. if it takes a while, so somebody on the other

00:13:30.880 --> 00:13:38.240
end is going to have to pull, like review it, maybe ask you for changes to, maybe, merge it

00:13:38.240 --> 00:13:44.160
even that's great. If they end up merging your pull request, that's awesome. But the, what happens

00:13:44.160 --> 00:13:49.960
then is it'll, that branch will have changes of both the, both the main line and your branch

00:13:49.960 --> 00:13:56.220
all in this branch, your main branch. And now that has conflicts and you're not able to pull it back

00:13:56.220 --> 00:14:01.900
to your local repository. So polls won't work. And you just, you, I don't know what you do at that,

00:14:01.900 --> 00:14:07.140
at that point, you blow away your fork and start over. You delete your repository to start over.

00:14:07.720 --> 00:14:16.560
Yeah. lame. okay. The third reason is, is the pragmatic one of getting something done.

00:14:16.560 --> 00:14:23.560
And this is the one that bit me, a couple of weeks ago is, eat, there's two reasons you're,

00:14:23.560 --> 00:14:30.180
um, I may, I might be like messing this up, but, you can, if you have it on main it's,

00:14:30.180 --> 00:14:36.100
and you have branch protection on, which a lot of repos do most of most, a lot of big open source

00:14:36.100 --> 00:14:43.240
projects, the main is locked down. then, and you don't want, you want to allow it's allow

00:14:43.240 --> 00:14:49.760
edits from maintainers, is meaningless at that point, because what I want, want to do is if there's,

00:14:49.760 --> 00:14:53.580
if somebody does a pull request and I want to accept it, but there's a minor change to it that I,

00:14:53.580 --> 00:14:58.340
I want to like tweak it. Like maybe the, I don't know, the naming convention's wrong and it's not a

00:14:58.340 --> 00:15:04.200
big deal. I can just change it before I merge the pull request. You can't, if, if that's locked

00:15:04.200 --> 00:15:10.660
down the original, the person pulling into their, their, repository can't do that edit.

00:15:10.660 --> 00:15:18.200
And it, it's just not nice and it's not fun. So, just remember to do fork and branch don't do just

00:15:18.200 --> 00:15:23.300
fork. so that's, that's the, public service announcement for today.

00:15:23.300 --> 00:15:28.260
Yeah. I mean, fork is required because you, a lot of times you don't have right access to the main

00:15:28.260 --> 00:15:34.420
repo contributor access, but doing it from your main, doing it from like some other, the main branch

00:15:34.420 --> 00:15:38.300
instead of some other one is yeah. You only learn that that's a bad idea when you do it. And then

00:15:38.300 --> 00:15:43.680
you're like, Oh no, now I've done that once or twice. I'm like, I'm going to make a change and do a

00:15:43.680 --> 00:15:47.980
pull request and submit it. And what if they don't accept it? Then your main is out of sync forever.

00:15:47.980 --> 00:15:51.780
You can never sync your fork up again. And like, there's just all sorts of.

00:15:51.780 --> 00:15:56.740
And, and even if there's no ugliness there, let's say there's, and this has happened to me many

00:15:56.740 --> 00:16:02.980
times, you, and somebody wants to, to merge your stuff in, but they're merging other things

00:16:02.980 --> 00:16:07.680
too. And maybe they grabbed a few other things first. Now they, they really would like to have

00:16:07.680 --> 00:16:14.400
the merge from yours be really clean and just see the changes. So the great thing to do is to merge

00:16:14.400 --> 00:16:21.020
your, the new main to your new main, and then resolve it with your forked brand, your branch first,

00:16:21.020 --> 00:16:25.080
before going all the way back. And if you don't have that, it just doesn't work.

00:16:25.080 --> 00:16:30.620
Yeah. That's a good point too. Indeed. Indeed. All right. Let's get back to deployment.

00:16:30.620 --> 00:16:34.560
Okay. This one's different. Okay. Installed. This is kind of like a,

00:16:34.560 --> 00:16:42.120
like a little bit of a web 2.0 name installed, but zero vowels installed.

00:16:42.120 --> 00:16:50.800
Oh, in S I N S T L D. So this is an interesting project. When I first saw it, I was like,

00:16:50.800 --> 00:16:54.840
this seems like a bad idea. I don't know. This seems like just a bad idea. Let's not do this.

00:16:54.840 --> 00:16:58.660
And then people kept recommending it and saying stuff like, you know what, actually,

00:16:58.660 --> 00:17:03.500
that's kind of cool actually. So here's the deal. Previously, what we talked about is like

00:17:03.500 --> 00:17:08.340
the right way, right? You're going to create your requirements, your dependencies,

00:17:08.340 --> 00:17:12.880
you're going to have pin versions. You can have lock files. Someone is going to create a virtual

00:17:12.880 --> 00:17:18.240
environment or a Docker container or something like that. Then you're going to install all of those

00:17:18.240 --> 00:17:24.860
things, right? Right. What if you don't, what if you have, Brian, what if you have a single dot PY file

00:17:24.860 --> 00:17:30.860
you want to give to somebody and you want to just let them run it, but you know, it needs like one or two

00:17:30.860 --> 00:17:37.380
dependencies. Like maybe you really, really, really want to use rich because Will's project is awesome.

00:17:37.380 --> 00:17:42.320
And you just don't want it to look plain white, unformatted. You want it to look good, right?

00:17:42.320 --> 00:17:46.000
So you want to be able to handle one of your coworkers or somebody else, one of these things

00:17:46.000 --> 00:17:51.700
and say, just run it. Well, just run it becomes all of a sudden a conversation about virtual environments

00:17:51.700 --> 00:17:55.980
and all these things. Right. And like, ah, geez, just, just want to format it just a little.

00:17:55.980 --> 00:18:02.340
Could we somehow, well installed is kind of aiming to solve that problem. Right. So it's not like a

00:18:02.340 --> 00:18:08.280
high-end production sort of thing. It's a, let me be able to pass a file around without going through

00:18:08.280 --> 00:18:13.840
the whole process of, you know, like PI installer because like, well, oh geez, I made it exe for you.

00:18:13.840 --> 00:18:18.860
That's right. You're on windows. Let me recompile it. Like, okay, great. No. So here's the deal.

00:18:18.860 --> 00:18:25.080
It lets you run Python code without installing the dependencies, without mentioning the dependencies,

00:18:25.460 --> 00:18:33.160
without having any awareness said dependencies. So, so exist with one huge caveat. And that's,

00:18:33.160 --> 00:18:39.960
you must have installed installed. Okay. Once this thing isn't there, it can then bootstrap

00:18:39.960 --> 00:18:43.900
everything else. So maybe like, if this was a thing you were doing with your coworker story,

00:18:43.900 --> 00:18:51.040
I said like, okay, well everyone pip install dash dash, user installed or, or pip X installed,

00:18:51.040 --> 00:18:54.940
or I don't know, something like that. Right. But once that's there, then you can run and use arbitrary

00:18:54.940 --> 00:19:00.040
things from PyPI without having them installed or requirements file or going through a step. You

00:19:00.040 --> 00:19:06.500
just Python space, your thing off it goes. Also, if you were in a really weird situation, but you had

00:19:06.500 --> 00:19:12.740
to do it, you could use two versions of the same library package within a single execution of a program.

00:19:12.740 --> 00:19:18.560
Okay. Interesting. Which you might do that because you have incompatible libraries. Like I've talked

00:19:18.560 --> 00:19:25.620
before about there are times where I literally cannot pip install -r my requirements. Right. It's just

00:19:25.620 --> 00:19:31.960
like, Nope. This old janky version of some library depends. It's pinned less than something else, some

00:19:31.960 --> 00:19:37.680
other library. And then like another library is greater than that same library. Well, modern pip just

00:19:37.680 --> 00:19:43.860
says, guess we can't run your program. Take a hike. Right. So this would let you sort of, say this part of the

00:19:43.860 --> 00:19:48.460
code uses the old janky thing. Let's use it and then get rid of it and then go back and use another.

00:19:48.460 --> 00:19:53.760
All right. And also doesn't leave behind junk on your hard drive. It basically deletes everything. So

00:19:53.760 --> 00:19:59.460
how does this thing work? So basically in your code, you can say you have to import installed,

00:19:59.460 --> 00:20:05.560
and then you use a context manager. You can say with installed some package, and then you can use,

00:20:05.560 --> 00:20:09.360
like within that context manager, you have access to that. Pretty wild, huh? Okay.

00:20:09.760 --> 00:20:14.940
So basically that, that context manager will make sure that it's installed on your system. It'll

00:20:14.940 --> 00:20:19.400
download it, all those things. And then like when presumably when it closes, it'll delete it.

00:20:19.400 --> 00:20:25.680
You can also do it as a REPL. So you can, you know, interact with just like the Python REPL. You can

00:20:25.680 --> 00:20:31.440
interact with it that way. you can run a script. You can say installed some script, and then it'll,

00:20:31.440 --> 00:20:37.280
um, be executed as if you were running it like regular Python, but it'll, you can also pass in,

00:20:37.280 --> 00:20:42.720
um, dependencies that it might need to run it. Right. If you're like this out, if your program has

00:20:42.720 --> 00:20:47.040
imports of any packages other than the built-in ones, they'll be installed automatically.

00:20:47.040 --> 00:20:52.240
Right. So you just say installed some Python file and it goes, oh, you're saying import this stuff.

00:20:52.240 --> 00:20:56.480
You're import, you know, HTTPX. Hopefully you got the names, right? Yeah, exactly.

00:20:56.480 --> 00:21:03.300
So yeah, anyway, you can do a bunch of, a bunch of more advanced stuff you can talk about there.

00:21:03.300 --> 00:21:10.400
You can pin the versions. You can specify, which IPI, which package repository it comes from.

00:21:10.400 --> 00:21:14.280
If you have like a, the example here is a test one, but if you've got like a private whitelist

00:21:14.280 --> 00:21:19.600
server and so on. So there's a lot going on here. I don't know. How does this, how does this hit you

00:21:19.600 --> 00:21:20.240
seeing this?

00:21:20.240 --> 00:21:50.220
You know, the W I was, I was thinking I don't need it up until just a second ago where I know when you had you with the eight, being able to do multiple versions in the same file, even to say, like with, like, as an example, normally I test against multiple versions of PI test, for instance, or multiple versions of something. Like in my own stuff, I'm testing against maybe a few different versions of a particular.

00:21:50.220 --> 00:22:06.220
package. and I do that usually outside in talks to be able to, to, to install a different environment, set up a different environment to with those different, different things installed, but to be able to do it all in one run, that's pretty interesting.

00:22:06.220 --> 00:22:36.200
actually. It is interesting. Yeah. Yeah. So it's pretty interesting. apparently when it runs, it spits out basically the pip output, you know what I mean? It are, it comes, but in the context manager, you can say catch output equals true. And then it's kind of invisible to your users. It just takes a little startup time as it does the dependency stuff, you know? So yeah, yeah, yeah. Pretty wild. So when I first saw this, I thought, this seems like it's encouraging people to do the wrong thing, but it's, it's also some interesting flexibility. So there you have it.

00:22:36.200 --> 00:22:47.160
and sold. And sometimes people need to be encouraged to do the wrong thing. That's right. How else do you learn to do the right thing? No, just kidding. Yeah. All right. what, what do you got for our extras?

00:22:47.160 --> 00:23:17.140
I got a couple extras. I am super excited. The other thing, one of the things I was doing is open source code this break, but I also was, I was completing the complete by test course. so, I named it the complete by test course before it was complete. Now it actually is complete all 16 chapters. However, it's not, it's never really going to be done because this isn't a printed book. It is, is, is a project. It's,

00:23:17.140 --> 00:23:39.140
it's a course that's up on the web and I'm going to update it if I need to. So, I've, it's, I've got a good community going with it already. And, and we're going to, make sure that it's up to date with new versions of by test, like, by test eight is coming out. And if I don't think that I'll have to change anything, but if I do have to change stuff, I'll change it here first.

00:23:39.140 --> 00:23:42.900
you can just do a fine replace for a seven to eight and you're going to be fine.

00:23:42.900 --> 00:24:01.220
I don't actually put seven in there anywhere. I know, I know. but, but there might be some new toys that we want to play with and there already were. So one of the, one of the fun things was, was get in getting this is, is going through and being able to say, Oh, I do things a little differently now. Like one of the parts is building a, a, a pie test plugin.

00:24:01.220 --> 00:24:31.000
And I package a little differently now than I did several years ago. So, I got to use the new, new way and we're keeping that up to date. So that's the first thing. The other thing is this course took a lot of my time actually to get this to, to the point where it is now. And, and so some things went on the back burner and a couple of things were the other podcasts. So Python people and Python test, Python people has new people. Will Vincent, and I've got a whole bunch more than I need to release, but Will Vincent was on in October.

00:24:31.000 --> 00:24:53.600
And I finally got this released, and we talk about Django and writing technical books and Will's awesome. He also is the host of, Django chat podcast. and then I don't have any, the last, Python test episode was out December 15th, but I've got a whole 16 of them planned. They're not recorded yet, but 16 are planned. So these will come out in the next few months. So stay tuned.

00:24:53.600 --> 00:24:55.220
Awesome. Awesome. How about you?

00:24:55.220 --> 00:25:00.780
Well, I have a whole bunch of talk Python stuff coming. I think I have 12 scheduled or something.

00:25:00.780 --> 00:25:05.540
And it's kind of out of control to be honest, but I've got some extras that are more relevant here.

00:25:05.540 --> 00:25:06.160
Okay.

00:25:06.160 --> 00:25:16.400
Not see the joke yet. That is the end. All right. So Ofec just sent us a follow-up and it's a little unfortunate that we talked about this big release of hatch 1.8.

00:25:16.520 --> 00:25:39.380
And then went on a two week break because like the next day he said, great coverage on hatch 1.8. Thanks. However, one small correction. Remember I was so impressed and psyched that the binaries of your apps, if you made apps with hatch, which is a cool, cool feature of it would be signed. I'm like, how are they doing this? How do they get away with doing this? Well, they're not.

00:25:39.880 --> 00:25:51.320
So he's a one small correction. Only the binaries for hatch themselves are signed by the certificate of the PSF, not the binaries created by hatch for you. Those are your certificates problems.

00:25:51.840 --> 00:25:52.120
Okay.

00:25:52.120 --> 00:25:57.360
We're back to signing our own apps again and dealing with Apple and Microsoft and all that stuff.

00:25:57.360 --> 00:25:57.840
Okay.

00:25:57.840 --> 00:25:59.120
But it makes more sense, right?

00:25:59.120 --> 00:25:59.960
Okay.

00:25:59.960 --> 00:26:02.280
next, this is just interesting.

00:26:02.280 --> 00:26:08.900
high PI had new user registration temporarily suspended there.

00:26:08.900 --> 00:26:15.900
the volume of malicious users and projects being created outpaced the ability to respond to it in timely fashion.

00:26:15.900 --> 00:26:17.760
So like, we just need to slow down.

00:26:17.760 --> 00:26:19.040
No action required.

00:26:19.040 --> 00:26:21.060
This is from last week, just interesting.

00:26:21.060 --> 00:26:25.680
And I guess, you know, thank you everyone for being on top of this, honestly, because what a hassle.

00:26:25.680 --> 00:26:44.040
I also would, I don't know what they're doing right now, but at least I would recommend, I don't know if it would really help, but like cloud flare, turnstile, at least stop, stop the bots, you know, which is a way, way, way, way, way, way better, way better thing than the Google recapture.

00:26:44.040 --> 00:26:45.480
I think so.

00:26:45.480 --> 00:26:45.920
Yeah.

00:26:45.920 --> 00:26:49.300
Maybe if, if some kind of gate like that would be awesome, then put that up.

00:26:49.300 --> 00:26:50.500
Anyway, that's news.

00:26:50.680 --> 00:26:55.980
Also coming up next February, February 12th, which is in 33 days.

00:26:55.980 --> 00:27:04.740
I'm doing a YouTube only thing on talk Python that I think will be really fun with Martina Puglisi about data doodling.

00:27:04.900 --> 00:27:17.640
So she's got this whole cool series she's doing where she's doing, data science by just sketching it out and just drawing pictures and trying to understand data before jumping into like notebooks and stuff.

00:27:17.640 --> 00:27:23.980
And so we're just going to talk through some really fun doodles and it's all visuals, which is why it's YouTube only not on talk Python.

00:27:23.980 --> 00:27:24.700
Exactly.

00:27:25.560 --> 00:27:34.500
But so if you're interested, please come and, click the get notified to register and quotes, to be part of that, that live event.

00:27:34.500 --> 00:27:36.860
So hopefully people will, that'd be really cool.

00:27:36.860 --> 00:27:40.720
I think she's got some beautiful, beautiful work and you'll appreciate when we'll get there.

00:27:40.720 --> 00:27:46.520
and wrote an article called, which maybe should have R in the front.

00:27:46.840 --> 00:27:48.420
Are AI features a waste of time?

00:27:48.420 --> 00:28:01.480
So my premise is that, I'm just wondering like how many cumulative programmer hours have been utterly wasted on adding very mediocre AI features to every app imaginable that you rarely ever want to use.

00:28:01.480 --> 00:28:01.940
You know?

00:28:01.940 --> 00:28:16.440
So I just lay out like a couple of issues, like look at all these, these examples of apps that just like they're adding AI for the sake of adding AI, but it's not, you know, not bashing on like ChatGPT or something like it was just like, oh, you can click this to like,

00:28:16.680 --> 00:28:18.480
correct the date by AI.

00:28:18.480 --> 00:28:19.580
Like I just type the date.

00:28:19.580 --> 00:28:20.740
Why do I need the stupid thing?

00:28:20.740 --> 00:28:20.980
Right.

00:28:20.980 --> 00:28:28.140
And, another, this example I use with spark email, which has this really cool, Brian, see how beautiful that is.

00:28:28.140 --> 00:28:29.780
You can write beautiful emails in spark.

00:28:29.780 --> 00:28:30.540
Love it.

00:28:30.540 --> 00:28:30.800
Right.

00:28:30.800 --> 00:28:40.980
But if you try to proofread it with AI, it deletes all the content, the images, and it just like jams it back as plain text, like response from ChatGPT or something.

00:28:40.980 --> 00:28:42.480
You're like, dude, that's not what I want.

00:28:42.480 --> 00:28:45.180
I want to ask for you to proofread it.

00:28:45.180 --> 00:28:46.280
Like why?

00:28:46.520 --> 00:28:51.620
Why there's this app is full of little tiny bugs and like, they're adding this, like who, who would ever use that?

00:28:51.620 --> 00:28:53.540
If this is the outcome of what you get, you know?

00:28:53.540 --> 00:29:00.260
Anyway, another example, would be the Dropbox fiasco where they just silently turned on.

00:29:00.260 --> 00:29:02.720
Hey, we're sending all your documents to, open AI.

00:29:02.720 --> 00:29:03.400
I hope you don't mind.

00:29:03.400 --> 00:29:04.420
Do you have anything private?

00:29:04.420 --> 00:29:04.920
Probably not.

00:29:04.920 --> 00:29:05.280
It's fine.

00:29:05.280 --> 00:29:05.720
Right.

00:29:05.720 --> 00:29:07.040
Like, wait, why did you add?

00:29:07.040 --> 00:29:07.880
Nobody wants this.

00:29:07.880 --> 00:29:08.740
Why do you turn this on?

00:29:08.740 --> 00:29:10.940
Or why are you sending my data on a Dropbox?

00:29:10.940 --> 00:29:11.980
This is not right.

00:29:12.140 --> 00:29:15.260
So anyway, hopefully people will enjoy this article.

00:29:15.260 --> 00:29:16.580
I have another fun one.

00:29:16.580 --> 00:29:17.980
Let's say another fun one coming.

00:29:17.980 --> 00:29:19.700
I forgot to turn that off.

00:29:19.700 --> 00:29:22.660
Oh, well, you can ask ChatGPT about that.

00:29:22.660 --> 00:29:23.660
God, God, no.

00:29:27.160 --> 00:29:27.600
Yeah.

00:29:27.600 --> 00:29:33.080
No, honestly, it doesn't actually send it unless you interact with one of the, like a text box.

00:29:33.080 --> 00:29:35.560
It says, do you want to ask this thing and the AI about your doc?

00:29:35.560 --> 00:29:37.740
But if you ask it, then it's, then it's on.

00:29:37.740 --> 00:29:37.960
Right.

00:29:37.960 --> 00:29:43.560
So it's not clear by like entering that text box, that input, you're now sharing your data

00:29:43.560 --> 00:29:44.560
with some other company, right?

00:29:44.560 --> 00:29:51.100
Like, can we just have like more reliable integration with Finder and Explorer and better sync?

00:29:51.100 --> 00:29:52.440
Like, I don't need this AI stuff.

00:29:52.440 --> 00:29:57.140
I had, I actually on the topic though, I had like a really cool AI experience.

00:29:57.140 --> 00:30:04.760
I went to the dentist and they took x-rays and, and she showed me the x-ray picture.

00:30:04.760 --> 00:30:10.480
And then she showed me the picture right next to it where an AI highlighted areas that might

00:30:10.480 --> 00:30:13.440
be problems that the dentist should check out and take a look at.

00:30:13.440 --> 00:30:14.140
That's awesome.

00:30:14.140 --> 00:30:19.140
And things like that, like helping, helping a professional make sure they don't miss things.

00:30:19.140 --> 00:30:20.180
Great use of AI.

00:30:20.560 --> 00:30:20.720
Yeah.

00:30:20.720 --> 00:30:21.160
So yeah.

00:30:21.160 --> 00:30:22.340
Proofreading less.

00:30:22.340 --> 00:30:25.640
No, that's an awesome, awesome use of it.

00:30:25.640 --> 00:30:26.000
Yeah.

00:30:26.000 --> 00:30:26.840
Okay.

00:30:26.840 --> 00:30:28.160
Ready for the joke?

00:30:28.160 --> 00:30:30.120
I'm almost.

00:30:30.120 --> 00:30:30.720
Okay.

00:30:30.720 --> 00:30:31.740
I want to show one more thing.

00:30:31.740 --> 00:30:37.360
I forgot to mention for a lot of people, New Year's resolutions time for a lot of people.

00:30:37.360 --> 00:30:43.520
And if your new year's resolution is get better at testing, to celebrate the pie test or the

00:30:43.520 --> 00:30:45.700
complete pie test course you're getting done.

00:30:45.700 --> 00:30:51.020
The coupon code 2024 is open through January for 10% off.

00:30:51.020 --> 00:30:52.800
So just wanted to mention that.

00:30:52.800 --> 00:30:54.040
So now I'm ready for a joke.

00:30:54.040 --> 00:30:54.640
All right.

00:30:54.640 --> 00:30:59.660
This one has to do with managers and sprints and super agile stuff.

00:30:59.660 --> 00:31:00.140
Okay.

00:31:00.400 --> 00:31:03.720
It was from work chronicles or chronicles.com.

00:31:03.720 --> 00:31:05.920
Put it in the backlog with dashes.

00:31:05.920 --> 00:31:10.200
So there's a programmer, clearly a business.

00:31:10.200 --> 00:31:12.100
Actually, it's a project manager, but whatever.

00:31:12.100 --> 00:31:13.620
Like somebody on the tech team.

00:31:13.620 --> 00:31:15.480
And here comes a person, very cheery.

00:31:15.480 --> 00:31:17.500
Hey, I have a new feature idea.

00:31:17.680 --> 00:31:21.440
And the person a little bit bugged, getting interrupted from work says, awesome.

00:31:21.440 --> 00:31:22.340
Just put it in the backlog.

00:31:22.340 --> 00:31:24.000
Person says, where's it?

00:31:24.000 --> 00:31:24.720
Where's the backlog?

00:31:24.720 --> 00:31:25.980
Holds up the trash can.

00:31:25.980 --> 00:31:28.080
Oh, dear.

00:31:28.080 --> 00:31:29.340
Put it in the backlog.

00:31:29.340 --> 00:31:30.120
Just go back.

00:31:30.120 --> 00:31:31.360
We're busy.

00:31:31.360 --> 00:31:32.020
Yeah.

00:31:32.020 --> 00:31:33.320
Anyway.

00:31:33.320 --> 00:31:40.520
We actually, we've got a real backlog, but the things that are marked low priority, it's

00:31:40.520 --> 00:31:41.280
never going to happen.

00:31:41.280 --> 00:31:44.280
Just run a filter that just hides all the priority things.

00:31:44.280 --> 00:31:46.640
Yeah.

00:31:46.640 --> 00:31:47.100
We're done.

00:31:47.200 --> 00:31:47.980
Backlogs all caught up.

00:31:47.980 --> 00:31:49.660
No, I know there's that feature I put in there.

00:31:49.660 --> 00:31:50.160
Oh, yeah.

00:31:50.160 --> 00:31:50.960
It must be a little priority.

00:31:50.960 --> 00:31:51.340
Got it.

00:31:51.340 --> 00:31:52.320
Oh, it's prioritized.

00:31:52.320 --> 00:31:52.880
We'll get to it.

00:31:52.880 --> 00:31:53.840
Beautiful.

00:31:53.840 --> 00:31:55.040
All right.

00:31:55.040 --> 00:31:57.840
Well, fantastic to be back with you and everyone else, Brian.

00:31:57.840 --> 00:31:58.820
Good to be back.

00:31:58.820 --> 00:31:59.200
Yeah.

00:31:59.200 --> 00:31:59.740
Bye, all.

