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


Transcript #274: 12 Questions You Should Be Asking of Your Dependencies

Return to episode page view on github
Recorded on Tuesday, Mar 8, 2022.

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

00:05 This is episode 274 recorded March 8th, 2022.

00:10 I'm Michael Kennedy.

00:11 And I'm Brian Okken.

00:12 And I'm Anne Barolo.

00:14 Welcome Anne. It is so great to have you here.

00:16 It's going to be a lot of fun to talk about Python things with you and devices and maybe even space.

00:22 Who knows?

00:22 I'm glad to be here.

00:24 Thank you very much for inviting me.

00:26 Yeah, absolutely.

00:27 Before we get into our topics, just tell people a quick bit about yourself.

00:30 You've had a varied background and you've done a lot of interesting things.

00:34 I may be known in the Python community as the author of the book "Mate Getting Started with Adafruit Circuit Playground Express," which goes over CircuitPython. And I've done numerous tutorials and blog posts for Adafruit Industries, where I've been working for the past four years.

00:52 Prior to that, I had a 30 year career with the U.S.

00:56 Department of State as a diplomat and security engineer, reaching the level of the senior foreign service.

01:03 Wow.

01:04 Oh, neat.

01:04 Awesome.

01:05 Bet you have some stories to tell that you can't tell.

01:07 I have some I can and some I can't.

01:10 Indeed.

01:11 Indeed.

01:12 All right.

01:12 Well, welcome to the show.

01:13 It's nice to have you here.

01:14 Thank you.

01:14 So Brian, there's that old famous saying, programming is like riding a bike.

01:19 Is that how it goes?

01:20 What is that?

01:20 I've never heard that.

01:22 Oh, yeah, neither of I.

01:25 Tell us about your bike.

01:26 OK, so I'm not sure what the bike is for, but actually, it's a cool looking bike.

01:32 But anyway, what we're talking about is Adam Johnson's article, the well-maintained test, 12 questions for new dependencies.

01:41 And he's calling it the well-maintained test.

01:43 But I'm going to call it the Adam test.

01:44 I think I think the Adam test is better.

01:46 And anyway, he's referencing.

01:51 Do you remember Joel Spolsky's, the Joel test?

01:53 >> I remember Joel Spolsky.

01:56 >> Okay.

01:56 >> I don't remember the test though.

01:58 >> Okay. So he has this test and it's referenced in this blog post, but I'm not going to click over to it, but there's a link in here.

02:05 But it's essentially like trying to, it's a 12 question, question and answer thing of like yes and no questions about whether or not your software team is healthy.

02:16 It's interesting, a little bit dated, But it's an interesting read.

02:22 But that's way back from like the year 2000.

02:25 So before a lot of you were born.

02:27 But now we've got the Adam test and it's about whether or not you should pick up a dependency on your project.

02:36 So in there again, there are yes, no questions.

02:39 And there's 12 questions.

02:41 And it's kind of zoom in a little bit.

02:45 It's just questions about a project.

02:48 So let's just run through them.

02:50 Is it described as production ready?

02:53 And is there sufficient documentation?

02:56 Is there a change log?

02:57 Is someone responding to bug reports?

03:00 Are there sufficient tests?

03:01 That's a tough one actually to answer if you're from the outside.

03:04 But are the tests running on the latest Python version?

03:07 Are the tests running on the latest integration version?

03:10 So he says language and integration.

03:12 So for instance, is it running on the latest, is it running Python 3.10 in CI?

03:18 And is it running the latest Django version if it's a Django utility or pytest version if it's a pytest plugin or something?

03:25 Is there a CI configuration?

03:28 Is it running on CI?

03:30 Is it CI passing?

03:32 Does it seem relatively well used?

03:34 And there's ways to look for that with PyPI stats.

03:39 And then has there been a commit in the last year and has there been a release in the last year?

03:44 The 12th one is interesting, I think, because sometimes there have been commits, there are maintainers that are pushing to the mainline, but nobody's actually releasing to PyPI because the actual one person that has release privileges hasn't been doing that.

04:00 I'm not sure, I guess, what do you think?

04:04 He goes through more detail, but do you have any comments on this, either Michael or Ann?

04:09 - I'd like this, I mean, obviously, it's directly related to some of the work we've been doing at Adafruit.

04:19 And we're trying to make sure that we don't have bottlenecks.

