Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book


Transcript #257: Python Launcher - Launching Python Everywhere

Return to episode page view on github
Recorded on Wednesday, Nov 3, 2021.

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

00:05 This is episode 257, recorded November 3rd, 2021.

00:10 Hey, it's November. Cool. I'm Brian Okken.

00:12 I'm Michael Kennedy.

00:13 I'm Morla Sicarbo.

00:15 Well, welcome, Morla.

00:16 We haven't even really met other than a few seconds ago, so can you tell us who you are?

00:21 Yeah, my name is Morla Sicarbo, and I met Michael Kennedy a couple of weeks ago at a PyBay event.

00:29 In San Francisco.

00:30 A fantastic PyBay event. For people who cannot see it, they should go to pybay.com and just see the graphics.

00:36 This is the conference outside at a food cart area. So awesome. So great to see you there.

00:41 Right. And so I help Grace Law organize that event.

00:46 She and I have been working over the past couple of years, and it's a fantastic community.

00:51 And I've been in San Francisco for the past three years, and I'm actually, I work for the Defense Department.

00:59 I lead a software development team, and we work on optimizing software processes.

01:04 And on the weekends, I'm a commercial pilot.

01:06 So I do fly, and I do teach student pilots.

01:09 So that's, generally speaking, who I am.

01:11 That's so awesome.

01:12 That's cool.

01:14 My side job is a professional pilot.

01:16 Yeah. Including jets, right?

01:18 Yeah, I do fly corporate jets.

01:21 That sounds so fun. I think that's so neat.

01:25 You know, it's good to get away from the keyboard and the offices, especially when, with COVID happening and everything's harder to get out around.

01:33 Like, you really get away. You get up in the sky.

01:35 I do get away, but you got to be careful, right? Because you're going across different ecosystem, right?

01:41 So you got to make sure that you're well protected, that you take in all the precautions that are required to not get sick.

01:48 But it's an adventure. I do like to get around to it.

01:51 Awesome.

01:52 And Teddy, on the live stream, says, you invited James Bond, I think.

01:56 I think we may have, actually.

01:58 Yeah.

01:58 Where do you park your Austin Martin?

02:00 No, seriously.

02:01 Let's kick this off, Brian.

02:03 With something also, Morley, you're also involved with Django stuff, right?

02:06 In San Francisco?

02:08 Yes, just a little bit.

02:09 By the way, first off, I do want to say thank you very much, Michael.

02:12 So many years ago, I was overseas, and I was in Qatar at the time, and I got started learning how to code.

02:20 And Python was the language that was, at least from my perspective, something I could use in my data science perspective.

02:27 And working with you through Talk Python to me was extremely helpful for me, learning how to code, just being with the community.

02:37 And I think that was extremely helpful.

02:38 It's gotten me in different places, only because I started to learn how to code and got involved with your podcast many years ago.

02:47 So thank you for that.

02:47 That's amazing.

02:49 Thank you so much.

02:50 It really means a lot.

02:51 And it's easy to forget, Brian and I just sit here at our desk and chat about stuff.

02:56 But it really helps connect people, especially if they're new or they're coming from places where there's not a big community they can drop into.

03:03 It helps people get more integrated quicker.

03:06 And I think that's fantastic.

03:07 Yeah.

03:07 And it's just the way you guys talk, right?

03:09 I mean, it's just you're talking to me as opposed to talking to an audience or a group of large crowd or something like that.

03:18 So I'm listening to a podcast, and I'm going, this is relatable.

03:22 And I can actually go out and do a little bit more research on a package on a topic that you guys are talking about.

03:28 So it's really good.

03:29 Nice.

03:30 Yeah, fantastic.

03:31 Speaking of packages, let's talk about Django.

03:33 Yeah, let's start with Django here.

03:35 So I don't do that much Django.

03:38 I do more on the micro framework side of things.

03:41 But Django is super important.

03:43 And when cool stuff happens there, I want to make sure to give it a shout out.

03:47 So we're Django 4.

03:49 I mean, in beta, but still Django 4.

03:51 Morley, have you been tracking this?

03:52 Are you excited about this?

03:53 I am tracking it.

03:54 I'm excited about it.

03:55 Yep, absolutely.

03:56 Yep.

03:56 Yeah, super cool.

03:57 So Django 4.0 beta 1 was released.

04:01 I feel like it was Django 1 for a really long time, and then Django 2, and then, you know what?

04:06 Blow the doors off.

04:07 We'll go 3, 4, 5, 6.

04:08 We're going to be at Django 20 soon enough.

04:10 Right.

04:11 But this is really good news.

04:12 The beta 1, so means feature freeze, bug fixes only type of thing, is out.

04:17 And if you're interested in this, you can try it out now.

04:21 Notable changes here for what's coming along.

04:25 First of all, it's only compatible with Python 3.8 and beyond, which is pretty fantastic.

04:31 And if you want older support, as in all the way back to 3.6, you got to go back to Django 3 series, 3.2.

04:37 So I think that's pretty interesting as well, the rapid adoption of new Python, right?

04:42 This is like two years of Python and not more.

04:45 So things that are new.

04:46 There's stuff about time zones, which I'm not going to bore you with.

04:50 But database stuff is cool, right?

04:52 One of the things that I think Django is really renowned for is its web front end plus database integration, right?

04:59 Wouldn't you say so, Morley?

05:00 Yes, absolutely.

05:01 Yeah.

05:02 Yeah.

