WEBVTT

00:00:00.001 --> 00:00:05.320
Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.

00:00:05.320 --> 00:00:10.900
This is episode 227, recorded March 31st. Nice. I'm Brian Okken.

00:00:10.900 --> 00:00:11.780
I'm Michael Kennedy.

00:00:11.780 --> 00:00:13.340
I'm Michaela Reyes.

00:00:13.340 --> 00:00:15.900
Welcome, Michaela. It's great to have you here.

00:00:15.900 --> 00:00:21.260
Thanks, Michael and Brian. I'm a big fan of both of your shows.

00:00:21.260 --> 00:00:22.600
Oh, thank you.

00:00:22.600 --> 00:00:22.900
Wonderful.

00:00:22.900 --> 00:00:27.460
Yeah, that's really nice. And super cool you could drop in here and be part of this show.

00:00:27.700 --> 00:00:30.480
And before we get on, maybe just tell folks about yourself.

00:00:30.480 --> 00:00:35.860
What do I do? I'm a software developer for more than 10 years.

00:00:35.860 --> 00:00:41.540
And then I'm also an organizer of the Python community in the Philippines.

00:00:41.540 --> 00:00:43.760
So, yeah, that's about it.

00:00:43.760 --> 00:00:45.680
Nice. Should we jump in?

00:00:45.680 --> 00:00:46.580
Let's jump in.

00:00:46.580 --> 00:00:50.120
All right. Well, the other day I was on Twitter.

00:00:50.120 --> 00:00:54.640
Sorry, I made myself laugh.

00:00:54.640 --> 00:00:59.360
So, Ned Batchelder put out a comment that said,

00:00:59.360 --> 00:01:03.640
public service announcement, please do not remove old versions from PyPI

00:01:03.640 --> 00:01:09.360
because it just causes work for people that have to go find your old versions on GitHub.

00:01:09.360 --> 00:01:12.920
PyPI has a yank feature that you should use instead.

00:01:12.920 --> 00:01:15.480
And I didn't know about this yank feature.

00:01:15.480 --> 00:01:16.520
I didn't know about it either.

00:01:16.520 --> 00:01:19.980
I thought you just have to live with leaving it there or you take it away and cause trouble.

00:01:20.380 --> 00:01:22.860
Yeah. So, so this is pretty cool.

00:01:22.860 --> 00:01:28.560
What it does is, and I should have had a screenshot of this up, but basically in PyPI,

00:01:28.560 --> 00:01:31.980
when you go in and you go in and log into your account and you go to one of your,

00:01:31.980 --> 00:01:35.660
the package that you want to take a version down from.

00:01:35.660 --> 00:01:40.060
And when you go, actually, if you go to try to delete it, it'll pop up a comment that says,

00:01:40.160 --> 00:01:43.060
hey, maybe you should yank this instead of deleting.

00:01:43.060 --> 00:01:47.160
And this, apparently this just came out like last year or a year before.

00:01:47.160 --> 00:01:50.360
I can't remember, but it's not terribly old and I missed it.

00:01:50.360 --> 00:01:52.720
Yanking is about the same thing.

00:01:52.720 --> 00:01:59.160
So yanking leaves it there, but it, it doesn't automatically grab that version,

00:01:59.160 --> 00:02:02.060
even if it's within a range that you've specified.

00:02:02.060 --> 00:02:11.040
The only way you PyPI will grab that version is if you specifically have that exact version specified to,

00:02:11.040 --> 00:02:11.680
to grab.

00:02:11.680 --> 00:02:16.360
And that way, if somebody has a pinned version to just that version, if you, if it's gone,

00:02:16.360 --> 00:02:17.880
they just won't download anything.

00:02:17.880 --> 00:02:18.940
So that's not nice.

00:02:18.940 --> 00:02:20.800
It's just going to crash and, you know,

00:02:20.800 --> 00:02:23.600
their Docker thing won't build or their system won't install or whatever.

00:02:23.600 --> 00:02:24.320
Something bad, right?

00:02:24.320 --> 00:02:24.760
Yeah.

00:02:24.760 --> 00:02:31.500
But, and then, I also wanted to link to, Doug Hellman article, about,

00:02:31.500 --> 00:02:33.000
so you've released a broken package.

00:02:33.000 --> 00:02:33.980
What do you do now?

00:02:33.980 --> 00:02:36.620
And his recommendation is just relax.

00:02:36.620 --> 00:02:37.280
It happens.

00:02:37.280 --> 00:02:41.560
just push it out again, fix it and push it out.

00:02:41.560 --> 00:02:46.920
And so I generally, I don't know if I've ever thought of the need to yank.

00:02:46.920 --> 00:02:51.380
Cause most people probably won't pin the bad version unless it's,

00:02:51.380 --> 00:02:52.860
unless they know it works for them.

00:02:52.860 --> 00:02:55.000
So I guess I wouldn't worry about it too much.

00:02:55.000 --> 00:02:55.640
It's interesting.

00:02:55.640 --> 00:02:57.180
I guess this is new as well.

00:02:57.180 --> 00:02:58.560
This is from May of 2019.

00:02:58.560 --> 00:03:02.780
This yank feature according to the pep, at least something around that timeframe.

00:03:02.780 --> 00:03:06.520
So it's pretty new, but it definitely seems like a right, a good feature.

00:03:06.520 --> 00:03:06.880
Okay.

00:03:06.880 --> 00:03:07.480
Have you heard of this?

00:03:07.480 --> 00:03:10.620
I also haven't pushed anything on pipe yet.

00:03:10.620 --> 00:03:13.320
Just internal, packages.

00:03:13.320 --> 00:03:14.220
Yeah.

00:03:14.220 --> 00:03:14.580
Yeah.

00:03:14.580 --> 00:03:16.200
Then you just tell people, oh, this is broken.

00:03:16.200 --> 00:03:17.240
Don't, don't use that one.

00:03:17.240 --> 00:03:18.060
Yeah.

00:03:18.060 --> 00:03:18.300
Yeah.

00:03:18.300 --> 00:03:22.220
If you put it on, on pipe UI, then, you know, someone pip installs, pip freezes it.

00:03:22.280 --> 00:03:23.140
They've, they've got it.

00:03:23.140 --> 00:03:28.380
So I guess it depends how popular packages, but even if you have an unpopular one, you know,

00:03:28.380 --> 00:03:33.700
you've got a, just a thousand downloads a day or something, or that's still a very high

00:03:33.700 --> 00:03:35.180
likelihood that someone's going to grab it.

00:03:35.180 --> 00:03:37.060
I just pushed up something recently.

00:03:37.060 --> 00:03:40.160
I was excited that it got up to like 24 downloads a day.

00:03:40.160 --> 00:03:41.680
No, I mean, that's, that's good.

00:03:41.680 --> 00:03:42.960
I think I have nothing.

00:03:42.960 --> 00:03:43.920
I have nothing in that scale.

00:03:43.920 --> 00:03:47.860
I'm thinking, you know, if you're, you, if you're doing flask or Django or pandas and you

00:03:47.860 --> 00:03:51.020
push a bad thing, like you're going to hear about it for a long time.

00:03:51.020 --> 00:03:53.120
It's, it's going to be a high stress event.

00:03:53.120 --> 00:03:57.020
Or as opposed to like the stuff that I have up there, no one would notice as long as I got

00:03:57.020 --> 00:03:57.860
to it pretty quick.

00:03:57.860 --> 00:04:01.920
I'll stick one of mine up in the, in the, the, extra section at the end.

00:04:02.020 --> 00:04:02.460
Oh, okay.

00:04:02.460 --> 00:04:02.860
Yeah.

00:04:02.860 --> 00:04:03.320
Perfect.

00:04:03.320 --> 00:04:03.680
Yeah.

00:04:03.680 --> 00:04:05.040
I was, I was about to ask.

00:04:05.040 --> 00:04:09.080
So SQLAlchemy, maybe you guys have heard of this.

00:04:09.080 --> 00:04:11.700
I think it's about something to do with databases, something like that.

00:04:11.700 --> 00:04:12.140
Yeah.

00:04:12.140 --> 00:04:17.820
So SQLAlchemy obviously is the most popular ORM for talking to databases without writing

00:04:17.820 --> 00:04:21.540
raw SQL, which I think for the most part, this is the way you should be doing it, right?