04:24 Like, multiple people have authorization to do releases and merges and that type of thing.

04:33 And it would be rather unsettling if there was a package that was several years old and no releases, and that's where you start getting into problems.

04:45 - Sure, I totally agree.

04:46 Things can be done.

04:48 There can be a, like, here's the thing that parses CSS styles.

04:51 Like maybe that just doesn't need to be updated, but that's not the case for most things.

04:56 Here's a web framework.

04:57 It hasn't changed in four years.

04:59 That might make you nervous because the web has changed a lot in four years.

05:02 - And Python's changed.

05:03 So is it even, it just takes a little bit to you have to push to get, kick the CI and test on.

05:10 I guess you don't have to.

05:11 You can manually kick CI to run it on the latest Python version, - Yeah, one more area, and that might be multiple little additions, or it might be grouped into one that people understand as a group of things, but does it use modern language ideas and constructs?

05:28 So for example, does it use Python type hints or no?

05:32 Does, if it's something that is inherently talking to external systems or something like that, does it use async await, is there an async capability?

05:41 Right, or if I'm like, well, I really wanna use FastAPI and I have this database that would be awesome to talk to, but this thing in the middle that does the database part, there's no async version, well then I've thrown away, I cannot access that part of the new Python world, right?

05:54 And so those kinds of, I group that into, does it use modern Python ideas and features?

05:59 - Yeah, that one's a tough one, because sometimes a project will want to support older Python versions, so they can't really.

06:05 - Yes, exactly.

06:07 - One of the things Anne said that I wanted to highlight was I like these 12 questions to ask of my own projects, I mean, yes, it's for dependencies, but I also, these are good questions just to ask for your own project.

06:19 - How am I doing?

06:21 - How am I doing?

06:22 And I have this package that's kind of used by a handful of people or maybe a thousand people, but if I've not updated in the last couple of years, that's kind of lame.

06:32 I should just take a few hours and go check it out, push something up.

06:36 - Yeah, for sure.

06:37 All right, now that I see your list and know what you're talking about, I love it.

06:40 It's great.

06:41 I want to talk about abusing things.

06:42 Let's talk about StackAbuse.

06:44 - Okay.

06:44 - No, StackAbuse is just the blog from Stack Overflow.

06:47 But what I wanna talk about is validating email addresses.

06:53 So this might sound like a solved problem, right?

06:57 We've talked about Regex 101 and stuff like that.

07:00 And surely you can go, you can get some regular expression and apply it to an email address.

07:06 Now that may or may not be good.

07:09 There are so many little weird domains these days.

07:12 Like I just got a .tech domain that has four letters on the end.

07:17 And if your regex is like, does it go thing, @sign, something, .3 or two things?

07:25 Well, that fails.

07:26 I've had that email address come up and say, oh, you got to enter a valid email address.

07:29 Like this is a valid email address, you crummy regex from 2000.

07:33 You know what I mean?

07:35 So this one goes a little bit beyond that.

07:38 Like it does validate that kind of stuff that you're thinking about, right?

07:41 It does validate that like there's an @ sign and there's a domain at the end and those kinds of things.

07:48 But it also does a couple of other things that I think are worth considering.

07:52 That's kind of cool.

07:54 So for example, one of the things that it'll do, if I scroll down a little bit, is it will actually check that the domain is real.

08:03 So if you were to say, my email is something at blah, blah, blah, junk, junk, junk, just type in junk.

08:09 Like, no, no, no, there's no way that could be delivered.

08:12 So it's going to validate, like actually do a DNS lookup on the domain name for that.

08:17 Right, so it'll check on the internet that this is a real thing.

08:20 It also does some interesting things about normalization or canonicalization of the email.

08:27 So for example, there's different ways to represent the same thing in Unicode and stuff like that.

08:32 And you'll end up with a, here's the definitive way in which you should express this in your database so that you can check, have I seen this before?

08:39 Or things like that.

08:40 You could even get ASCII representations of it from what comes back.

08:45 So, pretty cool.

08:46 It'll do the check for deliverability, and then it also does that normalization plus the regex.

08:52 - Wow.

08:53 - Neat, right? - Yeah, great.

08:54 - Yeah, I mean, it's not gonna change the world, right?