05:03 I think it's not just the, well, you have an ORM that's built in, but you've got the admin sections that know about the models and all kinds of stuff.

05:10 We're actually going to come back to that as well later in this episode.

05:14 But one of the new things is functional unique constraints.

05:19 So like I can only insert this record if there's not already one that matches, say, the email address for a user.

05:24 So now what you can do is you can create functionally unique constraints with expressions and database functions.

05:32 So, for example, you could have an index, which is a unique constraint where you have the lowercase of the first name, the lowercase of the second name, descending, I guess, for the index bit.

05:44 But that doesn't really matter for the constraint.

05:45 And then you can give it a name, like first name, last name must be unique constraint.

05:50 And so that's pretty awesome, right?

05:51 You can say, I can't have two users with the same name.

05:54 I'm not sure how practical that is, but, you know, as an example, it makes good sense.

05:57 Yeah.

05:58 Poor Joe Smith or Michael Kennedy, for that matter, like probably going to not make it in after a couple hundred thousand users.

06:06 Let's see.

06:06 They have the script password hasher.

06:09 So you do not, hopefully you are not storing raw passwords.

06:13 Every time I see a website that says your password cannot be more than eight characters, I'm like, that better not be a varchar eight field.

06:20 I don't know what you're doing, but I'm starting to get really worried because the size of the output of a hash is always the same size, regardless of the input.

06:27 Anyway, so new password hasher that's more secure and recommended over what was previously the default of PBKDF2, right?

06:36 It's, however, not the default because you have to now install open SSL 1.0 or above, which is not super high, but it's still not super new version.

06:44 All right.

06:45 Then Redis, there's now a dedicated built-in Redis cache as the caching tier.

06:50 So you can set up caching in Django and say cache here.

06:53 Now one of the options is Redis.

06:55 Yes, you could do that previously, but now it's like a built-in thing.

06:59 So you don't have to do that outside of.

07:02 That's cool.

07:03 Yeah, that's cool, right?

07:03 That's very cool.

07:04 Yeah.

07:05 And then template-based form rendering.

07:08 So enhanced customization of forms, form sets, errors list, and so on using the template engine.

07:13 So pretty cool.

07:14 Not a huge bunch of changes, but they all sound really nice.

07:17 Yeah.

07:18 The support of which Python versions is pretty big, but I mean, come on, people.

07:22 It's an application.

07:24 You can pick your whatever Python version you want.

07:26 Yeah, that's right.

07:27 Out there in the live stream, Alvaro says, I guess that dropping versions helps to reduce the number of wheels to build and also to test, right?

07:35 Probably so CI is probably faster.

07:37 You can take advantage of some of the newer things and just count on them being there, which is great.

07:43 Also, speaking of versions, Sam Morley.

07:46 Hey, Sam.

07:47 Great to see you again.

07:48 It says, getting my boss to agree to drop Python 3.4 was a task.

07:53 It's been a while since 3.4 was out.

07:55 I actually remember, I think, where I was.

07:57 I was out in Redlands, California.

07:59 That came out, which is pretty interesting.

08:01 Anyway, I don't know why that came to my mind.

08:03 Is this stuff exciting to you?

08:05 Morley, someone does more Django than probably Brian or me?

08:07 No, it's very exciting to me.

08:09 Just being able to see just the iterations of Django is very, very helpful to the community.

08:15 I started with Django 3.

08:17 So this few iterations have been very helpful, especially Redis.

08:21 Absolutely.

08:22 Yeah, the Redis is exciting.

08:23 Yeah, for sure.

08:24 Brian?

08:25 Well, I have to apologize.

08:27 I don't remember who pushed us this way, but somebody on Twitter said, hey, you guys should maybe talk about Py once in a while, like just Py itself, the PY, the application.

08:37 So Py or Py.exe, it's the Python launcher.

08:42 This has been bundled with Python 3.3.

08:45 So it's been there for a while.

08:47 But to be honest, I kind of ignored it because it's a Windows-only thing.

08:52 And I do work on Windows, but I also work in Mac and Linux and multiple environments.

08:58 So I really don't want to change my workflow just for one.

09:01 But the idea is that you just type Py and it picks the latest version that you have installed on your system.

09:09 It's kind of neat, but I didn't really get the feel for it.

09:14 But then Brett Cannon wrote this thing called Py Launcher that is the same thing, but it works on Mac and it works on Linux and it works on a whole bunch of other stuff like Arch Linux.

09:30 Really, anything that Rust can run on, I think it works on, which is like almost everything.

09:36 So this is pretty neat.

09:38 But why is it neat?

09:39 So I'm like, still, why did Brett spend time making this work?

09:43 And so I started changing my workflow for this.

09:45 And I got to say, it's kind of life-changing.

09:49 The big thing is I don't have to care where Python's installed anymore.

09:53 So I have this set up on my Mac.

09:56 I've got it set up on, I included it in the install on Windows.

10:00 And then you just say, like for instance, you can say py-list.

10:05 And you get like all of the, I don't have the example here.

10:09 You get all of the versions listed out.

10:12 And it lists, it tells you where they are too, but you don't really have to care.

10:17 And in the Py Launcher version on Linux or Mac, it shows the paths right away.

10:23 On the Windows version, you have to say list paths, but it's still pretty easy if you want to know where they are.

10:28 But basically, you don't have to care where things are anymore.

10:30 So I also don't have to care where they are in the path, like in my path variable.

10:36 So the Python version I want, is it the first one?

10:40 The second one?

10:40 Did I install something?

10:42 mess it up?