00:04:21.540 --> 00:04:23.000
You should be programming with so many things.

00:04:23.000 --> 00:04:24.660
Just change the connection string and it works.

00:04:24.660 --> 00:04:28.340
It doesn't matter what underlying operating or underlying database you're talking to.

00:04:28.340 --> 00:04:29.180
It'll figure it out.

00:04:29.180 --> 00:04:31.380
Mostly we'll get to that, but big news.

00:04:31.720 --> 00:04:36.880
Mike bears been working super hard to get SQLAlchemy 1.4 out.

00:04:36.880 --> 00:04:38.000
And does it say here?

00:04:38.000 --> 00:04:43.880
It says this is a ton of work that they put into over, I believe this is months of work.

00:04:43.880 --> 00:04:47.080
And I think it came out last week, but we didn't have time to cover it.

00:04:47.080 --> 00:04:47.960
So here it is.

00:04:47.960 --> 00:04:51.440
And this is notable, not just because, Oh, look at some point releasing, there's a few

00:04:51.440 --> 00:04:55.060
things, but there's a bunch of big changes for people that know about SQLAlchemy.

00:04:55.060 --> 00:05:01.060
For example, this is the first one that it's moving towards SQLAlchemy 2.0, which is a big

00:05:01.060 --> 00:05:02.980
change of the APIs and things like that.

00:05:02.980 --> 00:05:07.160
So it introduces a bunch of new APIs, especially around async and await.

00:05:07.160 --> 00:05:12.080
So this is the first SQLAlchemy that natively supports without some kind of external patching

00:05:12.080 --> 00:05:12.340
thing.

00:05:12.340 --> 00:05:18.620
Natively supports using the ORM to talk to the database using async and await, allow you to

00:05:18.620 --> 00:05:22.020
plug into things like FastAPI and other places in a real scalable way.

00:05:22.260 --> 00:05:23.140
So that's pretty cool.

00:05:23.140 --> 00:05:27.800
And yeah, the fact that it's moving on to this, this 2.0 style is pretty interesting.

00:05:27.800 --> 00:05:29.220
So yeah, big news, right?

00:05:29.220 --> 00:05:29.720
Yeah.

00:05:29.720 --> 00:05:30.620
Yeah.

00:05:30.620 --> 00:05:30.900
Cool.

00:05:30.900 --> 00:05:37.420
And there's a lot of changes around working with the ORM towards this new API.

00:05:37.420 --> 00:05:41.640
So it used to be, you would create a session and then you would say session.query of the

00:05:41.640 --> 00:05:45.360
class you want to query and then like filter and order by and all that kind of stuff.

00:05:45.440 --> 00:05:50.180
And that stuff is gone, not removed, but it's not the new style and it's not the styles that

00:05:50.180 --> 00:05:51.280
supports async and await.

00:05:51.280 --> 00:05:55.520
So I'm pulling up here, this, this doc that shows like the before and after.

00:05:55.520 --> 00:06:00.220
So if you wanted to get all the users used to say session.query of user all.

00:06:00.220 --> 00:06:04.940
Now what you do is use this combination of select statements and then executing them.

00:06:04.940 --> 00:06:07.980
I believe this comes out of the core of SQLAlchemy.

00:06:07.980 --> 00:06:11.080
There's a way to do the core queries and then the ORM queries.

00:06:11.220 --> 00:06:13.200
And I think it's leaning more on the way that the core work.

00:06:13.200 --> 00:06:16.200
So now you would say session.execute, select a user.

00:06:16.200 --> 00:06:18.400
And there's a few more steps for some reason.

00:06:18.400 --> 00:06:20.980
Then you got to say .scalers.all.

00:06:20.980 --> 00:06:24.600
If you don't do that, what you get back is like a bunch of tuples where some part of the

00:06:24.600 --> 00:06:27.540
tuple on each entry is the thing you were looking for, I believe.

00:06:27.540 --> 00:06:32.660
So it's not super different, but it is not even close to the same.

00:06:32.660 --> 00:06:36.000
So that's, that's something that people should look at.

00:06:36.000 --> 00:06:38.220
Let's see if I can find the async support here.

00:06:38.700 --> 00:06:41.540
I'll just show you one thing that you also, I want to point out.

00:06:41.540 --> 00:06:44.020
I said normally you can just change what database you talk to.

00:06:44.020 --> 00:06:47.780
If you're doing the async API, you have to be more specific about it.

00:06:47.780 --> 00:06:52.300
For example, if you just try to talk to SQLite, it'll crash and says the SQLite driver doesn't

00:06:52.300 --> 00:06:52.860
support async.

00:06:52.860 --> 00:06:56.680
Sorry, you can no longer use, you can't use that API to talk to SQLite.

00:06:56.680 --> 00:07:02.920
But what you can do from this little, I've taken from one of my classes is you can use a different

00:07:02.920 --> 00:07:03.640
connection string.

00:07:03.780 --> 00:07:06.160
This is from my second FastAPI course.

00:07:06.160 --> 00:07:13.180
You can say SQLite plus aiosqlite and say, I want to use the aiosqlite driver, not the

00:07:13.180 --> 00:07:16.060
plain SQLite driver for my async connection.

00:07:16.060 --> 00:07:16.440
Right.

00:07:16.440 --> 00:07:17.080
Yeah.

00:07:17.220 --> 00:07:19.600
So if you do that, then you're back to good.

00:07:19.600 --> 00:07:20.440
Things go.

00:07:20.440 --> 00:07:20.800
Yeah.

00:07:20.800 --> 00:07:22.580
Things go as you would expect, which is really cool.

00:07:22.580 --> 00:07:24.180
And then you've got to do things different.

00:07:24.180 --> 00:07:26.360
Instead of creating an engine, you've got to create an async engine.

00:07:26.360 --> 00:07:30.520
The way you work with the session object is now with the async with block.

00:07:30.520 --> 00:07:33.080
There's a lot of interesting, like slight variations going on.

00:07:33.080 --> 00:07:39.240
But, you know, basically it's really cool that you can now do SQLite or SQLAlchemy and SQLite,

00:07:39.240 --> 00:07:39.460
I guess.

00:07:39.460 --> 00:07:45.060
But especially SQLAlchemy against the databases using the ORM in an async and a wait friendly

00:07:45.060 --> 00:07:45.300
way.

00:07:45.300 --> 00:07:46.440
That's the big news.

00:07:46.440 --> 00:07:47.260
That's really cool.

00:07:47.260 --> 00:07:47.640
Yeah.

00:07:47.640 --> 00:07:51.100
I actually think that changes to the ORM are kind of neat.

00:07:51.100 --> 00:07:51.440
Yeah.

00:07:51.440 --> 00:07:52.800
No, I'm not saying I dislike them.

00:07:52.800 --> 00:07:55.720
They're just, you're not just going to be able to put in a wait in front of what you used

00:07:55.720 --> 00:07:55.960
to do.

00:07:55.960 --> 00:07:57.320
It's a different API.

00:07:57.320 --> 00:07:58.900
You got to kind of go through and figure it out.

00:07:58.900 --> 00:07:59.720
But it's fine.

00:07:59.720 --> 00:08:00.140
It's good.

00:08:00.140 --> 00:08:01.140
I'm really happy to see it.

00:08:01.140 --> 00:08:03.820
Michaela, do you do anything with SQLAlchemy?

00:08:03.820 --> 00:08:08.940
Yeah, it looks the new query style is more understandable, I guess.

00:08:08.940 --> 00:08:14.020
But I'm just worried about those who are using the old version in production.

00:08:14.020 --> 00:08:14.640
Yeah.

00:08:14.640 --> 00:08:14.820
Yeah.

00:08:14.820 --> 00:08:18.200
I don't know if it's going to go away in SQLAlchemy 2.

00:08:18.200 --> 00:08:21.820
I'm not sure what the story is there, what the future plans are.

00:08:21.820 --> 00:08:25.160
But if you want to take advantage of the async and wait stuff, you've got to go do new things.

00:08:25.160 --> 00:08:27.420
But there's not going to be a lot of old code.

00:08:27.420 --> 00:08:31.300
I mean, there's going to be no old code doing the old async way because it just wasn't supported

00:08:31.300 --> 00:08:31.700
at all.