08:57 We'll have to validate email addresses and whatnot, but putting just type equals email in an HTML form is not gonna tell you that, for example, the DNS exists and things like that.

09:09 So I think this is a cool sort of next level version and it's a Python package that runs on the server.

09:14 You just pip install it and then you call validate.

09:17 And of course it'll, you know, it needs to do the DNS lookup and stuff like that.

09:20 - I like it. - Cool.

09:22 Yeah, awesome.

09:23 Yeah, it's really easy to use.

09:25 So I think that that's a nice feature.

09:27 So let's--

09:29 And it's production ready and as a fairly recent release.

09:34 - Awesome, I'm glad you checked on it.

09:36 And before we switch over to Ann's first topic, John Sheehan out in the audience says, "For phone numbers, I had really good luck "with phone numbers, all one word, no spaces, "Python library." Oh, very cool.

09:48 Yeah, that has, I think phone numbers are more complicated than emails in the sense that like, they're different lengths and styles and all sorts of stuff.

09:55 - Well, I've lived in many places in the world and so many people do this US-centric phone number check and do not parse it for international members and it drives people crazy.

10:11 >> Yeah, I bet it does.

10:13 Cool, all right, well tell us about your first item.

10:14 >> Well, I was gonna talk about one of the main things I've been doing with Adafruit that's Python related and that's the Python and Microcontrollers newsletter.

10:25 We think this is the only newsletter focusing on Python on very small hardware devices.

10:33 And I started as editor about the time of the pandemic when priorities were switched.

10:41 And somebody said, well, I've got to do something else.

10:44 Here, it's yours.

10:45 OK.

10:46 So we currently have about 9,400 subscribers.

10:51 and it focuses mainly on the two flavors of Python that run on small devices on hardware, and that's CircuitPython and MicroPython.

11:02 When I say it, it's kind of obvious that the full CPython will not fit on a device with limited memory and capabilities.

11:15 So MicroPython was first developed in CircuitPython.

11:18 I'll talk about it later in the show.

11:20 that actually work on very small devices and provide a very Python experience in coding these as compared to C or assembly or some of the other ways in which people do it.

11:35 - Yeah.

11:36 - So this is obviously free and open source just like everything else Adafruit does and hopefully much of the Python world.

11:46 - Yeah, one of the real exciting things I've seen going on with you all is working to get CircuitPython and MicroPython more close together.

11:55 So it's kind of one world for the small Python things.

11:58 Sure. I mean, CircuitPython is a fork, but we bring in the upstream features of MicroPython, and we provide some compatibility through a library called Blinkus.

12:17 So on certain microcontrollers, you can take a MicroPython program and run it in CircuitPython.

12:23 But there's some differences that were chosen.

12:30 And again, I'll go over those in a bit.

12:33 But the two programs talk to each other.

12:36 It's a very friendly relationship.

12:38 Adafruit has provided support to MicroPython.

12:42 We consider it kind of a big happy family rather than the Hatfields and the McCoys.

12:48 If anybody's interested in our weekly newsletter, they can go to adafruitdaily.com and it was specifically chosen to be a different domain than Adafruit because there's no sharing of information between, you know, nothing behind the curtain even.

13:08 It's a totally separate website it's none of the data is used for advertising and.

13:16 All the things that one does when they sign up on the web it's it's pure and clean and it's easy to subscribe and unsubscribe there's no pressure to say oh do you really want to unsubscribe.

13:33 I've been going through this process of unsubscribing from a tremendous number of old newsletters that have just piled up.

13:40 And so many of them are like, type in your email address here and uncheck the four things you would like to unsubscribe to.

13:47 I'm like, you know, this is not stopping me.

13:49 We're typing this in and this is happening.

13:50 I'm out of here.

13:51 Yeah, that's good to hear.

13:52 Yeah.

13:53 No one wants to actually go to that much effort.

13:55 I've made, you know, just one click and you know, you're gone.

13:58 You can come back if you want to.

14:00 But we really encourage community involvement in this.

14:06 It's not Anne writing her own thoughts together and putting them down via GitHub to WordPress.

14:15 There are different ways in which people can contribute.

14:18 It's all done on GitHub.

14:21 So people can put an issue if they like, or actually a PR on the current document.

14:28 And I review those.