10:43 Like if I install Python 3.10, but I also want to test on 3.6.

10:47 So I installed 3.6 later.

10:48 Where does that show up in the path?

10:50 I don't have to care anymore.

10:51 Because my workflow is mostly around virtual environments.

10:57 So I say like Python-MVNV, and I create a virtual environment.

11:03 And I create it with the most recent Python version, no matter where they are in the path, where they're located.

11:08 And then if I want to test something on 3.8 or 3.9, I can just type pi-3.8 or 3.9.

11:18 And then it just automatically runs that version.

11:22 So I can run a script in Python 3.8 easily like that.

11:24 Or I can run it with, I can create a virtual environment, a 3.8 virtual environment really easily.

11:30 And then I still don't, basically I don't have to care where things are installed anymore.

11:35 And I love that.

11:37 The other thing that I really like, sorry if I missed you hearing you say this, is once you create the virtual environment, subsequent calls to pi will use that environment long as you're either in that directory or in a subdirectory.

11:50 So you don't have to activate the virtual environment.

11:53 Like long as traversing up the hierarchy hits a .ve and vdirectories.

11:59 Like, okay, that's the most appropriate Python.

12:02 Does it work that way?

12:04 That's what it says.

12:05 Like, see the code sample right there?

12:06 Look right underneath the, what's the next paragraph, right?

12:08 It says subsequent uses of pi will then use that virtual environment as long as it is the current or higher directory.

12:14 No environment activation required.

12:16 That's pretty cool.

12:17 Yeah.

12:18 That's very cool.

12:18 That's very cool.

12:19 It's so nice.

12:20 Because that way you can set up your file system.

12:22 You don't have to remember to activate it.

12:24 Like, certainly not common, but it is not also uncommon that I'm like, pip install this.

12:30 Oh, it went to the wrong place.

12:32 You know what I mean?

12:34 Yeah.

12:34 Configuration is extremely important, right?

12:36 So this is, this is very good.

12:38 Yeah.

12:38 Very good.

12:38 Yeah.

12:39 Yeah.

12:39 And Zdocs on Livestream says, what's the main difference from this to pi e and v?

12:45 I think that that's one of them, right?

12:47 Pi e and v, you've got to do pi e and v run.

12:49 You've got to like start the shell.

12:51 And it's kind of, and I think this one is sort of, it's more like node packages or node modules.

12:56 Like as long as it finds something there, like, okay, that's the project I'm in.

12:59 Let's run.

13:00 Yeah.

13:00 And pi e and v does these shim things to change which, which you can set up, which one you find.

13:06 And I just, that, I don't know.

13:08 That makes it weird to me.

13:10 It makes my, my system have state that I have to remember.

13:14 That's true.

13:14 Yeah.

13:14 Yeah.

13:14 Yeah.

13:14 We've activated Python 3.7.

13:16 So now that's, it stays that way.

13:18 Yeah.

13:19 Until you change it, right?

13:20 Okay.

13:20 So anyway, this has changed my life for the better and it's, it's great.

13:24 So thanks Brett.

13:25 Yeah.

13:26 And now I use it on windows too.

13:28 So.

13:28 Fantastic.

13:29 All right.

13:30 Up next.

13:30 Oh, I almost closed, closed what you're talking about more than.

13:34 Yeah.

13:35 You're on the data science side of the world.

13:37 Yeah.

13:37 Now.

13:38 So bring us some data science news.

13:39 No, this is good.

13:40 Right.

13:41 So this is this data of AI report 2021.

13:43 It's a pretty extensive report.

13:46 It comes out every year, just surveying across the world, really just the trends on data science.

13:52 And so at the very top there, it has the actual report.

13:56 It's a, it's a PowerPoint version, but in this report, it highlights just the, the, the need for transformers being used, not just for NLP, right?

14:07 So for, you know, looking at texts, but it's also looking at audio.

14:12 It's also looking at video and it's also looking at like, you know, protein transcription, for example.

14:17 So it's transformers are going beyond what they were intended to be, which was just primarily just NLP.

14:25 Right.

14:26 Yeah.

14:26 Give us a quick definition of a transformer.

14:27 This is, yeah, like you say, out of the natural language processing side of ML, right?

14:33 Right.

14:34 So it's, it's, it's, it's basically a sequence to sequence.

14:36 So it's, it's taking a text from say English and converting it into an equivalent text into French or something else.

14:45 Right.

14:45 So, having a natural language processor transformer that can do that in a rather efficient basis, is the whole idea of transformer space.

14:54 So it's basically taken, again, tokens or just sequence from one language to another language.

15:01 And so, what, what this is saying now is that it, it isn't just constrained to just NLP.

15:07 Right.

15:08 So now you can use it for looking at large data sets that are, audio or large data sets that are, you know, imagery.

15:16 And then converting that into something that's, that you intended to do.

15:20 So you're sticking those models, transfer learning, essentially taking the transfer learning from one model into another set of models.

15:27 That's essential.

15:28 What is this talking?

15:29 The idea here is that you're moving away from just NLP that you use in it for computer vision, as it says down there, and even protein structure prediction.

15:37 This is important to me because I actually, Michael, I don't know if we're still in the early, I spent some time in Qatar and I was, I was studying Arabic there.

15:45 Right.

15:45 So we would spend like hours just, just going through like transcription, data sets and stuff.

15:53 So now, you know, having a transformer that can actually do that faster and maybe more accurate than, and in the past, I think it's extremely helpful for somebody like, and, the hug and face transformer from a Python perspective.