00:08:31.700 --> 00:08:32.020
Right.

00:08:32.020 --> 00:08:32.800
So it should be okay.

00:08:33.680 --> 00:08:34.020
Yeah.

00:08:34.020 --> 00:08:34.380
All right.

00:08:34.380 --> 00:08:35.300
Well, that's that for that one.

00:08:35.300 --> 00:08:37.340
And I think you're up next, right?

00:08:37.340 --> 00:08:38.140
On your item.

00:08:38.140 --> 00:08:44.400
I found this Django tenants package back in 2017.

00:08:44.400 --> 00:08:51.700
And then I was just surprised that it's still being maintained when I looked at it.

00:08:51.700 --> 00:08:59.000
So it's a multi-tenancy implementation for Django, typically used for SaaS websites.

00:08:59.000 --> 00:09:02.620
So it's like, what's a good use case?

00:09:03.040 --> 00:09:06.700
Let's say you have a restaurant with franchise.

00:09:06.700 --> 00:09:10.360
And then you have a lot of people.

00:09:10.360 --> 00:09:16.020
For example, your main web app is my website.com.

00:09:16.020 --> 00:09:21.680
And then you have a lot of people.

00:09:21.680 --> 00:09:21.680
And then you have a lot of people.

00:09:21.680 --> 00:09:21.680
And then you have a lot of people.

00:09:21.680 --> 00:09:21.680
And then you have a lot of people.

00:09:21.680 --> 00:09:21.680
And then you have a lot of people.

00:09:21.680 --> 00:09:21.680
And then you have a lot of people.

00:09:21.680 --> 00:09:22.680
And then you have a lot of people.

00:09:22.680 --> 00:09:23.680
And then you have a lot of people.

00:09:23.680 --> 00:09:23.680
And then you have a lot of people.

00:09:23.680 --> 00:09:24.680
And then you have a lot of people.

00:09:24.680 --> 00:09:25.680
And then you have a lot of people.

00:09:25.680 --> 00:09:26.680
And then you have a lot of people.

00:09:26.680 --> 00:09:27.680
And then you have a lot of people.

00:09:27.680 --> 00:09:28.680
And then you have a lot of people.

00:09:28.680 --> 00:09:33.340
It uses PostGear SQL schemas.

00:09:33.340 --> 00:09:37.520
So for each tenant, it has a different.

00:09:37.520 --> 00:09:42.800
It will use a different schema for each tenant.

00:09:42.800 --> 00:09:43.560
Okay.

00:09:43.560 --> 00:09:44.140
Yeah.

00:09:44.140 --> 00:09:45.180
This is really neat.

00:09:45.180 --> 00:09:47.060
Because that is such a big challenge.

00:09:47.220 --> 00:09:50.540
I know a couple of people that have sites that they build.

00:09:50.540 --> 00:09:52.760
That their customer wants to log in.

00:09:52.760 --> 00:09:54.360
Multiple logins for them.

00:09:54.360 --> 00:09:56.200
And when they go in there, they want to see their data.

00:09:56.200 --> 00:09:59.160
But you don't want to have a copy of the website for everyone.

00:09:59.160 --> 00:10:00.760
You want to have one website that you maintain.

00:10:00.760 --> 00:10:03.860
And it's always filtered to, well, what company are you in?

00:10:03.860 --> 00:10:06.560
You get to see the data related to that company, that account.

00:10:06.560 --> 00:10:07.680
As someone else comes in.

00:10:07.680 --> 00:10:08.100
Yeah.

00:10:08.100 --> 00:10:10.220
And this is super cool.

00:10:10.220 --> 00:10:10.940
Yeah.

00:10:10.940 --> 00:10:14.000
Because the data leaks can cost you lawsuits.

00:10:14.000 --> 00:10:14.980
Yeah.

00:10:14.980 --> 00:10:15.500
Yeah.

00:10:15.500 --> 00:10:16.940
I mean, you could do it yourself, right?

00:10:17.020 --> 00:10:19.920
Every single query, you could say whatever the query is.

00:10:19.920 --> 00:10:24.220
And your company ID equals or account ID equals whatever it is.

00:10:24.220 --> 00:10:27.300
But if you forget one time, you're in the news in a bad way.

00:10:27.300 --> 00:10:27.880
Yeah.

00:10:27.880 --> 00:10:28.900
Yeah.

00:10:28.900 --> 00:10:30.180
Yeah.

00:10:30.180 --> 00:10:31.320
This is very cool.

00:10:31.320 --> 00:10:31.800
Yeah.

00:10:31.800 --> 00:10:33.540
I was always curious about how people.

00:10:33.540 --> 00:10:35.320
I mean, I'm sure there's other ways too.

00:10:35.320 --> 00:10:39.260
But I was curious about how people would do that to build this house off of Django.

00:10:39.260 --> 00:10:40.020
It's interesting.

00:10:40.020 --> 00:10:41.280
And it's based on domains.

00:10:41.280 --> 00:10:46.040
So like tenant1.domain.com, tenant2.domain.com, and so on.

00:10:46.040 --> 00:10:46.460
Yeah.

00:10:46.820 --> 00:10:48.160
So I like it.

00:10:48.160 --> 00:10:51.980
I mean, if you're doing Django stuff, it seems like it makes a lot of sense.

00:10:51.980 --> 00:10:56.480
And this goes down to the actual Django ORM models, right?

00:10:56.480 --> 00:10:57.340
Yeah.

00:10:57.840 --> 00:10:58.220
Yeah.

00:10:58.220 --> 00:10:58.680
Cool.

00:10:58.680 --> 00:11:01.020
Well, I don't have any use case for this.

00:11:01.020 --> 00:11:02.900
I don't think right now.

00:11:02.900 --> 00:11:05.740
But I can certainly see that a lot of people out there would.

00:11:05.740 --> 00:11:10.540
I mean, like I said, if you've got a group of people associated with one customer and another

00:11:10.540 --> 00:11:14.040
group of people associated with another customer and you want to make sure that only their data

00:11:14.040 --> 00:11:18.360
is all kind of shared, but not overly shared, then this is a cool use case.

00:11:18.360 --> 00:11:18.580
Yeah.

00:11:18.580 --> 00:11:18.960
Nice.

00:11:18.960 --> 00:11:19.800
Well, that's a really good find.

00:11:19.800 --> 00:11:20.160
Yeah.

00:11:20.160 --> 00:11:20.580
Cool.

00:11:20.580 --> 00:11:21.240
Awesome.

00:11:21.240 --> 00:11:21.560
Awesome.

00:11:21.860 --> 00:11:22.280
All right.

00:11:22.280 --> 00:11:22.700
All right.

00:11:22.700 --> 00:11:24.420
Brian, you ready to commit?

00:11:24.420 --> 00:11:24.900
Oh.

00:11:24.900 --> 00:11:26.620
Race condition.

00:11:26.620 --> 00:11:27.420
Race condition.

00:11:27.420 --> 00:11:28.580
Yeah.

00:11:29.120 --> 00:11:29.520
Yeah.

00:11:29.520 --> 00:11:32.260
So I think we've talked about pre-commit.

00:11:32.260 --> 00:11:33.420
I'm pretty sure we have.

00:11:33.420 --> 00:11:38.820
Definitely talked about pre-commit hooks in the small, but not necessarily in the framework

00:11:38.820 --> 00:11:39.480
style.

00:11:39.480 --> 00:11:39.940
I don't know.

00:11:39.940 --> 00:11:40.380
Yeah.

00:11:40.380 --> 00:11:46.540
So pre-commit, well, this is the documentation for pre-commit, the normal pre-commit everybody

00:11:46.540 --> 00:11:47.620
knows and loves.

00:11:47.620 --> 00:11:51.860
And if you don't know it and love it, you should probably check it out because I wanted to bring

00:11:51.860 --> 00:11:52.540
up a couple of things.

00:11:52.540 --> 00:11:59.740
One of them is that it's a lot more than just, so I am along with a lot of other people

00:11:59.740 --> 00:12:06.060
ran across pre-commit with things like, I want to remember to run black and, you know,

00:12:06.060 --> 00:12:07.520
I know I'm going to run my tests.

00:12:07.520 --> 00:12:11.300
So I may as well just check, make sure that all the tests pass before I check stuff in.