14:30 accept PRs for your newsletter? Sure. That's awesome. Why not? I mean, I've not had that many issues. We have some instructions on okay, if you're gonna put a image in, you know, make it a certain size and parameters. If you're gonna put a animated GIF, you know, kind of do it this way. Otherwise, you know, just kind of as long as it's kind of in the same format, I'll take it. Again, we try to be very GitHub-friendly. We love GitHub.

15:00 And again, all our stuff is open source on GitHub. So, you know, people can do whatever they wish. And we want to encourage communication. But, you know, if people don't want to use GitHub, they can email the information to cpnews@adafruit.com, or they can hashtag CircuitPython or MicroPython on say Twitter.

15:24 And I do, I go through and pick up things.

15:28 - Cool.

15:29 - Yeah, very cool.

15:30 Yeah, I subscribe to the newsletter.

15:32 - Thank you.

15:32 - Yeah, you bet.

15:33 I love the idea of a sort of direct community involvement.

15:37 Brian, we should have just put our show notes up beforehand and let people do PRs against that, I love it.

15:41 We just have like a Trello board.

15:43 - Well, I didn't put it up here, but one of the things we do when we tap CircuitPython, the phrase is code plus community.

15:52 And we have a pretty broad community on, again, like Twitter, a large Discord server, Reddit, Instagram, just wherever you might try to get information, we try to target copying it on there.

16:14 And--

16:15 - Yeah.

16:16 - And I think--

16:16 - I think Adafruit and CircuitPython or doing community correctly, or at least doing it a good way, because it's obvious.

16:24 And for Discord, we have a code of conduct that's plain to see.

16:29 For CircuitPython, it's very similar to the Discord one.

16:33 It's kind of the philosophy of do good things, be good.

16:40 Everybody get along.

16:43 We welcome good-hearted things to happen.

16:47 and for 99.9% of it, it works.

16:51 Because CircuitPython is not Adafruit.

16:55 We want CircuitPython to be much, much, much bigger than Adafruit as far as adoption and effort.

17:03 And again, that reflects over to MicroPython.

17:06 And the whole thing goes to the bigger Python community.

17:10 I mean, Guido van Rossum has tweeted and various things saying, Yes, he supports Python on small devices.

17:20 I mean, small devices to super computers.

17:23 I mean, it all works.

17:24 Yeah, that's awesome.

17:25 Yeah, very cool.

17:26 All right.

17:26 Well, people should check it out for sure.

17:28 Now, before we move on, I do want to talk about our sponsor for this week.

17:33 Microsoft for startups founders hub.

17:36 They're doing super cool stuff.

17:38 As someone who has started his own small business, it is a lot of work.

17:43 and there's a lot of uncertainty and knowing how to get help and having support of people who have experience is really, really valuable.

17:51 So starting business is hard.

17:53 They say that by some estimates, 90% of all the startups will go out of business in the first year, which is tough, but that's how it is.

18:00 With that in mind, Microsoft for Startups set out to understand what startups need to be successful and create a digital platform to help overcome those challenges.

18:08 And that's where they got their Founders Hub.

18:11 So Microsoft for Startups Founders Hub provides all founders at any stage with free resources to help them solve startup challenges.

18:18 You get technology benefits, access to expert guidance and skilled resources, mentorship, networking connections, and so much more.

18:27 So, and unlike a lot of other similar programs in the industry, it doesn't require startups to be investor backed or third party validated to participate.

18:36 Founders Hub is just open to everyone.

18:38 So what do you get?

18:39 You get, you can speed up your development with free access to GitHub and Microsoft Cloud resources that have a bunch of credits that unlock over time so you can grow without worrying about paying for stuff.

18:50 They also help startups innovate.

18:52 They're partnering with companies like OpenAI, an AI research and deployment company to get extra benefits through their partners as well.

19:00 So with the Founders Hub, it's not really about who you know.

19:03 You have this access to this mentorship network.

19:06 So you get access to a pool of hundreds of mentors across a range of disciplines, in areas like idea validation, fundraising, management and coaching, sales and marketing, and specific technical stress points.

19:17 I think that might be the most valuable honestly, is, hey, I need to talk to this person or somebody.

19:21 Is this a good idea?

19:22 Is this how I should be doing?

19:23 And so on.

19:24 So you can book a one-on-one meeting with mentors, many of whom are founders themselves.

19:28 So make your idea a reality today with critical support that you'll get from Microsoft for Startups Founders Hub.