16:07 It's an extremely popular, package on, GitHub and that most people it's, it's, it's got about 53,000 likes at this point or stars at this point.

16:17 Wow.

16:17 That's, that's comparable to Django and Flask level of popularity.

16:20 Yes.

16:21 Yes.

16:21 Yes.

16:22 Yes.

16:22 Yes.

16:22 And, they formed partnership with, AWS.

16:25 And so now you can spin up, resources on AWS to use, Huggins face, transformers.

16:31 And again, those transformers have models that you can use for transcription.

16:35 You can use them for a vision, a computer vision, or even like it's saying here for, protein structure predictions.

16:42 Yeah.

16:43 Cool.

16:43 I'm very excited about what ML can do for medicine and biology research.

16:48 I think, you know, machine learning and like recommendation engines and all sorts of stuff have good sides and bad sides and all kinds of things.

16:56 But, on the medical side, it seems like it's mostly good, right?

17:00 If, if you could say, actually we can cure this disease cause we've understand how to create something that will bind to this protein.

17:06 Cause now we know it's actual shape.

17:07 Yeah.

17:08 That's great.

17:09 That's, that's incredible.

17:10 Right.

17:10 So predicting those shapes for protein is extremely important.

17:13 Right.

17:14 I studied chemistry in college and, and a little bit of biochemistry when I was in college and in knowing the structures for proteins, it's like extremely important, but it takes a long time to model those, the structures.

17:26 Right.

17:26 Now you can do that pretty easily on a using transformers.

17:29 It's a, it's a good thing.

17:30 Yeah.

17:31 There's probably less well-known ways around more like physical chemistry as well.

17:35 Right.

17:35 Like trying to understand different kinds of batteries and things like that, potentially, you know, don't get all the press.

17:41 Well, I'm, I'm thinking that maybe we're not too terribly far away from universal translators and in AirPods.

17:47 That would be cool.

17:48 Yes.

17:48 Yeah.

17:49 That would be actually pretty amazing.

17:52 I mean, we're pretty close with Google translate.

17:53 You can speak to it and then show it to someone in their language.

17:57 And then they can, I can think you can even make it read back and like, you can really clumsily do it, but what you're envisioning is just like natural conversation.

18:04 Right.

18:04 Yeah.

18:04 Yeah.

18:05 And have it be in their voice too.

18:06 yeah, that's pretty cool.

18:09 That was pretty cool.

18:10 You know, you got to wait five seconds for it to calculate a deep fake, then you can start talking.

18:14 Well now, but like our, our kids are going to be like using these things probably.

18:19 Yeah, I know.

18:19 I think you're totally right there.

18:20 Absolutely.

18:21 Awesome.

18:22 Yeah.

18:22 Yeah.

18:22 Good pick there.

18:23 More like great.

18:24 Before we thank our sponsor, I want to just give a quick shout out to John Sheehan's comment here that Python launcher, the Pi thing that Brian spoke about, looks like a nice package and a better alternative to the Pi alias I created on my Linux laptop.

18:38 Oh man.

18:39 You and me both, I, my, ZSHRC is full of alias this, alias that many of them starting with P to do something with Python.

18:47 Yeah.

18:48 I mean, I, I used to list like, like makeup aliases for Pi 3.8, Pi 3.9 just to, and then I couldn't remember if I had a dot in it or not.

18:55 Was it 3.8?

18:56 3.8?

18:56 Yeah.

18:57 Anyway.

18:57 Yeah.

18:58 Yeah.

18:59 Cool.

18:59 All right.

19:00 Before we move on though, I do want to tell you about our sponsor shortcut.

19:04 Thank you.

19:05 Shortcut formerly clubhouse for sponsoring the show.

19:07 Check them out at shortcut.com slash Python bites.

19:10 Or Brian, do you know what else that people can do now?

19:12 What?

19:13 We've started adding chapters, chapter images, chapter links.

19:18 So I guess you could even click the chapter link right here in your podcast player or in the podcast show notes.

19:23 So that's pretty awesome.

19:24 But however you get to them, you know, thank you to shortcut for sponsoring this episode.

19:28 They've built simple project management tools that grow with your engineering team and don't get too complex, but are not too simplistic.

19:39 So some of the highlights include team-based workflows.

19:42 So individual teams can use shortcuts, default workflows, or they can customize them.

19:46 Organizational wide goals and roadmaps led like the overall organization define workflows and then tie these smaller team ones into the larger workflow and kind of get a big organization wide view.

20:00 VCS, version control integration.

20:02 So it works with GitHub, GitLab, and Bitbucket.

20:05 And it can tie them, tie your items in your project management back over into what's happening there.

20:13 And you can even do that from the command line, which is cool.

20:15 As almost all web apps should have, but many don't.

20:19 Shortcut has a bunch of keyboards.

20:21 So you can use their power bar and use hotkeys all over their web app to just zoom around because like someone like Brian, who would rather be in Vim mode and not take his hands off the keyboard, can cruise around.

20:33 Nice.

20:34 It does iteration planning.

20:35 It will automatically schedule how that should go along if you don't want to customize it.

20:39 So give it a try over at shortcut.com slash Python bytes because you shouldn't have to manage your project management.

20:45 So yeah, thank you to Shortcut for sponsoring the show.

20:48 Now, let's go back to Django.

20:50 And I'm going to tie this together.

20:53 So Morley has a background in Django.

20:55 Brian, you have clearly a bunch of testing.

20:58 So let's talk about testing Django models.