00:12:11.300 --> 00:12:16.220
And maybe I'll run the linter and just go ahead and run black over something.

00:12:16.220 --> 00:12:17.940
And then I don't have to worry about it too much.

00:12:17.940 --> 00:12:20.340
Things like that before you commit.

00:12:20.340 --> 00:12:22.480
And that's where the pre-commit got its name.

00:12:22.740 --> 00:12:26.540
But there's a lot more hooks than commit or the pre-commit hook.

00:12:26.540 --> 00:12:32.620
With the pre-commit tool, you can hook into pre-merge and post-merge and all sorts of entry

00:12:32.620 --> 00:12:34.460
points around version control.

00:12:34.460 --> 00:12:36.580
So it's a very powerful tool.

00:12:36.580 --> 00:12:42.180
And there's a thing when people build up a whole bunch of tooling around it.

00:12:42.180 --> 00:12:47.960
And you can also get best in class little hook snippets from other people to plug into

00:12:47.960 --> 00:12:49.060
it, which is really great.

00:12:49.060 --> 00:12:53.660
But if I'm sharing it across a whole bunch of different projects, I kind of have to copy

00:12:53.660 --> 00:12:55.260
that into all the repos.

00:12:55.260 --> 00:13:00.420
But you don't really have to anymore because now there's a pre-commit CI.

00:13:00.420 --> 00:13:06.660
So it's a continuous integration type version like a lot of other, like, I don't know, like

00:13:06.660 --> 00:13:11.100
Travis used to be or something or other sort of CI tools.

00:13:11.320 --> 00:13:14.480
This is another CI tool chain that you can use.

00:13:14.480 --> 00:13:15.400
And it'll run.

00:13:15.400 --> 00:13:20.560
You can set up pre-commit hooks and run it over a project.

00:13:20.560 --> 00:13:25.260
And one of the nice things about it is you can have a whole bunch of different things set

00:13:25.260 --> 00:13:30.760
up and configured and run it against multiple projects and have that just set up in a different

00:13:30.760 --> 00:13:31.180
place.

00:13:31.360 --> 00:13:34.360
So this is a really, really kind of a cool tool.

00:13:34.360 --> 00:13:37.440
And I've been trying it out on a couple of projects.

00:13:37.440 --> 00:13:38.360
So yeah.

00:13:38.360 --> 00:13:44.360
So we have pre-commit, pre-commit framework, which lets you use pre-commit hooks.

00:13:44.360 --> 00:13:45.120
There's a lot of layers.

00:13:45.120 --> 00:13:46.280
It's like turtles all the way down.

00:13:46.280 --> 00:13:50.640
You can have pre-commit, you can have pre-commit hooks for Git, but they might be written in

00:13:50.640 --> 00:13:53.960
all different languages like Node or Rust or Python or whatever.

00:13:53.960 --> 00:13:56.200
And getting those installed and running can be a pain.

00:13:56.200 --> 00:14:00.280
So there's the pre-commit framework, which lets you not worry about that stuff and just

00:14:00.280 --> 00:14:02.480
run all these pre-commit hooks from different sources.

00:14:02.480 --> 00:14:04.840
This is another thing on top of that.

00:14:04.840 --> 00:14:07.260
This is the pre-commit continuous integration server.

00:14:07.260 --> 00:14:08.900
So people have heard of pre-commit before.

00:14:08.900 --> 00:14:12.960
This is like extra new stuff that Anthony Sotili has been working on, right?

00:14:12.960 --> 00:14:13.380
Yeah.

00:14:13.380 --> 00:14:13.760
Yeah.

00:14:13.760 --> 00:14:19.020
And he's been doing this on the side for a little while to try to, it's a, it's believe

00:14:19.020 --> 00:14:20.560
it's, well, I've signed up.

00:14:20.560 --> 00:14:23.740
with, through GitHub and I think it's free for open source projects.

00:14:23.740 --> 00:14:24.840
I don't know the details.

00:14:24.840 --> 00:14:28.820
but, yeah, anyway, I think it's a neat idea.

00:14:28.820 --> 00:14:33.240
I occasionally get, so one of the things that's nice about it, obviously I'm going

00:14:33.240 --> 00:14:38.560
to run pre-commit the hooks, but if somebody merges something into my code, they can, they

00:14:38.560 --> 00:14:41.400
can choose not to do that and do a merge request.

00:14:41.400 --> 00:14:45.340
And this, this allows all those hooks to run on all the merge requests.

00:14:45.340 --> 00:14:50.540
So I'm, I'm a big fan of putting stuff in CI because I've seen so many scenarios,

00:14:50.540 --> 00:14:54.720
where people are part of some of the people on the team are really excited about this and

00:14:54.720 --> 00:14:55.560
really want to work with it.

00:14:55.560 --> 00:15:00.280
And other people, they don't even want to be bothered to figure out what it is, but they're

00:15:00.280 --> 00:15:05.760
in attention to, it means the builds break and other stuff goes wrong for the people who are

00:15:05.760 --> 00:15:11.160
trying to keep, I don't know, the linter happy, the unit test running or whatever it is.

00:15:11.160 --> 00:15:11.440
Right.

00:15:11.440 --> 00:15:16.900
And so if you're relying upon pre-commit hooks, this means that everybody gets their pre-commit,

00:15:16.900 --> 00:15:22.580
their, their commit hooks and stuff run and validated, not just the people who didn't, you

00:15:22.580 --> 00:15:23.660
know, ignore them or whatever.

00:15:23.660 --> 00:15:24.200
Yeah.

00:15:24.200 --> 00:15:28.220
like for one example is like, just like black, for instance, if you like to run black

00:15:28.220 --> 00:15:33.680
over your stuff before you check it in, you can just not even see it before, people

00:15:33.680 --> 00:15:33.960
do it.

00:15:34.000 --> 00:15:37.940
And one of the nice things about this is that it can, it can change, create a new

00:15:37.940 --> 00:15:38.400
merge request.

00:15:38.400 --> 00:15:42.520
So one of the things it'll do is if somebody does a pull request or merge request, whatever,

00:15:42.520 --> 00:15:47.280
uh, against your project and you want this stuff run, like for instance, some of them will

00:15:47.280 --> 00:15:48.220
actually change your code.

00:15:48.220 --> 00:15:50.000
Black's one that changes your code.

00:15:50.000 --> 00:15:54.000
So this takes the old merge request, runs black on it and then creates a new merge

00:15:54.000 --> 00:15:55.080
request with the changes.

00:15:55.080 --> 00:15:56.980
so that's nice.

00:15:57.040 --> 00:15:57.160
Yeah.

00:15:57.160 --> 00:15:57.620
Cool.

00:15:57.620 --> 00:15:58.500
Okay.

00:15:58.500 --> 00:16:02.200
Are you using the, pre-commit hooks or anything like that with your teams?

00:16:02.200 --> 00:16:09.740
no, I'm just aware of black, but when Brian explained it, it's, it's, yeah, it's

00:16:09.740 --> 00:16:10.460
similar to it.

00:16:10.460 --> 00:16:13.580
Although it's, something that you put on GitHub.

00:16:13.580 --> 00:16:14.900
Did I understand it?

00:16:14.900 --> 00:16:15.340
Right.

00:16:15.340 --> 00:16:17.100
Well, or, or, or, or whatever your.

00:16:17.100 --> 00:16:22.480
The continuous integration version that we're just covering does, you can put it on

00:16:22.480 --> 00:16:26.760
GitHub, but the, and pre-commit works with GitHub projects as well.

00:16:26.760 --> 00:16:28.940
but it's a, something you run locally.

00:16:28.940 --> 00:16:35.860
So you have it, it's, it's run by get pre-commit hooks are triggering the hooks that you

00:16:35.860 --> 00:16:36.420
can configure.

00:16:36.420 --> 00:16:36.720
Yeah.

00:16:36.720 --> 00:16:38.760
That's a, yes, it's turtles all the way down.

00:16:38.760 --> 00:16:39.520
yeah.

00:16:39.520 --> 00:16:45.300
So Brian, I don't know if you have any awareness to this or not, but I'll ask you anyway, just

00:16:45.300 --> 00:16:49.220
tell me if you don't know, would it still make sense to run, put the pre-commit framework

00:16:49.220 --> 00:16:53.080
locally and have it try to do it locally before it happens in GitHub.