19:35 During the program, visit pythonbytes.fm/foundershub, click the link in your show notes, and yeah, thanks Microsoft for supporting the show.

19:43 >> Nice.

19:43 >> Indeed. All right, Brian, you got the next one, right?

19:46 >> Yeah. I want to talk about Git a little bit.

19:50 I've been using Git personally for a long time and professionally for many years at work for version control, of course, but I've used others as well.

20:01 It's one of the interesting things about Git is you can do it, you can use it a lot of different ways and trips people up actually to start with.

20:10 This is interesting. There's an article called Get Organized, a Better Git Workflow.

20:16 I actually learned about it by listening to episode 480 of the Change Log which was talking about this workflow.

20:25 The idea, it really appeals to me.

20:28 I haven't tried it, but I'm going to try it out.

20:30 I'm going to go through the idea.

20:32 The idea is when you're working on a new project instead or some new code, you create a branch off of the master or main or whatever.

20:45 Then you just push up your work with simple comments for yourself or just work in progress comments is all.

20:54 Then when you're ready to do a PR or something, all of those commits are going to be in a sloppy format.

21:03 It's hard to review those.

21:05 But you, so what the proposal for this, and this is, who's the author of this?

21:11 Annie Sexton. Annie's workflow is once you're at that point, you're ready to do a PR, go ahead and do a get reset against origin main.

21:20 What that does is it keeps all of your changes that you've done, but it forgets all the history.

21:28 Then you can recommit in a logical order that makes sense for reviewing.

21:33 So you can do, I did clean up here.

21:38 I added this feature over here.

21:40 I fixed this bug over here.

21:42 And there's a comment in the article, which I totally agree with, is you can say, I'm gonna separate those into different PRs, but often that's disruptive to your workflow.

21:54 Often there's a few things you're doing.

21:56 You're cleaning up while you're coding.

21:58 - Brian, when I do that, I'm like, oh, I'm gonna check this in separately so I know that this is a special task that I'm gonna like isolate, and then I'm like, oh no, I just checked in part of it.

22:07 You know, like it's so easy to go, oh darn, I was doing these two things at the same time, and yeah, so yeah, I feel that.

22:13 - So some of the benefits of this are that it helps for big PRs.

22:18 So once you're done, you've got a pull request that if somebody looks at the individual commits in the PR, they're broken up into easy to review bits.

22:29 And I think that's lovely.

22:31 I definitely wouldn't do something like this for a one line change or a small change.

22:37 That's kind of overkill.

22:39 But for things that you're working on for a while, this is sort of a cool workflow to play with.

22:45 And I think I'm gonna try it out.

22:47 Looks neat.

22:48 - Yeah, this looks great.

22:48 I'm definitely gonna explore it as well, because I was just listening to a podcast where somebody was talking about like, oh yeah, I issued a PR to myself and then I accepted it.

22:57 And other people laughed, they're like, that's so weird.

22:59 Why would you do a PR to yourself?

23:00 But like these organizing ways of like, this is the whole feature or this is the whole thing that I did.

23:07 Like there's real value in having that as a, oh no, what changed across this?

23:11 I need to go back and compare or like know the totality of it and stuff.

23:14 I really like these organizing ideas.

23:16 So I'm definitely gonna look into it.

23:18 What do you think, Anne?

23:19 - I like it too.

23:20 My workflow and that of a couple of colleagues I can think of would benefit from that because some things get chaotic.

23:32 Oftentimes with Datafruit, you're working on something, you kind of get blocked, and then you go to something else.

23:39 It's very easy to say, "Okay, where am I and where did I leave off?" I think anything to help that.

23:47 - Wonderful. - Yeah, very cool.

23:49 I definitely use the feature branch, do a bunch of changes over there, PR these days, even if it's just I'm the only one who's gonna see it because it just helps me organize for sure.

23:58 All right, speaking of Git and organizing on all that thing, all those things, traditionally, if you want to issue a bug or track changes to CPython, you'd have to go over to bugs.python.org, I think it was.

24:14 And yet a long time ago, they moved the CPython source code to GitHub.

24:18 So it would be natural, like, well, if you're already there and you wanna do a PR against GitHub, wouldn't it be awesome if like the issue was there, you could say at issue 1,226,000, whatever it is, this solves that or this addresses that or something like that.

24:33 And so that's starting to happen.