21:00 Okay.

21:01 Awesome.

21:01 Okay.

21:01 Yeah.

21:02 So one of the problems you might need to do in your test is you are going to create some data models and then you want to do stuff with them, right?

21:09 You want to pass them off to a function or whatever.

21:12 And so that can be a bit of a hassle.

21:14 So I want to tell you about model bakery, which are smart fixtures for better parentheses Django tests.

21:20 That's not quite there, but for better tests for Django code.

21:24 So the idea is it's like Baker or Makaru or something like that, but for Django or our models.

21:31 And it specifically understands things like relationships and whatnot.

21:35 So pretty cool.

21:36 You can come over here and do things like you've got your Django model defined as it does, right?

21:43 Derivation models has fields, which are columns, like email fields, character fields, and so on.

21:49 And then when you want to use it, you just go to the Baker and say make a, you know, in this case, it's like a shop, like online e-commerce shop.

21:57 So you can say shop.purchase history is the namespace of the class.

22:01 And then guess what?

22:02 It'll populate it with customers and emails and all kinds of stuff.

22:06 That's cool, right?

22:07 Yeah, it is.

22:07 It's very cool.

22:08 Yeah.

22:09 And then you could also set up model to model relationships.

22:11 So you can say, I want you to, when I create a purchase history, for example, it also has a products.

22:18 So you can say, make the model to model relationships for me and mock those out as well.

22:23 So then in your test, you can work with your purchase history object and say dot products and then, you know, loop over them, do account, whatever.

22:30 It's like a collection of sub or related models that were baked up for you.

22:35 Yeah.

22:36 You can even go and say, prepare when, prepare something to bake.

22:40 When, when you ask somebody gives you a product, I want you to, or create me a product of five of these.

22:47 And then as you make a purchase history, also use those five as the related object instead of guessing or randomizing or whatever.

22:56 It's cool, right?

22:56 That's very cool.

22:57 Very cool.

22:58 Yeah.

22:58 So if you're out there writing tests for Django, specifically the relationships, I think is where this is, is pretty interesting, but man, it's kind of interesting all over, right?

23:06 It'll, I suspect it'll do things like create emails.

23:09 If the model says, here's an email field and it'll create integers.

23:13 If it says, here's an integer field and just take care of that for you.

23:16 That's very cool.

23:17 So do you know, is it, is it another, like a, another fake system or is it using a faker or something under the hood?

23:24 Do you know?

23:24 No, that is a good question.

23:26 What kind of project?

23:28 I can go find out, I guess.

23:31 No, no, no.

23:32 Like, all right.

23:32 So let's go check out the requirements here.

23:34 It's just Django.

23:35 It has, its only requirement is Django.

23:38 Django.

23:38 Wow.

23:39 It doesn't use like, faker or anything like that.

23:42 So I'm guessing it's its own thing.

23:44 Nice.

23:45 Cool.

23:45 I seem like it.

23:46 Yeah.

23:47 Cool.

23:47 Cool.

23:47 That's very cool.

23:48 Yeah.

23:48 Thanks.

23:48 All right, Brian.

23:49 you got to cover this next one for us or what?

23:52 Yeah, I'll cover this one.

23:53 that's one of my goals.

23:56 so, well, good comeback.

24:00 so, Ned Batchelder, is, maintainer for, coverage.py.

24:06 Excellent tool.

24:07 And he's a great person to have at the helm there.

24:09 but he, he's says that he's got, had requests for like, one of the things you

24:16 can do with coverage is you can incorporate it in your, your testing tool chain and CI and

24:21 stuff to say that coverage has to be at a certain level.

24:24 So you can say has to be a hundred percent if you want to do that, or you can say, well,

24:28 at least what, what is the current percentage?

24:30 And we want to make sure that we don't drop it.

24:32 So you like, let's say you're at 75.

24:34 You want to make sure that we don't drop below 75, but he's had requests for profile thresholds,

24:40 which is an interesting idea.

24:42 But instead of giving us profile thresholds, he's, he's got like this proof, proof of

24:47 concept thing called goals.py.

24:49 And it's just a snippet that you can download yourself and try it out, but it's a little tiny

24:55 script, but it, it uses the, the coverage data after the fact.

24:59 So coverage, generates a report and then you can do things on it.

25:03 But this, what this, goals thing does is it kind of acts like another stage.

25:07 So you can, you can set up these in your pipeline to, to check for these.

25:11 And if, and it'll have a exit code that, indicates to your CI system that it failed.

25:16 But, for instance, you can say, all of the, I want all my tests to be a hundred

25:20 percent covered, but my source code, maybe 85% for those.

25:25 And, but like maybe the HTML part of it, I want to really want, or like all the code

25:31 that is dealing with HTML that I want to make sure that it's really tested.

25:35 So I want a hundred percent coverage there, but in general, you can 90%.

25:39 So he has an example set up, to do just what I said, of that.

25:44 So there's these glob groups that you can say, you know, the 85% for everything that's

25:50 a Python file, except for the tests and then have a different.

25:53 Interesting.

25:54 So the way you basically do it as a CLI thing, and then you pass in.

25:59 Yeah.

25:59 File patterns like star.py or star HTML star.py or whatever.

26:05 Right.

26:05 And you can even do knots, which is interesting.

26:07 Yeah.

26:07 And one of the things he's talking about is just, he wants to, wants to have people

26:12 try this and say, is this kind of, does this satisfy what you wanted or is there something

26:17 else that's needed?

26:18 Do we really need profile?