00:16:53.080 --> 00:16:56.320
So maybe you get a better, more immediate feedback on it or.

00:16:56.480 --> 00:16:56.620
Yeah.

00:16:56.620 --> 00:16:58.560
Just like depend on the one on the CI server.

00:16:58.560 --> 00:16:59.560
Of course I do.

00:16:59.560 --> 00:17:04.100
so that, because I want to catch it before I push it up for my own stuff.

00:17:04.100 --> 00:17:09.820
But if somebody's, wants to, you know, do a pull request, I don't even want

00:17:09.820 --> 00:17:11.460
to look at their code if it doesn't pass.

00:17:11.660 --> 00:17:18.300
I mean, I mean, it might be a cool idea, but, but if it's, if, if, you know, it's a lot

00:17:18.300 --> 00:17:21.900
of work if somebody pushes something and all the tests are broken and whatever.

00:17:21.900 --> 00:17:22.140
Yeah.

00:17:22.140 --> 00:17:25.620
And then we're like, you don't want to go back and say, Oh, I'll accept your PR, but you

00:17:25.620 --> 00:17:26.980
have to go and run black against it.

00:17:26.980 --> 00:17:27.980
And then I'll accept it.

00:17:27.980 --> 00:17:29.060
Like just make it automatic.

00:17:29.060 --> 00:17:29.620
Yeah.

00:17:29.620 --> 00:17:30.600
Just make it automatic.

00:17:30.600 --> 00:17:31.120
So.

00:17:31.120 --> 00:17:31.560
Yeah.

00:17:31.560 --> 00:17:31.960
Yeah.

00:17:31.960 --> 00:17:32.460
Super cool.

00:17:32.460 --> 00:17:32.940
All right.

00:17:32.940 --> 00:17:36.500
And the next one here comes to us from David Smith.

00:17:36.840 --> 00:17:39.980
And he, like many of our listeners are, is it very helpful?

00:17:39.980 --> 00:17:41.160
Sends in things periodically.

00:17:41.160 --> 00:17:45.920
Says, Hey, I happen across this thing at sneak S N Y K.io.

00:17:45.920 --> 00:17:49.220
And I'm not sure how new this is, but it's quite neat.

00:17:49.220 --> 00:17:54.460
So over here we have the sneak package advisor and it's not just for Python.

00:17:54.460 --> 00:17:59.840
It's for many of the things, I guess, three of the things, the moment, NPM, IPI and Docker.

00:17:59.840 --> 00:18:01.960
And what you can do is you can go over here.

00:18:01.960 --> 00:18:04.120
I'll just focus on IPI for now.

00:18:04.220 --> 00:18:07.260
And you can put in packages like they have Django there listed.

00:18:07.260 --> 00:18:08.860
So let's put Django in and see what happens.

00:18:08.860 --> 00:18:12.380
And it will tell you what is the package health score?

00:18:12.380 --> 00:18:14.180
What is the security story?

00:18:14.180 --> 00:18:15.400
Have there been issues?

00:18:15.400 --> 00:18:16.280
Have they been fixed?

00:18:16.280 --> 00:18:18.060
How often is this being worked on?

00:18:18.060 --> 00:18:23.320
So many times people who are new to Python or even not new to Python, but new to an area

00:18:23.320 --> 00:18:23.880
like, you know what?

00:18:23.880 --> 00:18:26.880
I want to start using async and await with an ORM.

00:18:26.880 --> 00:18:27.820
What are my options?

00:18:27.820 --> 00:18:30.340
I've been using SQLAlchemy and imagine it didn't get as update.

00:18:30.340 --> 00:18:31.420
I got to switch to something else.

00:18:31.420 --> 00:18:32.300
What are my choices?

00:18:32.300 --> 00:18:32.960
Here's four.

00:18:33.320 --> 00:18:38.140
How do I know which one of those four is still alive, healthy, et cetera, et cetera.

00:18:38.140 --> 00:18:42.100
So you come in here and you can see some information about it.

00:18:42.100 --> 00:18:47.240
I'm going to say that this is not necessarily the best.

00:18:47.240 --> 00:18:49.200
Let me see if I can find Django without.

00:18:49.200 --> 00:18:53.840
One of the things I'm seeing that makes me kind of wonder, I clicked on maybe the wrong

00:18:53.840 --> 00:18:54.200
one.

00:18:54.200 --> 00:18:57.300
I clicked on a specific version and it said it was not very popular.

00:18:57.300 --> 00:18:58.480
I'm like, that can't be right for Django.

00:18:59.740 --> 00:19:01.460
It's an unpopular package.

00:19:01.460 --> 00:19:03.920
So it tells you things like, what is the popularity?

00:19:03.920 --> 00:19:08.800
And for Django, so this is a key ecosystem project, like too big to fail, sort of.

00:19:08.800 --> 00:19:10.100
What is its maintenance story?

00:19:10.100 --> 00:19:10.660
It's healthy.

00:19:10.660 --> 00:19:13.000
Does it have known security concerns?

00:19:13.000 --> 00:19:13.620
No.

00:19:13.620 --> 00:19:15.080
Is this community active or whatever?

00:19:15.080 --> 00:19:16.120
And then also it's cool.

00:19:16.120 --> 00:19:18.680
It has, you might also look at these other packages.

00:19:18.680 --> 00:19:21.080
Like Django is getting 97 Flask.

00:19:21.080 --> 00:19:22.180
It shows right there.

00:19:22.180 --> 00:19:25.980
Flask is a 93 out of a hundred in its score and you could open it up and see why there's

00:19:25.980 --> 00:19:27.940
a bunch of graphs around here as well.

00:19:27.940 --> 00:19:33.320
You can see like the commit frequency, the open issues, open PRs.

00:19:33.320 --> 00:19:34.600
When was the last commit?

00:19:34.600 --> 00:19:37.400
GitHub forks, all sorts of stuff around here.

00:19:37.400 --> 00:19:42.200
So number of contributors go down there and see that actually the community shows like the

00:19:42.200 --> 00:19:42.840
recent people.

00:19:42.840 --> 00:19:45.800
Does it have a code of conduct that it could discover, right?

00:19:45.860 --> 00:19:48.640
Does it have funding that have a contributing doc?

00:19:48.640 --> 00:19:51.200
What were the recent security issues?

00:19:51.200 --> 00:19:52.000
All sorts of stuff.

00:19:52.000 --> 00:19:54.800
You know, I'm not going to go through all of it, but there's a bunch of cool things you

00:19:54.800 --> 00:19:57.900
can just pull up about other packages and compare them against each other.

00:19:57.900 --> 00:20:02.240
You can pull up like Flask if you want and see that side by side and so on.

00:20:02.240 --> 00:20:03.100
So what do you guys think?

00:20:03.100 --> 00:20:03.580
Yeah.

00:20:03.580 --> 00:20:04.160
Cool, right?

00:20:04.160 --> 00:20:04.880
Yeah.

00:20:04.880 --> 00:20:05.600
Yeah, I think it's neat.

00:20:05.600 --> 00:20:08.880
It's similar to Django packages.org.

00:20:08.880 --> 00:20:09.860
Oh, yeah.

00:20:09.860 --> 00:20:11.180
Django packages.org.

00:20:11.180 --> 00:20:19.320
Which is, like you said, a similar idea, but just for like an auth layer for Django or a

00:20:19.320 --> 00:20:20.880
special admin backend for Django.

00:20:20.880 --> 00:20:23.720
But this is more like for the whole community.

00:20:23.720 --> 00:20:24.920
Yeah, for the whole Python.

00:20:24.920 --> 00:20:28.700
Oh, or it supports other languages too, right?

00:20:28.700 --> 00:20:29.120
Yeah.

00:20:29.120 --> 00:20:30.440
Sort of.

00:20:30.440 --> 00:20:33.520
It supports Node and Docker, right?

00:20:34.000 --> 00:20:37.740
So, yeah, I think the idea is probably that more stuff is coming along, but I do like

00:20:37.740 --> 00:20:41.340
this, you know, if everything else being equal and you can't decide, put two projects in here

00:20:41.340 --> 00:20:43.040
and, you know, see what it says, right?

00:20:43.040 --> 00:20:48.360
You can see, like to me, one of the big warning signs of an open source project is if there's