24:34 And I believe that this is really one of the things that's being made possible by Luka Schlinga becoming the CPython core developer in residence 'cause he can take the time and actually focus on getting this done.

24:45 It might sound like, "Oh, you just copy the stuff from over in that system.

24:49 "And then you just create them over here." But there's stuff going on that like makes this a little bit tricky.

24:55 So if you look at the article I'm linking to by Lukasz, GitHub issues, migration is coming soon.

25:00 There's a bunch of stuff going on about testing and how long it takes.

25:05 Let me see if I wrote that down, like one of the actual duration.

25:11 So it was pretty mind blowing.

25:13 It was like, yeah, the migration is estimated to take anywhere from three to seven days of continuous tight loop import this over to their next, next, next.

25:24 And so some of the things they got to deal with is like, well, if it's a seven day gap, and the issue appears over there, but we haven't yet closed it out on the other side, well, people could be commenting on both ones, and you could get like, effectively merge conflicts, I guess you would think of them as in GitHub.

25:41 So pretty wild to think about how, how they're doing this. Should they start with the newest one? So people have immediate access to that? Or should they start with the oldest ones?

25:49 Because they're least likely to change. And it's, it's pretty interesting. They've compared it to to some other really, really large platforms that have made a similar change.

25:58 Like the LLVM project made a similar migration from Bugzilla, Gasp.

26:03 And it took them 21 days to do the import.

26:08 So yeah, there's a lot of stuff going on to get the CPython issues and conversation fully over to GitHub.

26:16 But thank you, Lukasz and team for doing this because yeah, there's a lot.

26:20 And if you look at the comments below, there's a ton of comments that have like some pretty interesting stuff if you want to look deep.

26:25 >> To be fair, some of the complexity here is because they're trying to do it without shutting people out.

26:31 Because one of the things you could do is you could turn off submissions or comments for a week and then just convert it all.

26:40 >> Yeah, exactly.

26:40 >> Yeah.

26:41 >> But then that stops conversation for a week.

26:45 >> I think the real challenge is it's difficult to turn off partial.

26:49 it's hard to go like this older quarter of issues, we're going to turn them off and then import them.

26:55 >> Yeah, but you can turn everything off.

26:57 You could just say.

26:57 >> Yeah, that's the problem. I think they don't want to turn it all off.

27:00 If they could do it in a more fine-grained way, I think that they would already be on it.

27:03 But yeah, there's a lot of conversation. That's a good point though.

27:07 >> It held off.

27:07 >> Are you excited to see GitHub issues for CPython over here where they belong next to the code?

27:14 >> I am. I already read this and put it on the newsletter.

27:19 It's all good to have it in one place.

27:22 I don't know if there's any nexus between Guido working for Microsoft who owns GitHub, but it's definite that where the code is and you have your discussion process integrated.

27:38 That actually gives the GitHub developers a way in which to look at which a large project, the workflow goes as far as things and they can make more modern optimizations to say, "Hey, this is hard." It was maybe hard in bugs.python.org.

28:03 We can make it a lot easier on GitHub, maybe not today, but with a couple of tweaks in the next release.

28:11 >> Yeah, absolutely. It's definitely going to do a stress test thing for them.

28:16 And you got the final one, the final one of our main topics.

28:19 Sure, I was going to talk a little bit, my in and out about MicroPython, CircuitPython, and GitHub, and we were just talking about is an important parcel in all of this.

28:32 That CPython just will not work currently.

28:36 I mean, somebody might someday say, "Okay, we'll slim down CPython." But for now, MicroPython, which was started as a Kickstarter by Damian George back in 2013, does a very good job of providing Python on small microcontroller boards, like a Raspberry Pi single board computer or a microcontroller board.

29:02 And microcontrollers are all around us.

29:05 There's one in this microphone and they're everywhere.

29:09 They're sprinkled like silicon dust.

29:12 MicroPython has some syntax that isn't quite the same as CPython in certain areas.

29:21 Adafruit, when looking at moving into an easy way to program microcontrollers, decided that MicroPython was a wonderful starting point, but they forked it to have some features which they wanted to focus on, which is perfectly fine because both are under MIT open source licenses, so there's no conflict as opposed to some other sharing licenses.

29:52 Why the fork? Well, three things.

29:57 CircuitPython boards are specifically made such that they have a USB port, and they work just like a thumb drive.