26:19 I actually would hate to have profile.

26:21 Cause yeah.

26:22 Yeah.

26:22 One quick way to like accomplish profile is just to put the file name as the pattern.

26:28 Right.

26:28 I mean, so it like, this is a superset of profile testing.

26:32 Yeah.

26:33 Potentially.

26:34 But I, I, I believe that he's probably right that there's, and there's a link in here

26:38 to say, if you want to comment on this, go to the original feature request and do a comment,

26:42 but there, it's probably right that like, it's not really a profile thing.

26:46 It's that there's different sections of the system that you want to have, yeah, have

26:51 specifics or like for instance, with a knot, you could say, well, everything except for

26:55 there's this one file that I know it's a problem, but we don't care about it.

26:59 maybe exclude.

27:00 Yeah.

27:01 The developer who wrote it quit.

27:03 Nobody understands it.

27:04 We're not touching it.

27:05 Please don't complain to us about it.

27:06 We have no intention of touching it.

27:08 Or maybe it's the splash screen.

27:10 Like, you know, some things throw up a splash image and, you know, really, if that's wrong,

27:15 who cares?

27:15 sort of thing, but.

27:17 That's very cool.

27:18 Yeah.

27:18 It's a good one.

27:19 Nice find.

27:19 And I, I like the generalization of it.

27:22 Well done, Ned.

27:23 All right.

27:23 More late.

27:24 So there's a lot of stuff about economic news these days, especially, DeFi and

27:30 Ethereum and Bitcoin.

27:32 And, NFTs.

27:34 Right.

27:34 So it's, it's already out there.

27:36 Yeah.

27:36 So my brother is an artist and, worked for a long time doing just like insurance stuff

27:41 and project management stuff and is now started getting into NFT stuff because finally putting

27:46 his, master's degree in art to use, which is fantastic.

27:49 Yeah.

27:50 It's a crazy world.

27:51 It's a crazy world.

27:52 And just the thought about like, making digital assets.

27:58 Digital scarcity, right?

28:00 Like the thing that was digital was you could copy it.

28:02 Right, right, right, right.

28:03 And, and over the past, I mean, I've been looking at this over the past six months or so,

28:07 and I'm just curious, I'm just, you know, where does this go in terms of like, how can

28:13 you use digital assets as scarcity, but, you know, provide value eventually.

28:17 So artists can actually, you know, get paid or, or, or, or make, make use of their, their

28:23 art, make it, make it available out there and get, and get value from it.

28:27 So Ethereum though, is like one of those blockchains that pretty much, I think about, I want to

28:33 say 80 to 90% of all NFTs reside on Ethereum blockchain.

28:37 Right.

28:38 I think so.

28:38 Yeah.

28:39 I think it's definitely popular.

28:40 Yeah.

28:40 And so of course the language there is, solidity, but to interface with, the

28:46 blockchain, there's this library called web3.py, right?

28:51 So instead of, instead of using, JavaScript, you can use, web3.py to actually interface

28:58 with Ethereum blockchain.

29:00 So basically you can write smart contracts there, but you can also, get information

29:05 from the blockchain itself or post information into the blockchain.

29:08 So I, this is something I've found and I'm actually looking into it and I thought I want

29:12 to share that with the community.

29:13 Yeah.

29:14 It's interesting.

29:15 Yeah.

29:15 So there's an Ethereum.org slash Python for Python tutorials.

29:19 There's a quick start.

29:21 Right.

29:22 And so on.

29:23 Yeah.

29:23 Right.

29:23 If you were allowed and you can see, what it takes to actually get it installed and use

29:28 it for, some of the protocols that are required.

29:30 So it's actually a pretty good, I've used it just a couple of times and I'm still playing

29:34 around with it, but I think it's a, instead of using something else, if you're familiar with

29:38 Python, this is a very comfortable transition.

29:41 If you're curious about blockchain or Ethereum, so, yeah.

29:44 So you could build your own platforms and your own integrations, not just own Ethereum

29:49 coins.

29:50 Right.

29:50 And so you can be the old smart contract, right?

29:52 We should just logic essentially, send ether or receive ether or, or if it's NFTs,

29:58 again, how do you interface with the blockchain with, cartography?

30:03 So, so, web three point web three point PY, I think is extremely helpful.

30:08 Yeah.

30:09 Yeah.

30:10 It's neat to see Python applied in some different places.

30:13 Yeah.

30:13 Everywhere.

30:14 Everywhere.

30:15 Right.

30:15 Yeah.

30:15 Everywhere.

30:16 Yep.

30:18 Cool.

30:18 All right.

30:19 Awesome.

30:19 Yeah.

30:19 That's a great find.

30:20 pretty cool.

30:21 Yeah.

30:21 Pretty cool.

30:22 Brian, it's time for extras.

30:23 Extra.

30:24 What you got for us.

30:25 What'd you line up for us here?

30:26 I actually don't have any extras today.

30:28 No extra.

30:29 There's no extra, extra, extra read all about it.

30:31 No.

30:31 All right.

30:32 I'll take care of it.

30:33 I got you covered here as you might imagine.

30:36 So I want to give people an update on McFly.

30:39 I mentioned McFly a little while ago.

30:42 McFly is sweet.

30:43 it's allows you to install it.

30:46 And it's kind of like reverse search of your shell commands, be that bash, Z shell, fish,

30:53 whatever, but way better.

30:54 Right.

30:55 You get like an Emacs interface to your history and you can delete it.

30:59 You can edit your history.