00:20:48.360 --> 00:20:53.760
a bunch of PRs that are like six months old, nobody's even bothered to respond.

00:20:53.760 --> 00:20:57.040
You know, somebody's gone to the effort of, I've actually tried to improve this.

00:20:57.040 --> 00:20:58.020
I've done the work.

00:20:58.020 --> 00:20:58.900
I've written the test.

00:20:58.900 --> 00:20:59.440
Here it is.

00:20:59.440 --> 00:21:01.820
Will you just accept it or tell me what else I got to do?

00:21:01.820 --> 00:21:03.480
And they're not even willing to respond.

00:21:03.480 --> 00:21:05.140
Like that is a huge red flag.

00:21:05.140 --> 00:21:07.660
And that kind of stuff will come up here as well.

00:21:07.660 --> 00:21:12.600
And hey, Anthony Shaw out there in the live stream is if you sign up with your GitHub creds,

00:21:12.600 --> 00:21:18.380
Snyk will check your project requirements.txt for you and raise PRs if there's security issues.

00:21:18.380 --> 00:21:18.680
Yeah.

00:21:18.680 --> 00:21:19.180
Oh, nice.

00:21:19.180 --> 00:21:24.900
And if you use PyCharm, the PyCharm security extension, it has Snyk is integrated in.

00:21:24.900 --> 00:21:28.540
Oh, and Anthony, who makes then a PyCharm security extension?

00:21:28.540 --> 00:21:29.000
Is that?

00:21:29.000 --> 00:21:29.940
That's right.

00:21:29.940 --> 00:21:30.780
Anthony does that one.

00:21:31.580 --> 00:21:33.680
Awesome.

00:21:33.680 --> 00:21:34.920
Yeah, that's really good work, Anthony.

00:21:34.920 --> 00:21:37.220
Thanks for that extra information as well.

00:21:37.220 --> 00:21:39.440
So you can just search a project on there.

00:21:39.440 --> 00:21:39.860
Yeah.

00:21:39.860 --> 00:21:40.820
Put me on the spot.

00:21:40.820 --> 00:21:42.360
Search my cards.

00:21:42.360 --> 00:21:43.200
What is it?

00:21:43.200 --> 00:21:44.880
No, pytest dash check.

00:21:44.880 --> 00:21:45.720
pytest.

00:21:45.720 --> 00:21:45.960
pytest check.

00:21:45.960 --> 00:21:46.200
Gotcha.

00:21:46.200 --> 00:21:48.380
Oh, let's see what we get.

00:21:48.380 --> 00:21:49.100
What are we going to get?

00:21:49.100 --> 00:21:49.460
Hold on.

00:21:49.460 --> 00:21:52.120
You're doing pretty good.

00:21:52.120 --> 00:21:52.900
You got a 65.

00:21:52.900 --> 00:21:55.920
I mean, look, you are recognized.

00:21:55.920 --> 00:21:56.740
Look at this.

00:21:56.740 --> 00:21:59.500
And you are sustainable with no known security issues.

00:21:59.640 --> 00:22:01.620
I'm saying this is the same bad, man.

00:22:01.620 --> 00:22:06.100
I mean, there are fewer committers than Django, to be fair.

00:22:06.100 --> 00:22:06.700
But still.

00:22:06.700 --> 00:22:08.000
Yeah.

00:22:08.000 --> 00:22:08.940
Still, it's quite good, right?

00:22:08.940 --> 00:22:11.580
But I'm surprised that there's 10 contributors.

00:22:11.580 --> 00:22:12.800
This is just something that I.

00:22:12.800 --> 00:22:13.900
It's pretty good.

00:22:13.900 --> 00:22:15.380
It's probably my oldest package.

00:22:15.380 --> 00:22:15.940
So that's.

00:22:15.940 --> 00:22:16.620
Okay.

00:22:16.780 --> 00:22:17.680
No, this is pretty good.

00:22:17.680 --> 00:22:19.800
I mean, it has no known security issues.

00:22:19.800 --> 00:22:20.500
That's pretty good.

00:22:20.500 --> 00:22:23.360
And you could even embed a little package health score if you wanted to.

00:22:23.360 --> 00:22:23.600
Right.

00:22:23.600 --> 00:22:24.500
Well, let's get.

00:22:24.500 --> 00:22:26.200
Let's figure out how I can get it up.

00:22:26.200 --> 00:22:28.020
Yeah.

00:22:28.020 --> 00:22:29.720
Get that into the 90s and then embed it.

00:22:29.720 --> 00:22:30.180
Get up in the 90s.

00:22:30.180 --> 00:22:30.580
How about that?

00:22:30.580 --> 00:22:31.000
Perfect.

00:22:31.000 --> 00:22:32.020
Fantastic.

00:22:32.020 --> 00:22:32.720
All right.

00:22:32.720 --> 00:22:34.180
Who's next?

00:22:34.180 --> 00:22:36.260
I guess, Kayla, you're next.

00:22:36.260 --> 00:22:36.620
So.

00:22:36.620 --> 00:22:37.040
Yeah.

00:22:37.040 --> 00:22:37.920
There you go.

00:22:37.920 --> 00:22:38.720
Tell us about this one.

00:22:39.520 --> 00:22:47.460
So this one has been contributed by one of the shows on Twitter fans.

00:22:47.460 --> 00:22:59.380
And then when I first looked at it, I thought it's just another tool that tries to do away with JavaScript.

00:22:59.380 --> 00:23:08.660
But then when I tried it out, I guess I kind of had an appreciation for it because it can be used for.

00:23:08.660 --> 00:23:09.400
Yeah.

00:23:09.400 --> 00:23:13.320
I imagine for hobby projects, like for people who.

00:23:13.320 --> 00:23:14.200
Oh, wait.

00:23:14.200 --> 00:23:15.920
Let me just explain what it's for.

00:23:15.920 --> 00:23:24.840
It allows you to build simple applications or browser based GUI applications without the need to write HTML and JavaScript.

00:23:24.840 --> 00:23:28.380
So it has input and output modules.

00:23:28.380 --> 00:23:32.020
It's also based on Tornado when I check the requirements.

00:23:32.020 --> 00:23:34.340
Oh, that's really cool.

00:23:34.340 --> 00:23:38.900
So if you were going to write a script, just a terminal CLI type application.

00:23:38.900 --> 00:23:39.340
Yeah.

00:23:39.340 --> 00:23:41.700
And it would ask questions like input.

00:23:41.700 --> 00:23:43.720
What is your height in centimeters?

00:23:43.720 --> 00:23:44.440
Input.

00:23:44.440 --> 00:23:45.360
What is your weight?

00:23:45.360 --> 00:23:46.900
And it would convert that to a float.

00:23:46.900 --> 00:23:49.460
And then you would print out the information.

00:23:49.460 --> 00:23:51.220
So this has really similar stuff.

00:23:51.220 --> 00:23:54.540
Like the input doesn't come from the built-in one.

00:23:54.540 --> 00:23:57.600
It comes from PyWebIO.input.

00:23:57.600 --> 00:23:59.520
And that'll actually create a text box.

00:23:59.520 --> 00:24:01.980
And because you say the type, you'll even get validation.

00:24:01.980 --> 00:24:03.180
Like, oh, this has to be a number.

00:24:03.180 --> 00:24:04.540
That's pretty neat.

00:24:04.540 --> 00:24:04.920
Yeah.

00:24:05.120 --> 00:24:05.600
Yeah.

00:24:05.600 --> 00:24:07.740
I think it can be used for hobby projects.

00:24:07.740 --> 00:24:13.000
Like for people who know how to write Python code, but don't want to write HTML and JavaScript.

00:24:13.000 --> 00:24:26.520
And it also as a teaching tool for, let's say, you're teaching kids the concept of input and output and don't want them to just use the terminal.

00:24:26.680 --> 00:24:27.160
Yeah.

00:24:27.160 --> 00:24:28.500
You know, it's really interesting.

00:24:28.500 --> 00:24:32.340
My daughter wanted to learn Python and get into programming and stuff.

00:24:32.340 --> 00:24:34.060
And I tried to show her stuff in the terminal.

00:24:34.060 --> 00:24:34.780
She was just, no.

00:24:34.780 --> 00:24:35.420
Yeah.