30:05 You plug it into a computer, PC, Mac, Linux, whatever, and it should show up as a thumb drive.

30:13 Very small one, but you can drag a text file with your source code onto it or off of it, and it just runs.

30:24 Immediately, once there's a change in the file system, it picks it up.

30:28 - Yeah, the programming model is super interesting, right?

30:31 Like, if there's a file called a certain thing in a certain location, it just boots and runs it top to bottom.

30:37 And if that file changes, it just reboots, right?

30:39 That's right.

30:39 The equivalent of reboot for a $5 microcontroller.

30:43 We recommend code.py.

30:46 And yeah, if it detects a change, then it just says, okay, I'm going to restart and do things over.

30:53 And it provides instant feedback, which a lot of people like the tried and true code in a framework compile fix errors and then upload it to some piece of hardware is not something that a lot of people understand in in 2022 whereas anybody can copy a file from one place to another And then they light up when they say hey it worked or or oh, I got an error message I need to yeah a little syntax. I'm learning python or something so Brandon out in the audience former guess here said I flashed my ESP 32 s to run micro Python and have a look back the special on ESP 32 Processors there's a framework by the the company that makes it and it's rather daunting What you might have to do?

31:50 Circuit Python or micro Python makes it very easy to think of it just as another piece of hardware rather than a specialized way in which one might have to code it.

32:03 Let's see, what else we got?

32:05 Oh, CircuitPython specifically wants to use CPython syntax whenever possible.

32:14 Because again, MicroPython has deviated a bit.

32:18 But we want as much CPython code to be mirrored over as possible.

32:25 And finally, make it easy to use and understand for beginners.

32:30 Pretty much most of the folks are there, so Power users can dig right in.

32:36 We recently added a SyncIO.

32:39 You were talking about it. Yeah.

32:41 MicroPython actually does asynchronous work a little better than CircuitPython.

32:46 It exposes some of the lower levels.

32:49 Again, we recommend if the Power users use that, but CircuitPython wants to come into that world also.

33:00 -Nice. -Yeah.

33:02 It also provides a lot of equipment abstraction.

33:06 There are currently 283 boards that are compatible with CircuitPython, and 87 single-board computers.

33:15 Now, Raspberry Pi lineup everybody knows about, but what about Orange Pi and Banana Pi, the Sony's presence, there are pie board and all those things.

33:27 Yeah.

33:27 that they run CPython just fine.

33:31 But if you want to hook up a specific sensor, you don't want to have to code down to the, register, level on, on shifting bits around 80 fruits already done that for a lot of hardware.

33:43 So you throw on the, some software called the blink abstraction layer.

33:48 and that interfaces between CPython on the small boards and CircuitPython code in the library.

33:54 And for the most part, it just works.

33:56 - Nice, yeah.

33:58 CircuitPython's great.

33:59 People who wanna get started with small devices should definitely, definitely check that out.

34:03 - And there's a lot of tutorials on the Adafruit Learning System and various websites around the internet of people who have tackled some of these interface changes.

34:15 and we encourage people to check things out, the tires.

34:20 - Cool, very nice.

34:22 All right, well, that's it for our main items, Brian.

34:24 - Oh, I just wanted a quick shout out.

34:26 - Got 30 minutes for this next one.

34:27 - 30 minutes.

34:28 No, I just thought that this is a really easy, quick blog post by Daniel Roy Greenfield that I wanted to plug 'cause it's a good idea.

34:36 30 minute rule.

34:37 So if you're working on a problem at work, and especially at work if you have colleagues, and you get stuck on the same problem for the half an hour, half an hour is the mark, you should ask for help, because maybe you're just spinning your wheels or wasting time.

34:53 I would also add in, maybe that's time to just get up and go get some coffee, go have some lunch.

34:58 - Absolutely.

34:59 - Walk around, and maybe you don't have the problem.

35:01 But yeah, it's a different number for different people, but just remember, don't get stuck for too long.

35:08 It's probably not you, it's you're just thinking about it wrong or something.

35:12 - There's Twitter, there's Discords, there's places you can go and ask for help and yeah.

35:17 Or even coworkers.

35:19 So I got two quick extras.