31:00 So if you mistype something and you want to save it or you see like, Oh geez, put the password

31:05 in there.

31:05 I want to get that out of my history file.

31:06 You can do that.

31:07 So you just hit control R after you install it.

31:09 And it gives you this, this awesome interactive view.

31:12 I just want to tell people that I've been playing with this and totally loving it.

31:16 Like now I've, I've taken it for a spin for a while and I really, really dig it.

31:19 I've even set up the, fuzzy matching.

31:22 So it doesn't have to exactly match what I've done in history, which is pretty cool.

31:25 So I could now with some experience, give that a thumbs up.

31:29 Nice.

31:29 Nice.

31:30 Nice.

31:31 Also a couple of exciting things about Python web conference.

31:34 If you're looking to speak somewhere and you want that somewhere to be on the internet,

31:38 you should check out Python web conf.

31:40 This is like a five day conference.

31:41 It's one of the biggest virtual conferences going these days, I think.

31:46 And it's interactive presentations or live presentations over the internet and then, chat and so

31:52 on.

31:53 So, we've had Calvin, one of the organizers of it on before.

31:57 And the, the news is they've extended their call for papers out into November, November 15th.

32:04 So you got 12 more days, maybe 11 if I'm slow releasing this one.

32:07 And also I'm going to be talking about flask and HTMX over there.

32:11 Cause I'm still psyched about that.

32:13 So that's the next year, early next year, but now people can check that out.

32:16 Nice.

32:17 All right.

32:17 What else have I got for us, Brian?

32:18 So, the new MacBook pros, like the super expensive MacBook pros have come out.

32:24 there's an interesting review.

32:25 I'm not super thrilled with it, but over at ours, they usually do a pretty good job, but I do want to read a fun quote from it.

32:31 And they say, rest assured if you didn't like the direction that Apple has been taking with the MacBook pro for the last five years,

32:37 this laptop feels like an explicit apology for all that.

32:40 The result is it's the best lot, best laptop money can buy from any use cases, provided you have a lot of money.

32:45 But one of the things that I found pretty interesting is the power supply for that thing is 140 Watts.

32:52 Oh, wow.

32:53 That's insane for a laptop that you carry around the power supply.

32:56 Wow.

32:57 So I came across this thing called anchor nano to 65 watt.

33:01 And it's, it's, if you put it up next to, that's not, it's, it's, well, hold on.

33:07 It's barely bigger than the brick that used to charge an iPhone, like an American brick, not a UK brick, which has got to be giant because the size of the plug.

33:15 Right.

33:16 But it's like super small and light.

33:18 And yeah, it seems like it's not enough.

33:19 But with my, I got a MacBook pro max and I've been using it and this 65 watt thing will charge it just fine.

33:27 So unless you're doing like machine learning or video exporting or something that completely nails it, like this will charge like 25% in an hour, even though it's supposed to take a 140 Watts, you can give it this little tiny thing.

33:39 So I haven't done enough to really give it a hundred percent.

33:42 Like absolutely.

33:42 That's going to work all the time.

33:43 But my new plan is to travel with this tiny little thing and like a long USB, C or Thunderbolt cable.

33:49 Interesting.

33:50 Right.

33:50 That's pretty interesting.

33:51 Yeah.

33:52 Could you put two in there?

33:54 I don't think maybe it'll catch fire if you do that.

33:57 I'm not going to do that.

33:58 But like here you have the picture, like it's like less than half the size of the charger, which is pretty interesting.

34:03 Yeah.

34:04 That's a 60 watt charger right there.

34:06 Not the 140 watt charger.

34:07 140.

34:08 All right.

34:09 And finally, I want to say that if people who have an M1, not an M1 max or pro, you can pretty much not have FOMO about this thing.

34:18 Like as far as I can tell, my Mac mini and my much more expensive MacBook pro are exactly the same speed.

34:23 Oh, really?

34:24 Okay.

34:25 I think almost always.

34:27 Except one thing I found is for outputting video.

34:30 I found that I could re-encode or I could encode the videos for TalkBiz on training more efficiently.

34:36 And I re-encoded the entire library, which is like 220, 230 hours in multiple formats.

34:43 It took 14 days of compute time.

34:46 Not I got around to do it in 14 days.

34:49 Like start, it finished 14 days later.

34:51 And it's actually three over three times faster with the M1 max.

34:58 So just like three or four days.

35:00 Yeah.

35:00 It's only five days, which is still a long time, but it's way better than 13, 14 days.

35:05 Let me tell you.

35:06 13, 14 days.

35:06 Yeah.

35:06 So I think also this will have a really interesting knock-on effect for ML.

35:11 Right.

35:12 It's got like the onboard machine learning block.

35:15 And it's got a 32-core GPU.

35:17 I think there's a lot of stuff that's going to be coming along that's pretty interesting there.

35:20 What do you think?

35:20 No, no, no.

35:21 It's absolutely right.

35:22 I have a friend that works for Google, does the same thing that I do.

35:26 And him and I were talking.

35:28 I have just the little version of MacBook Pro, and I wasn't going to wait for another one to come out.

35:36 But it has a lot of the components and a lot of the capacity that I need to do my works.

35:41 Instead of just putting your stuff on like AWS, and now you can run them locally, and it's extremely powerful.

35:47 So this is extremely good, especially M1.

35:51 The new stuff is quite neat.

35:53 It's seriously impressive, as Sam has said out there.

35:56 I totally agree.

35:57 Fair pressure.

35:57 Yeah.