00:24:35.420 --> 00:24:43.120
And then we started playing with Anvil, which has a similar, like really simple way to just get like graphical stuff on the screen.

00:24:43.280 --> 00:24:44.520
And she was all about it.

00:24:44.520 --> 00:24:48.680
She played with it for hours, creating little apps and quizzes for people and stuff.

00:24:48.920 --> 00:24:53.740
And it doesn't seem like a big difference, but that visual aspect, I think it's pretty big.

00:24:53.740 --> 00:24:56.120
I think people are, you know, it makes a big difference.

00:24:56.120 --> 00:24:56.560
Yeah.

00:24:56.560 --> 00:24:56.900
Yeah.

00:24:56.900 --> 00:25:03.200
I was, so I probably use something like this for maybe build scripts, for instance, used by a team.

00:25:03.200 --> 00:25:07.920
So sometimes you have like, you know, just a few questions you need to ask somebody.

00:25:07.920 --> 00:25:08.340
Yeah.

00:25:08.340 --> 00:25:10.820
And you can do that easily on a web form or something like that.

00:25:10.820 --> 00:25:18.760
But if it's like a script that you're running on the command line and some people don't want to run to have interactive command line.

00:25:18.760 --> 00:25:20.920
I don't understand that actually personally.

00:25:20.920 --> 00:25:26.720
But there's definitely people on my team that will not voluntarily run a command line script.

00:25:26.720 --> 00:25:27.720
Yeah, absolutely.

00:25:27.720 --> 00:25:31.540
And it looks like it integrates into existing web frameworks, which is cool.

00:25:31.540 --> 00:25:31.980
Yeah.

00:25:31.980 --> 00:25:38.900
But it also, the way it runs, it looks like you might be able to actually package it up with PyInstaller and just go here, double click this.

00:25:38.900 --> 00:25:40.300
And it'll come up with something.

00:25:40.620 --> 00:25:40.800
Yeah.

00:25:40.800 --> 00:25:41.160
Yeah.

00:25:41.160 --> 00:25:41.780
Yeah.

00:25:41.780 --> 00:25:52.260
The only limitation I see is that once you want to style the HTML code, but that's far, way far in the future.

00:25:52.260 --> 00:25:54.180
I mean, once you start doing that.

00:25:54.180 --> 00:25:54.240
Yeah.

00:25:54.240 --> 00:25:56.140
You probably got to do CSS or something like that, right?

00:25:56.140 --> 00:25:56.860
Yeah.

00:25:56.860 --> 00:25:57.100
Cool.

00:25:57.100 --> 00:25:58.080
That's a good pick.

00:25:58.080 --> 00:25:58.600
Very nice.

00:25:58.600 --> 00:26:00.900
Thanks to the contributor on Twitter.

00:26:00.900 --> 00:26:01.840
Yeah.

00:26:01.840 --> 00:26:02.380
Absolutely.

00:26:02.380 --> 00:26:02.880
All right.

00:26:02.880 --> 00:26:04.140
That's it for me, Brian.

00:26:04.140 --> 00:26:05.000
You got anything else?

00:26:05.000 --> 00:26:10.420
Well, I had teased about just saying that, well, we already talked about PyChix.

00:26:10.420 --> 00:26:11.880
test check a little bit.

00:26:11.880 --> 00:26:23.440
So the new package that I just put up last week, I guess, I went ahead and misunderstood.

00:26:23.440 --> 00:26:30.680
There's a package called pytestPoo, which is a brilliant package that I thought I had it wrong.

00:26:30.800 --> 00:26:34.760
I thought it put little like poo emojis for failed tests.

00:26:34.760 --> 00:26:36.240
Turns out it didn't.

00:26:36.240 --> 00:26:42.820
What it does is you had to mark a test with like poo.

00:26:43.080 --> 00:26:46.820
And then it just showed those whether it passed or failed.

00:26:46.820 --> 00:26:49.740
And I said, well, I thought, well, we kind of need a distinguisher.

00:26:49.740 --> 00:26:53.600
So also, I don't think I could get my team to use poo emojis.

00:26:53.600 --> 00:26:59.840
So I created pytestYuck because I'm a kid of the Mr. Yuck generation, I guess.

00:27:00.720 --> 00:27:05.180
And so what it does is you mark a test with Yuck.

00:27:05.180 --> 00:27:09.620
And if it passes, you get a green queasy face.

00:27:09.620 --> 00:27:12.080
And if it fails, it actually throws up.

00:27:12.480 --> 00:27:21.600
So this is a new and its download stats are the only day that recorded was 24 downloads.

00:27:21.600 --> 00:27:23.980
So that's actually pretty good for its first day.

00:27:23.980 --> 00:27:25.220
That's I'm going to say that's good.

00:27:25.220 --> 00:27:27.060
It was probably all me.

00:27:27.060 --> 00:27:33.720
But and then, I don't know, a month ago or so, I did pytestSourcePaths, which just allows

00:27:33.720 --> 00:27:38.180
you to specify import paths for so that your test can find your code.

00:27:38.520 --> 00:27:42.960
And then, as we already showed, pytestCheck is the one that's been out for years.

00:27:42.960 --> 00:27:44.580
It just allows multiple failures.

00:27:44.580 --> 00:27:46.480
So those are my packages.

00:27:46.480 --> 00:27:47.860
No, those are really cool.

00:27:47.860 --> 00:27:48.660
And you've been busy.

00:27:48.660 --> 00:27:49.380
Yeah.

00:27:49.380 --> 00:27:54.280
I'll try the Yuck package later.

00:27:54.280 --> 00:27:55.380
Nice.

00:27:55.380 --> 00:27:55.800
All right.

00:27:55.800 --> 00:27:58.400
I got a few real quick things to throw out there at the end here as well.

00:27:58.400 --> 00:28:04.360
Marco Gorelli sent over this project that he's working on called AbsoluteFi Imports.

00:28:04.360 --> 00:28:08.200
So if you've got a package that's using relative imports and you would rather to

00:28:08.200 --> 00:28:09.160
convert it over.

00:28:09.160 --> 00:28:15.800
So all the dot and from dot or from dot dot, whatever, import something and turn those into

00:28:15.800 --> 00:28:17.000
Absolute Imports.

00:28:17.000 --> 00:28:18.180
It's like one line.

00:28:18.180 --> 00:28:19.620
To me, it's a little bit like Flint.

00:28:19.620 --> 00:28:21.040
Run that against your project.

00:28:21.040 --> 00:28:23.400
It turns all the string formatting to f-strings.

00:28:23.400 --> 00:28:24.400
This will do that.

00:28:24.400 --> 00:28:27.140
But for the imports, take them from relative to absolute.

00:28:27.140 --> 00:28:28.420
So that might be helpful.

00:28:28.420 --> 00:28:30.440
People got some code to migrate and they want to do it like this.

00:28:30.440 --> 00:28:35.280
And then notice Anthony Shaw was in the audience, but I was already going to cover this.

00:28:35.440 --> 00:28:37.720
Last week, was it Kelly?

00:28:37.720 --> 00:28:38.400
Or it is?

00:28:38.400 --> 00:28:43.440
Who said, oh, when I talked about Beanie, the MongoDB ORM, she's like, oh, I thought you're

00:28:43.440 --> 00:28:44.360
talking about Beanie Babies.

00:28:44.360 --> 00:28:48.680
And then somebody threw out that Anthony Shaw should make a Beanie Baby plugin.

00:28:48.680 --> 00:28:52.080
And it looks like he's already made a Beanie Baby bear.

00:28:52.080 --> 00:28:53.880
Isn't that amazing?

00:28:53.880 --> 00:28:55.460
He had this up like the same day.

00:28:55.460 --> 00:28:56.380
Well done, Anthony.

00:28:56.700 --> 00:28:59.060
Thanks for keeping it interactive.

00:28:59.060 --> 00:28:59.580
That's awesome.

00:28:59.580 --> 00:29:00.320
Yeah, that's good.

00:29:00.320 --> 00:29:01.080
Yeah, cool.

00:29:01.080 --> 00:29:05.320
And we've talked about supply chain issues and hacks and whatnot.

00:29:05.320 --> 00:29:07.740
Well, this one should take people's breath away.

00:29:07.740 --> 00:29:12.920
Like, I mean, you were like, oh, you don't want to install from this other install source