35:21 One, James wrote into us, remember I said, when you say Python 3, do you really need to go back and say, well, Python 3.7.2 and beyond is this thing I am talking, or just like, if it's an expired version of Python, do we really, you know, a non-supported out of date, like Python 3.2 or something, do you really need to explicitly not talk about it?

35:41 Well, James wrote in, said, You guys were discussing Python 3 to mean any current supported version rather than say 3.7 plus or similar.

35:51 In my world, that's a really bad idea.

35:52 There's still tons of people using unsupported versions of Python and they're not all invalid use cases.

35:57 For example, I'm one of the upstream maintainers at Cloud Admin.

36:00 Now it's only recently able to remove Python 3.5 in order to make 3.6 our minimum supported version, which will continue for a year.

36:07 The reason is that our main customers are downstream distro packages like Ubuntu and Red Hat and so on.

36:12 And it's not uncommon for software released into long-term support, LTS OS, to be supported for five to 10 years.

36:21 So that's a world that I don't live in, but I didn't really think about the LTS story of like, yeah, we're gonna support this for 10 years and it comes with this, so it's gotta keep getting that.

36:31 So yeah, that's a very valid point, James, and thanks for sharing your experience.

36:35 - Top of the list of jobs I don't want.

36:37 (both laughing)

36:39 - Is it 10 years old?

36:40 I can't change it?

36:41 Okay.

36:41 And then I was going to talk about Paul Cutler's new podcast, the circuit Python show.

36:47 If you're in a circuit Python, check it out.

36:49 He's really in the circuit Python and he and I have talked a lot about getting him set up on this podcast.

36:54 So congrats.

36:55 Happy to see that out there and I hear you're going to be on the show.

36:57 Is that right?

36:58 yes.

37:00 in a, in a upcoming episode, I will be on it.

37:04 you know, Paul is not affiliated with data fruit, no paid.

37:08 No, he has independent control.

37:10 his baby, but we love the fact that he's doing it. We've recommended people in the community that he might want to chat with and again, he's interviewing, you know, the odd Adafruit person, but and I mean odd. That there are many other people and I like what he's doing a lot. Yeah, this is the first episode. He's also got like a preview thing of like, what is this thing I'm doing? And it's good so far.

37:42 So today it's speaking of it's less pounder.

37:45 He works. He's done a lot in the UK.

37:48 He's working for Tom's hardware and he's done a lot with circuit Python. So it's wonderful. Speaking of podcasts, I just want to give a quick announcement, Brian, that we traditionally have not been on Spotify.

38:00 I now moved our stuff over to Spotify. So people want to listen on Spotify for Python bites. It is not during the dark side. We have joined the dark side. All right. That's it for all of our stuff, right? Are we ready for a joke?

38:12 Yeah, sure. It's you know, it's we're recording a Tuesday, March 8. Imagine that it is Friday and come into work. Has this ever happened to you? Me on Friday, I'll just stop here and pick up where I left off. Me on Monday. This is developer just staring like holding their head like what? What was I doing? Why did I not make a better note of this? Why I did not write this down.

38:36 What is happening?

38:37 >> Yeah, that's good.

38:39 >> We can all relate, right, Anne?

38:42 >> Definitely, isn't there?

38:43 >> So you got to give good whip comments to yourself when you commit last on Friday.

38:50 >> But Friday, you're trying to get out.

38:52 You're trying to start your weekend.

38:55 I mean, notes.

38:56 >> Exactly. This is the hangover though.

39:00 This is what you get.

39:01 >> I love it.

39:02 >> I do too. All right. Well, I love that Anne came to join and I I've been here with you, Brian, every week.

39:06 So thank you both.

39:07 - Yeah, and thanks everybody that was on the stream watching.

39:11 - Yep.

39:12 - Thank you. - Thank you.

39:13 - It's been a lot of fun.

39:14 I enjoyed it.

39:15 - Yeah, same, bye.

39:16 - Thanks for listening to Python Bytes.

39:18 Follow the show on Twitter via @pythonbytes.

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

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

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

39:32 We're always on the lookout for sharing something cool.

39:34 If you want to join us for the live recording, just visit the website and click live stream to get notified of when our next episode goes live.

39:42 That's usually happening at noon Pacific on Wednesdays over at YouTube.

39:46 On behalf of myself and Brian Okken, this is Michael Kennedy.

39:49 Thank you for listening and sharing this podcast with your friends and colleagues.

Back to show page