35:58 Morla, anything else you want to throw out for people while you got the mic?

36:01 No, I just want to say thanks to you and Brian, right?

36:05 So again, I've been listening to you guys for a very long time, and I've come this far partly because I've been listening to you guys.

36:11 Just the encouragement.

36:12 I think you guys every day, every time I listen to you guys, you guys are talking to me, not to a large group of audience.

36:18 I think it's extremely helpful to see you guys be part of the community.

36:22 And shout out to Pi Bay in San Francisco.

36:24 Those guys are real cool.

36:26 And Michael, thanks for coming out there and talking to us.

36:28 Yeah, that was a great trip a few weeks ago.

36:30 That was a few weeks ago.

36:31 So it was really good.

36:31 So I want to thank you guys for the work that you guys do.

36:34 And we'll continue to listen to you guys and be part of the community.

36:38 Yeah, thanks.

36:39 Yeah, I really appreciate that.

36:40 Thank you.

36:40 It's a lot of times we put stuff out there and there's not a lot of feedback.

36:43 But you know, people are out there listening.

36:45 Then you meet folks and talk to them.

36:47 You're like, actually, it has an impact, which is really great.

36:50 You know, for me, it has a particular impact, right?

36:53 So like I took a journey and I am where I'm at today because, again, partly because of the work that you guys do.

36:59 I'm listening to you guys doing a lot of the research and following up on a lot of the topics that you guys have on the show.

37:05 So it's taken me a long way because this is because I listen to you guys a lot.

37:09 Thank you so much.

37:10 Nice.

37:11 All right, Brian, we ready for a joke?

37:13 Yeah.

37:13 To show up with a smile?

37:14 Well, I just wanted to comment that maybe the next version of MacBook Pro, you might have to charge it in the laundry room because that's the only one with a plug that's strong enough.

37:26 Yeah, if it gets a 240 volt.

37:28 Yeah, that's right.

37:28 Yeah.

37:31 But the thing is, it almost never runs at that, right?

37:34 It'll go for like 14, 15 hours.

37:36 It's only if you're doing like insane stuff.

37:38 And also, you can plug in three Thunderbolt USB 3 things and each one of those, it'll provide up to 15 watts of output from the laptop.

37:46 Oh, wow.

37:47 So I think it's also trying to pass.

37:49 Yeah, I think it's trying to pass through 45 watts.

37:52 So it needs a charger that can account for how much does the Mac need plus 45 more watts?

37:56 Right.

37:57 Because you plugged it into all these Thunderbolt thingies.

38:00 Okay.

38:00 Anyway, I've been trying to think about why it really needs someone that's so high.

38:04 Chris May is going to hook us up to like a level three DC fast charger.

38:10 Charge that thing up five minutes on the car.

38:12 All right.

38:14 So this one comes to us from the veritable XK CD.

38:20 And it talks to us about programming standards.

38:23 So how standards proliferate.

38:26 See AC chargers.

38:28 Very timely.

38:29 Character encodings.

38:30 Instant messaging.

38:31 And so on.

38:32 I'm thinking network protocols.

38:35 Remember, this is a follow on from the joke of what is soap?

38:40 And then rest.

38:41 And then rest.

38:42 What the heck was wrong with soap?

38:43 I know GPRC is better than rest.

38:46 Ah, the torture never ends.

38:48 Okay.

38:48 So this is a follow up from that.

38:49 And here is a man and woman developer saying, talking, says situation.

38:54 There are 14 competing standards.

38:56 14.

38:57 Ridiculous.

38:58 We need to develop one universal standard that covers everyone's use cases.

39:02 Yeah.

39:03 Soon.

39:03 Situation.

39:04 There are 15 competing standards.

39:06 Yeah.

39:09 Yeah.

39:10 Yeah.

39:10 Yeah.

39:10 The only thing going in the other direction is cellular standards.

39:14 They seem to be.

39:15 Oh, really?

39:16 Lessing.

39:16 So.

39:17 But Wi-Fi is going crazy.

39:19 But anyway, it's just one standard, but it comes out with a new version about every six months.

39:24 Good thing they don't bake those into hardware and chips and stuff.

39:27 Oh, wait.

39:28 I think they write.

39:30 That's a good thing they do.

39:31 I'd be out of business if they didn't.

39:32 Exactly.

39:33 You got to.

39:33 The testing never ends.

39:35 Fantastic.

39:35 Yeah.

39:36 Thanks, Michael.

39:37 Thanks, Morley.

39:38 This was a really fun episode.

39:39 Yep.

39:39 Thank you very much.

39:40 Thanks for the invite.

39:41 Appreciate it.

39:42 Thanks, everybody on the chat and on the stream for watching.

39:46 Bye.

39:46 Bye.

39:47 Bye.

39:47 Thanks for listening to Python Bytes.

39:49 Follow the show on Twitter via at Python Bytes.

39:52 That's Python Bytes as in B-Y-T-E-S.

39:55 Get the full show notes over at pythonbytes.fm.

39:58 If you have a news item we should cover, just visit pythonbytes.fm and click submit in the

40:03 nav bar.

40:03 We're always on the lookout for sharing something cool.

40:05 If you want to join us for the live recording, just visit the website and click live stream

40:10 to get notified of when our next episode goes live.

40:13 That's usually happening at noon Pacific on Wednesdays over at YouTube.

40:17 On behalf of myself and Brian Okken, this is Michael Kennedy.

40:21 Thank you for listening and sharing this podcast with your friends and colleagues.

Back to show page