00:29:12.920 --> 00:29:17.580
rather than from like main source on python.org or whatever I was talking about the other day.

00:29:17.580 --> 00:29:17.800
Right.

00:29:17.800 --> 00:29:19.600
I'm like, I'm building from source at this point.

00:29:19.600 --> 00:29:20.520
This is driving me crazy.

00:29:20.860 --> 00:29:23.040
Well, PHP didn't want to use GitHub.

00:29:23.040 --> 00:29:26.980
They wanted to have their own like sort of GitHub like thing with their own authentication

00:29:26.980 --> 00:29:28.140
and all that kind of stuff.

00:29:28.140 --> 00:29:33.180
Well, somebody broke into that and literally put a backdoor into PHP itself.

00:29:33.180 --> 00:29:35.220
Think about that.

00:29:35.220 --> 00:29:42.400
79% of the websites in the world run on PHP and the runtime itself had a backdoor in it.

00:29:42.400 --> 00:29:43.420
Just for a little while.

00:29:43.420 --> 00:29:45.020
But yeah, I mean, just for a little while.

00:29:45.020 --> 00:29:45.400
Yeah.

00:29:45.400 --> 00:29:50.120
Like, so there's, we can even cut a little bit of a diff here in this Ars Technica article

00:29:50.120 --> 00:29:53.720
I'm linking to like, excuse me, what does this line do?

00:29:53.720 --> 00:29:58.080
This line executes PHP code from within the user agent.

00:29:58.080 --> 00:30:01.760
If the string, if the user agent includes zero DM.

00:30:01.760 --> 00:30:05.920
So you just put your user aid, you just put the hack you want to run in your user agent

00:30:05.920 --> 00:30:07.860
and do a request to the server and off it goes.

00:30:07.860 --> 00:30:08.960
That's nuts.

00:30:08.960 --> 00:30:09.860
That's not good.

00:30:09.860 --> 00:30:11.740
So thankfully that's not Python.

00:30:11.740 --> 00:30:15.420
And then this one, this one was you, Michaela, right?

00:30:15.420 --> 00:30:15.860
Yeah.

00:30:15.860 --> 00:30:17.120
It's the last day.

00:30:17.120 --> 00:30:22.300
It's the last day of the March membership drive for the PSF.

00:30:22.300 --> 00:30:29.880
I mean, they said that you can be a member any time of the year, but it's the last day for

00:30:29.880 --> 00:30:34.400
their 2000 goal member for March.

00:30:34.400 --> 00:30:34.960
Yeah.

00:30:34.960 --> 00:30:35.540
Super cool.

00:30:35.540 --> 00:30:37.260
Hopefully they're doing well over here.

00:30:37.260 --> 00:30:37.720
Yeah.

00:30:37.720 --> 00:30:38.340
Yeah.

00:30:38.860 --> 00:30:41.000
So people, please be part of that.

00:30:41.000 --> 00:30:44.640
If, yeah, if you want to be great to support them that way.

00:30:44.640 --> 00:30:45.200
All right.

00:30:45.200 --> 00:30:47.880
And I got to say, Michael, thanks for bringing up Flint.

00:30:47.880 --> 00:30:50.320
I was actually forgot about that and I need it.

00:30:50.320 --> 00:30:51.180
And, and.

00:30:51.180 --> 00:30:52.920
F L Y N T.

00:30:52.920 --> 00:30:53.360
Love it.

00:30:53.360 --> 00:30:53.760
Yes.

00:30:53.760 --> 00:30:54.600
Y N T.

00:30:54.680 --> 00:30:56.660
I was Googling it for a while until I found it.

00:30:56.660 --> 00:30:56.960
Yeah.

00:30:56.960 --> 00:30:57.140
Nice.

00:30:57.140 --> 00:30:57.540
Yeah.

00:30:57.540 --> 00:31:02.300
I've turned that loose on some, most of the Python code I have to live with and any frequency

00:31:02.300 --> 00:31:03.060
I have to go back to.

00:31:03.060 --> 00:31:05.220
It's like, just find all the strings and make them f-strings.

00:31:05.220 --> 00:31:06.100
Then I'll go look at it.

00:31:06.100 --> 00:31:06.460
Lovely.

00:31:06.460 --> 00:31:06.980
I love it.

00:31:06.980 --> 00:31:07.400
Okay.

00:31:07.400 --> 00:31:07.800
All right.

00:31:07.800 --> 00:31:08.860
Speaking of love and stuff.

00:31:08.860 --> 00:31:09.460
How about a joke?

00:31:09.460 --> 00:31:10.360
I love one.

00:31:10.360 --> 00:31:10.720
All right.

00:31:10.740 --> 00:31:18.120
So this one comes not to us, but was found and Ricardo Ferreria put this out on Twitter.

00:31:18.120 --> 00:31:19.260
So I thought this would be fun.

00:31:19.260 --> 00:31:22.480
Like we've talked about comments before and we've even had those jokes where it's like all

00:31:22.480 --> 00:31:23.700
about the comments, right?

00:31:23.700 --> 00:31:28.500
It's all the crazy things people put in their comments, like, you know, hash, I really need

00:31:28.500 --> 00:31:30.280
to find a better job type of comments.

00:31:30.280 --> 00:31:31.660
So this one is more visual.

00:31:31.660 --> 00:31:34.460
I know some people are more visual and commenting what they're doing.

00:31:34.880 --> 00:31:40.840
So Brian, this is like a, like a smart speaker or like a, like a, some kind of conference

00:31:40.840 --> 00:31:41.300
phone.

00:31:41.300 --> 00:31:45.800
And on the phone, it's got some buttons and they have little icons, like a mute microphone,

00:31:45.800 --> 00:31:50.780
like a phone number one to like maybe place the call up down volumes have like louder volume,

00:31:50.780 --> 00:31:51.600
less loud volume.

00:31:51.600 --> 00:31:53.760
Maybe describe the comments for our listeners.

00:31:53.760 --> 00:31:58.860
Well, there's dashed lines to go to each button with like a manual or something, right?

00:31:58.860 --> 00:32:05.020
With it, with like the same icon that's on the device, just next to it.

00:32:05.020 --> 00:32:06.600
Just, yeah, exactly.

00:32:06.600 --> 00:32:12.800
This is like just the, the, you know, slash, slash or hash or whatever of the, you know,

00:32:12.800 --> 00:32:16.560
logger, logger equals new logger was the comment, you know, hash logger.

00:32:16.560 --> 00:32:20.740
This is the same, but, for documenting the user interface.

00:32:20.740 --> 00:32:25.980
Yeah, that's definitely like the, the, you know, string user comment, the user.

00:32:25.980 --> 00:32:28.200
Exactly.

00:32:28.800 --> 00:32:29.240
Beautiful.

00:32:29.240 --> 00:32:29.860
Nice.

00:32:29.860 --> 00:32:30.360
Yeah.

00:32:30.360 --> 00:32:34.200
Well, super fun to BS about Python again with you this week.

00:32:34.200 --> 00:32:36.380
Thanks Michaela for joining us.

00:32:36.380 --> 00:32:37.800
Thanks Brian and Michael.

00:32:37.800 --> 00:32:39.740
Yeah, it was really great to have you here.

00:32:39.740 --> 00:32:40.220
Thanks for coming.

00:32:40.220 --> 00:32:42.220
Good to see you as always, Brian.

00:32:42.220 --> 00:32:42.700
Bye.

00:32:42.700 --> 00:32:43.600
Bye guys.

00:32:43.600 --> 00:32:45.500
Thank you for listening to Python Bytes.

00:32:45.500 --> 00:32:48.060
Follow the show on Twitter via at Python Bytes.

00:32:48.060 --> 00:32:50.940
That's Python Bytes as in B-Y-T-E-S.

00:32:50.940 --> 00:32:54.220
And get the full show notes at pythonbytes.fm.

00:32:54.220 --> 00:32:58.440
If you have a news item you want featured, just visit pythonbytes.fm and send it our way.

00:32:58.740 --> 00:33:01.120
Always on the lookout for sharing something cool.

00:33:01.120 --> 00:33:04.220
On behalf of myself and Brian Okken, this is Michael Kennedy.

00:33:04.220 --> 00:33:07.640
Thank you for listening and sharing this podcast with your friends and colleagues.

