TRANSCRIÇÃO 🔗
WEBVTT
00:00:00.001 --> 00:00:04.120
Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to
00:00:04.120 --> 00:00:10.280
your earbuds. This is episode 187, recorded June 17th, 2020. I'm Michael Kennedy.
00:00:10.280 --> 00:00:11.620
And I am Brian Okken.
00:00:11.620 --> 00:00:16.320
And this episode is brought to you by us. There's a couple of things that we're offering that I think
00:00:16.320 --> 00:00:20.900
are going to be great for you. We'll talk more about that later. Right now, I want you to bring
00:00:20.900 --> 00:00:21.980
us back to our youth, Brian.
00:00:21.980 --> 00:00:23.980
Did you ever do the Lego Mindstorm thing?
00:00:23.980 --> 00:00:28.140
No, no. Lego was just bricks when I was a kid.
00:00:28.140 --> 00:00:34.000
Yeah, well, yeah. Okay. I love Legos. And I'm actually, I've got like three kits halfway done
00:00:34.000 --> 00:00:38.460
right now. One of them I've been working on for a long time. I should finish those. Anyway,
00:00:38.460 --> 00:00:44.640
because there's a new one I want to buy. It's not out yet, but Lego announced Mindstorm Robot Inventor.
00:00:44.640 --> 00:00:50.000
They've had different Mindstorm kits in the past for robotics, and they started in 2006,
00:00:50.000 --> 00:00:56.760
or at least on the Mindstorm series. NXT was in 2006. They did an NXT 2.0 in 2009.
00:00:57.120 --> 00:01:02.660
And then the EV3 was in 2013, and I was actually kind of disappointed with the EV3 because
00:01:02.660 --> 00:01:08.240
it was weird. It was like a post-apocalyptic thing going on. It was like punk rock robots or
00:01:08.240 --> 00:01:13.820
something. I don't know. Anyway, so I think we've got an NXT somewhere in the house. But the new Mindstorm
00:01:13.820 --> 00:01:19.360
Robot Inventor, they finally figured out that people are using these things to try to teach in STEM
00:01:19.360 --> 00:01:26.340
education and stuff. And so the new one, this is awesome. Drum roll. It supports Scratch and Python.
00:01:26.340 --> 00:01:33.560
So that is super awesome. It has instructions for five different robots that do lots of different
00:01:33.560 --> 00:01:39.920
kind of cool things like a car-like robot and an upright-like robot. And there's a bunch of sensors.
00:01:40.240 --> 00:01:45.900
The module that it has connects to six different input-output ports for sensors and motors.
00:01:45.900 --> 00:01:54.780
There's even a six-axis gyro and accelerometer, a 5x5 LED matrix. 5x5 is not much, but we can probably figure out.
00:01:54.780 --> 00:02:00.780
We can hack more. Color sensor and distance sensor, of course, and Python. So one of the other neat things
00:02:00.780 --> 00:02:06.400
about it is the other one, I'm not sure about the older ones, but they were programmable,
00:02:06.400 --> 00:02:13.200
of course, with Windows or Mac. But this one also is going to have the ability to program it via
00:02:13.200 --> 00:02:21.120
an Android or iOS tablet or smartphone and even some Fire OS. So like the Amazon Kindles,
00:02:21.120 --> 00:02:26.140
some of them might be able to be used, which is pretty awesome because even though this robot
00:02:26.140 --> 00:02:33.880
inventor is pretty expensive, if a school's helping to support it or something and a kid has a $50 tablet
00:02:33.880 --> 00:02:38.140
at home, hopefully that'll work. So that's neat. Yeah, this is really cool. And I think being able
00:02:38.140 --> 00:02:43.140
to program with a real programming language instead of a blocky type of programming language goes a long
00:02:43.140 --> 00:02:50.400
ways. I think people underestimate how much kids can do with some simple text versus, you know, like,
00:02:50.400 --> 00:02:55.000
well, it's got to be drag and dropy, so don't ever make syntax errors. And, you know,
00:02:55.020 --> 00:03:00.960
if you look at things like codecombat.com, kids go through these dungeons and they solve, like,
00:03:00.960 --> 00:03:07.140
challenges to open the door, make it across the bridge or whatever with code, but it's all typing
00:03:07.140 --> 00:03:15.840
Python. But the editor is so insanely aggressive, in a good way, aggressive with autocomplete. Like,
00:03:15.840 --> 00:03:22.060
if you type A, it'll try to autocomplete hero.attack and suggest arguments. I mean, it's like ridiculous.
00:03:22.700 --> 00:03:27.320
And in those sorts of scenarios, I feel like, you know, don't pull the punches. Like, give the kids
00:03:27.320 --> 00:03:32.720
a real experience. They'll adapt pretty quickly. I think people underestimate with the right tooling,
00:03:32.720 --> 00:03:35.180
what kids can do with a text language like Python.
00:03:35.180 --> 00:03:40.940
Yeah. And I, so I really hope, I think so too. And so it's exciting to have it. I know you can't,
00:03:40.980 --> 00:03:46.220
there were ways to put control of the EV3 with Python, but it was extra hacky ways and not obvious
00:03:46.220 --> 00:03:51.940
for people. And so hopefully having this supported. And I really hope that we get more of these sorts
00:03:51.940 --> 00:03:57.480
of robot inventor things coming out from Lego. Not every seven years. Could we update maybe every
00:03:57.480 --> 00:03:58.860
couple of years? That'd be awesome.
00:03:58.860 --> 00:04:00.980
Yeah, for sure. Technology changes fast.
00:04:01.140 --> 00:04:05.600
Yeah. And on a related note, I didn't do this as a full story, but I wanted to note,
00:04:05.600 --> 00:04:14.840
I also saw a project called Microscopy or Microscope Pi, maybe. It's an IBM open source project
00:04:14.840 --> 00:04:23.240
to build your own modular microscope using Raspberry Pis and Lego bricks and a little bit of 3D printing.
00:04:23.760 --> 00:04:28.900
And you can control it or like a motorized microscope, which is pretty awesome. So that's
00:04:28.900 --> 00:04:29.240
neat too.
00:04:29.240 --> 00:04:34.360
Yeah. Yeah. That's really cool. All right. Well, I have a theme that will become clear as I go
Load full transcript
through
00:04:34.360 --> 00:04:39.620
my items this week. I first somehow, somehow it just landed, lined up with all the items I picked
00:04:39.620 --> 00:04:43.920
in the same general area. So I want to start off by talking about this article from Kevin Markham
00:04:43.920 --> 00:04:49.920
from dataschool.io. And he put together, he's been putting together lots of cool steps and guides to
00:04:49.920 --> 00:04:54.840
help people get into stuff. His area is mostly data science, but obviously in the Python side.
00:04:54.840 --> 00:04:59.180
So he created this thing called a step-by-step guide to contributing to GitHub.
00:04:59.180 --> 00:04:59.640
Nice.
00:04:59.640 --> 00:05:05.720
Yeah. So if you're new and you haven't actually yet contributed to an open source project, it's like,
00:05:05.720 --> 00:05:11.760
here are the 17 steps in order. And some of them are obvious, like you have to have a GitHub account,
00:05:11.760 --> 00:05:18.340
you have to fork the project. Others are not as obvious. Like I always, whenever I fork something and
00:05:18.340 --> 00:05:23.480
I'm like, Oh, you know, I really want to get the changes from the thing I forked merged, you know,
00:05:23.480 --> 00:05:28.280
sort of synchronize my fork with the remote fork. I'm always like, what is that command again about
00:05:28.280 --> 00:05:33.500
like remote origins and for upstream, I got a set, you know what I'm like? And so having that stuff all
00:05:33.500 --> 00:05:38.880
laid out in a nice little, do this, then this, then this guide is helpful even just for a couple of
00:05:38.880 --> 00:05:42.880
those steps, if you've done it before. So, I'll just run you through the steps really quick.
00:05:42.880 --> 00:05:46.600
People can go and see the pictures and the graphics and the explanation. But,
00:05:46.600 --> 00:05:50.760
so I want to contribute to something. I think he contributed something back to scikit learn,
00:05:50.760 --> 00:05:54.820
but it could be any project, right? So you start by figuring out what project you want to contribute
00:05:54.820 --> 00:06:02.140
to. You fork it to your GitHub account and then you check it out. You clone it locally and load it up,
00:06:02.140 --> 00:06:07.620
make some changes. And then you make sure you have your origin remote pointed back to the thing on
00:06:07.620 --> 00:06:13.320
GitHub. And then the part I was just talking about, you can add an upstream remote, which allows you to
00:06:13.320 --> 00:06:19.060
say, give me the changes from the source repository to my forked version. You always want to get those,
00:06:19.060 --> 00:06:23.080
like maybe forked it a while ago, but now you want to make a change. So you want to grab the changes
00:06:23.080 --> 00:06:28.300
from the upstream, the original repository and bring it over, create a new branch, a feature branch for
00:06:28.300 --> 00:06:33.360
your changes. Cause you're going to use that for a PR, make changes, commit your changes, push it to your
00:06:33.360 --> 00:06:40.040
fork, create a PR by clicking the green create PR button, review the PR, have conversations around it, maybe make
00:06:40.040 --> 00:06:44.780
some more commits to your pull request. So it talks about like, if you submit a PR and they're like, that's great,
00:06:44.780 --> 00:06:50.040
but you need unit tests. How could you forget the unit tests? Please add those as well. How to do that. Right.
00:06:50.220 --> 00:06:56.680
It's a common story. I'm sure discuss it. And then once it's merged or I guess closed, even you could
00:06:56.680 --> 00:07:00.500
delete the branch, but especially if it's merged, you don't need it anymore. So delete your branch,
00:07:00.500 --> 00:07:06.180
synchronize again, your fork with the original project repository through the upstream link,
00:07:06.180 --> 00:07:13.080
because once they've accepted your changes, your main branch will be out of sync with there. So you
00:07:13.080 --> 00:07:18.100
want to do that. And then also as a nice little tips for contributing code section as well, with just
00:07:18.100 --> 00:07:22.880
some advice on how it goes. So the pictures and like here, type this for the step. I think this is
00:07:22.880 --> 00:07:28.300
pretty handy for a lot of folks. Yeah. People just need to do it. It seems overwhelming when you start
00:07:28.300 --> 00:07:33.980
because it seems like, oh my gosh, this seems like so over the top. And actually, so at work, when we
00:07:33.980 --> 00:07:41.200
switched from a different version control system to, to get, we started out with this sort of a model.
00:07:41.200 --> 00:07:47.320
This is not an uncommon model, even within not just open source, but other projects. Originally,
00:07:47.320 --> 00:07:51.140
I thought this is a lot of overkill. We don't really need forks and branches,
00:07:51.140 --> 00:07:56.800
but there's a lot of benefits to doing both. And you can just kind of get used to it. And it's not,
00:07:56.800 --> 00:08:01.040
it ends up being not that big of a deal. Yeah. One of the advantages for what you're talking about,
00:08:01.040 --> 00:08:07.000
like inside your company, obviously it's important for open source, probably mostly because you don't
00:08:07.000 --> 00:08:12.520
have commit rights. So you make changes to your thing and you say, accept my changes, right? But inside a
00:08:12.520 --> 00:08:16.700
company, everyone has commit rights for the most part to their project they're working on.
00:08:16.700 --> 00:08:22.040
But it bundles it up in documents. Like these are the changes to add this feature. These are the
00:08:22.040 --> 00:08:26.860
conversations around it. And here's how it got accepted, right? It's like a nice way to go beyond
00:08:26.860 --> 00:08:31.520
just like, here's a commit or a series of commits I did this week. I think some of them have to do with
00:08:31.520 --> 00:08:36.860
this scrum thing I said I would do. Yeah. One of the main reasons we kept the fork model in place is so
00:08:36.860 --> 00:08:43.080
that we can, if somebody accidentally pushes up a large executable or something that they shouldn't
00:08:43.080 --> 00:08:50.900
have committed in the first place, it's easier to kill a fork off than a branch of a project.
00:08:50.900 --> 00:08:53.920
I see. It's like a layer of insulation of mistakes.
00:08:53.920 --> 00:08:55.200
Yep. Yep. Definitely.
00:08:55.200 --> 00:09:02.320
Yeah. Cool. Well, before we get on to a new language, Python inspired language, I just wanted to talk about
00:09:02.320 --> 00:09:08.120
a couple of things you can do to support the show. Obviously, Brian and I are both doing things outside the
00:09:08.120 --> 00:09:13.400
podcast that we think contribute back to the community that if you want to support what we're doing, it would
00:09:13.400 --> 00:09:18.680
be great if you could check them out and consider them as you're learning Python things. So I have courses
00:09:18.680 --> 00:09:24.900
over at Talk Python Training. We have, I think, 170 hours of Python courses and probably a couple hundred hours
00:09:24.900 --> 00:09:30.980
of exercises for people to do over there. So if you're looking for courses or to learn stuff with Python in general,
00:09:30.980 --> 00:09:34.240
check out Talk Python Training. And Brian, you have some kind of book, I think.
00:09:34.240 --> 00:09:39.580
Yeah. So I think that anybody that wants to learn how to test better should pick up a copy of Python
00:09:39.580 --> 00:09:46.780
Testing with pytest. So the book that I wrote about pytest, it's not just, it kind of walks through all the
00:09:46.780 --> 00:09:52.920
different sorts of things you can do in the, with pytest, but also around testing a package project.
00:09:52.920 --> 00:09:58.000
And I think a lot of these carry over, even like switching databases and stuff, these things carry over
00:09:58.000 --> 00:10:03.680
for all sorts of types of projects. And I've gotten a lot of great feedback and I think it's a good
00:10:03.680 --> 00:10:04.660
thing for people to read.
00:10:04.660 --> 00:10:08.540
Yeah. Awesome. It's a great book. And both of those things are linked at the top of the show notes. So
00:10:08.540 --> 00:10:12.840
you all can just check it out in your podcast players. So I'm always fascinated with embedded Python
00:10:12.840 --> 00:10:18.520
Python and things like MicroPython and CircuitPython. And you've got something along these lines, right?
00:10:18.520 --> 00:10:23.860
Yes. I ran across this, a language called SNEK or SNEK, I think.
00:10:23.860 --> 00:10:24.200
SNEK.
00:10:24.200 --> 00:10:24.200
SNEK.
00:10:24.200 --> 00:10:34.320
So it's at SNEK.org. And it's a Python inspired language for embedded devices. But my first
00:10:34.320 --> 00:10:38.240
reaction is probably going to be yours is also, don't we already have that? Don't we already have
00:10:38.240 --> 00:10:39.280
MicroPython and-
00:10:39.280 --> 00:10:41.120
We already have two. I'm confused
why we have two.
00:10:41.120 --> 00:10:46.500
Yes. And CircuitPython. Well, actually, yeah, we've got lots. MicroPython and CircuitPython are
00:10:46.500 --> 00:10:52.920
the ones that we think about a lot. CircuitPython, of course, is focused around Adafruit, but also
00:10:52.920 --> 00:10:58.020
runs on lots of different other boards as well. But what about really small things? Even those,
00:10:58.020 --> 00:11:05.480
they run on these small chips, but there's smaller chips that you might want also. So if you only have
00:11:05.480 --> 00:11:11.980
a few kilobytes of Flash and RAM and you still want to run something, can you run Python? And that's
00:11:11.980 --> 00:11:18.360
where SNEK comes in. So it's, I mean, it really runs on small processors. Even one of the things
00:11:18.360 --> 00:11:25.600
it supports is the Lego EV3. So if you don't want to wait for the new robot inventor, you can run SNEK
00:11:25.600 --> 00:11:33.080
on your current EV3. So that's neat. But the smallness, its goal is it's not Python. So most SNEK
00:11:33.080 --> 00:11:40.040
programs will run in Python, but not the other way around. You can't run most Python in it. So it's got
00:11:40.040 --> 00:11:46.600
a limited language. But part of that is an educational purpose. So a smaller language footprint,
00:11:46.600 --> 00:11:52.360
as Python's adding more and more new features, it may be overwhelming for some people when they're
00:11:52.360 --> 00:11:57.480
just starting out. So having a smaller language is kind of a neat thing. But all of that learning can go
00:11:57.480 --> 00:12:03.880
towards your, if you're learning SNEK, you will can transfer that to Python projects later.
00:12:03.880 --> 00:12:09.160
Right. It's easy to level up to Python because it's, it's like going from C to C++. There's stuff to
00:12:09.160 --> 00:12:15.120
learn, but it'll kind of work. Yeah. Yep. There's even like a dedicated, a new board called the SNEK
00:12:15.120 --> 00:12:22.080
board that you can, that is available. It was through a crowdfunding process, but it runs both
00:12:22.080 --> 00:12:28.760
CircuitPython and SNEK. So yeah, one more thing to be able to run little small chips with Python-like
00:12:28.760 --> 00:12:34.340
language. So this is neat. Yeah. It's really cool. And the very, very small devices, I think it's going
00:12:34.340 --> 00:12:39.740
to mean, you know, Python can appear in more places, right? On incredibly small IoT things and whatnot.
00:12:39.740 --> 00:12:45.620
Like even if you have larger though, I like the idea of people saying Python is just kind of a great
00:12:45.620 --> 00:12:53.300
syntax. If we strip some of the things out that full Python has, it's still a usable language with a lot
00:12:53.300 --> 00:12:57.980
of it stripped out. So I think it's a good thing. Well, that whole idea, I mean that we could go on and
00:12:57.980 --> 00:13:03.240
on about that, but the whole idea is pretty interesting because as we see things like
Python moving to web
00:13:03.240 --> 00:13:08.900
assembly and running on the front end and talking about maybe having a Python on mobile,
00:13:08.900 --> 00:13:14.940
as well as the traditional CPython that we know and Python on chips, like having this concept of a
00:13:14.940 --> 00:13:21.640
smaller focused subset of Python that is universal. That's pretty interesting anyway. And it sounds like
00:13:21.640 --> 00:13:26.320
that's a little bit of the philosophy here. Yeah. It is interesting. What are the things we see like
00:13:26.320 --> 00:13:32.380
this coming up in the future? That's right. So we spoke about Git before and forks and using
00:13:32.380 --> 00:13:37.100
forks as insulation, but have you ever made a mistake with Git? Like every day? Yeah. Yeah.
00:13:37.100 --> 00:13:43.460
You're like, why did it, that thing get checked in? I told it to ignore it and now it's in there,
00:13:43.460 --> 00:13:51.440
right? Yeah. Stuff like that. So Andrew Simon sent over a link and recommended a zine, a little small
00:13:51.440 --> 00:14:00.600
book. A zine. A zine. Yeah. A zine by Julia Evans. She has a bunch in the programming and DevOps space.
00:14:00.600 --> 00:14:09.420
And she created one called, Oh Shit, Git. And it's like, I'm learning Git and oh my gosh, something's gone
00:14:09.420 --> 00:14:15.280
wrong. What have I done? It's cool, right? This is great. Yeah. So I want to be clear. This is a paid thing.
00:14:15.320 --> 00:14:19.940
It costs $10. We have no affiliation with it, but I just liked the idea of it. So I thought I would
00:14:19.940 --> 00:14:27.240
feature it. So basically it's this really short little zine book thing that explains Git fundamentals,
00:14:27.240 --> 00:14:33.340
like what's a Shaw and why don't you call it an SHA? I don't know. Stuff like that. Right. And then it
00:14:33.340 --> 00:14:38.980
goes into a bunch of how do I fix common mistakes? Like I committed to the wrong branch and other
00:14:38.980 --> 00:14:46.920
fundamental problems or I have a merge conflict or I committed the wrong file or I ignored a file,
00:14:46.920 --> 00:14:53.760
you know, and going back in time, right? Like we wrote the wrong code. The server is down. Everyone
00:14:53.760 --> 00:14:59.540
is yelling at me. I know it worked yesterday. How do I get the server or something to go back and say,
00:14:59.540 --> 00:15:04.260
just go back to the way it was. And we'll deal with it in a minute when things calm down. So like all
00:15:04.260 --> 00:15:08.480
those kinds of stuff. So I thought this was kind of a cool one. And people who are like getting started
00:15:08.480 --> 00:15:12.780
with Git, but they're, you know, they run into these things and it's a big deal. It's like,
00:15:12.780 --> 00:15:18.400
oh no, it's a merge conflict. Now what? I'm stuck. Right. Or like I said, committed to the wrong file
00:15:18.400 --> 00:15:22.320
or to the wrong branch or whatnot. I think this would be pretty helpful for folks.
00:15:22.320 --> 00:15:29.600
I love that the titles of the different sections are the thing that went wrong. Like I committed to
00:15:29.600 --> 00:15:34.420
the wrong branch. Exactly. Yeah. I tried to run a diff and nothing happened. I've a merge conflict.
00:15:34.420 --> 00:15:38.320
I want to split my commit into two commits. I want to undo something, five commits.
00:15:38.380 --> 00:15:39.200
And so on.
00:15:39.200 --> 00:15:46.580
I got to make sure that this isn't a violation of my human resources things to buy this for
00:15:46.580 --> 00:15:51.260
all of my employees, because I think everybody needs this. These things are great.
00:15:51.260 --> 00:15:55.680
Yeah. Just put a little bit of black electrical tape on top of that middle word and then you
00:15:55.680 --> 00:15:56.300
can hand it out.
00:15:56.300 --> 00:16:01.740
It's a PDF. Maybe I, you know, get by five licenses and printed it five times.
00:16:01.740 --> 00:16:07.060
Yeah, no, it's pretty good. It's like, I did something terribly wrong. Does Git have a time
00:16:07.060 --> 00:16:12.060
machine? Yeah. So, it sounds interesting. Thanks Andrew for recommending it and Julia.
00:16:12.060 --> 00:16:15.980
Cool work on the creative way to address Git issues.
00:16:15.980 --> 00:16:16.920
Yeah, definitely.
00:16:16.920 --> 00:16:20.820
So, what's the story with versioning? You guys got a beef with it?
00:16:22.040 --> 00:16:27.820
Well, you know, I've kind of always had a beef with it, but I didn't really think about it. So Brett Cannon
00:16:27.820 --> 00:16:33.140
actually asked a question on, it was interesting. He wrote an article that I read
00:16:33.140 --> 00:16:38.140
recently called, why I don't like Semver anymore. Semver being semantic versioning.
00:16:38.540 --> 00:16:47.680
That's the 2.1.0 style. Yeah. And like, like, as opposed to calendar versioning or, or, or what we
00:16:47.680 --> 00:16:53.720
were, we talked about this earlier of zero ver. Zero ver is like a, a, even more negative version of
00:16:53.720 --> 00:17:00.580
Semver. Yeah. So the interesting question is it's not straightforward as to what, so there's often,
00:17:00.580 --> 00:17:07.520
it's like the first digit, like if we say X dot Y dot Z X is some major thing. So like some crazy new
00:17:07.520 --> 00:17:12.700
feature, it's either a crazy new feature or it's a incompatibility with the old one. Like we're going
00:17:12.700 --> 00:17:17.020
to change the interface. Right. When Django went from one dot something to two dot O they dropped support
00:17:17.020 --> 00:17:23.840
for Python two, for example. And that was indicated partly there. Yeah, exactly. So what constitutes an
00:17:23.840 --> 00:17:29.760
interface break? And that's what a lot of people think about. Well, what about if you add a
00:17:29.760 --> 00:17:35.660
deprecation warning to something that you're planning on taking out in the next version?
00:17:35.660 --> 00:17:43.300
Is that adding an extra warning? Is that a
major thing or a bug fix or a minor thing? And that's
00:17:43.300 --> 00:17:48.260
part of the discussion of most of us, I think would think that the, maybe that's a, either that's just
00:17:48.260 --> 00:17:53.360
a bug fix or a minor thing. That's not a major thing. Right. And to me, it makes, it makes like no
00:17:53.360 --> 00:17:58.740
different, there's no new functionality. Nothing stopped working. That seems like a super minor,
00:17:58.940 --> 00:18:04.680
like it should change the very last number because it doesn't even add or change a functionality.
00:18:04.680 --> 00:18:10.920
But it is adding a warning. So if I have come, if I'm, I'm running Python with, with the flag that
00:18:10.920 --> 00:18:17.060
turns all warnings into errors, or if I'm running my tests such that, that, and that's like normal with
00:18:17.060 --> 00:18:23.260
running tests is you turn all your warnings into failures so that you find them. Now you've, you
00:18:23.260 --> 00:18:29.420
really did change the interface because I, to get rid of that warning, I have to go and either I need to
00:18:29.420 --> 00:18:37.260
change to not, I need to not look at that warning or I need to change my use of that thing. So it is
00:18:37.260 --> 00:18:42.420
kind of an interface break. Yeah, for sure. So that's part of his discussion is that it's not really
00:18:42.420 --> 00:18:48.540
straightforward to say that what is a major, minor, or micro change, what that really is. It's a gray area.
00:18:48.940 --> 00:18:56.600
There's discussion. And then also really what the observation that the three digits kind of makes
00:18:56.600 --> 00:19:03.120
sense if you are maintaining three or more branches. So if you're maintaining a current branch, plus the
00:19:03.120 --> 00:19:08.640
features you're working on the next one, that's a, another branch, plus you're doing bug fixes to the
00:19:08.640 --> 00:19:16.360
current production one. So you've got like development going on in one branch and fixes in the other one.
00:19:16.360 --> 00:19:20.540
And then, you know, minor things going on, you might have like even more branches that you're
00:19:20.540 --> 00:19:26.060
maintaining at once for a large project with lots of people on it. That totally makes sense for small
00:19:26.060 --> 00:19:30.780
projects and side projects and things where you're really, you're not maintaining a bunch of stuff.
00:19:30.780 --> 00:19:36.300
You're it's one branch and you fix bugs. You're not planning on adding new features or if you are,
00:19:36.300 --> 00:19:41.980
you know, well, I don't know. It's so infrequent that doesn't matter. Maybe two digits is enough,
00:19:41.980 --> 00:19:46.340
just X dot Y, or maybe just one digit, because there's a whole, one of the reasons why a whole
00:19:46.340 --> 00:19:51.540
bunch of people are at zero for is they're trying to not be backwards incompatible and they're,
00:19:51.540 --> 00:19:55.960
and they're not going to add any major new features. It's a simple tool or something.
00:19:55.960 --> 00:20:03.560
The other thing Brett brings up is basically you shouldn't depend on this stuff because it's nebulous
00:20:03.560 --> 00:20:10.640
and wishy-washy. You shouldn't depend on the numbering semantic versioning to see whether or
00:20:10.640 --> 00:20:16.200
not what versions of a new of a dependent project you're using. You should rely on continuous integration
00:20:16.200 --> 00:20:22.980
and testing. So do a minimum version for the project you're using, but don't do a max and use your
00:20:22.980 --> 00:20:28.060
testing to find out if there's any problems. Always do the latest one in that the version doesn't
00:20:28.060 --> 00:20:34.060
really matter. You're going to keep ahead. And if your CI breaks, then you might have to pin your dependency
00:20:34.060 --> 00:20:40.880
to earlier one. But also you should always pin your dependencies to specific versions and just use your
00:20:40.880 --> 00:20:43.840
CI and testing system to see if you can move forward.
00:20:43.840 --> 00:20:47.760
Yeah, absolutely. And if you use something like depend a bot or pi up or something like that,
00:20:47.760 --> 00:20:54.140
it'll automatically look at your repository, increment those versions, run some CI if you have it set up,
00:20:54.140 --> 00:20:59.540
and you'll know if it's acceptable or not. So you can get the system to tell you, hey, you should
00:20:59.540 --> 00:21:02.880
update this pinned version and click here to allow it.
00:21:02.880 --> 00:21:08.300
Yeah, I love systems like that. And it totally makes it so you can review it and go, yeah, that's good.
00:21:08.300 --> 00:21:13.120
Often those just show up as a merge request that you just accept, right?
00:21:13.120 --> 00:21:14.320
That's right. Yeah, very nice.
00:21:14.320 --> 00:21:19.980
Yeah. So a good discussion about thinking about whether semantic versioning really is appropriate
00:21:19.980 --> 00:21:20.900
for your project.
00:21:20.900 --> 00:21:24.760
Yeah. So do you remember what the recommendation was? I scanned it and I didn't see like a super
00:21:24.760 --> 00:21:26.600
clear like do this instead.
00:21:26.600 --> 00:21:33.200
No, the end, there's a kind of a summary that I kind of like cribbed and put in our show notes.
00:21:33.200 --> 00:21:40.580
Essentially, it's the try to pin the lowest version or pin your versions, of course, but have a low end,
00:21:40.580 --> 00:21:47.100
but don't have an upper end and just test. As for using dependencies for your own version,
00:21:47.100 --> 00:21:52.940
it really was, it should match your branching strategy really. So if you're really not supporting
00:21:52.940 --> 00:21:59.060
three branches, three digit semantic versioning doesn't make sense. You can do two digit or one
00:21:59.060 --> 00:21:59.840
digit versioning.
00:21:59.840 --> 00:22:04.040
Yeah. Yeah. Pretty cool. All right. Carrying on with my theme, you want to talk about Git?
00:22:04.040
--> 00:22:07.400
Oh, we haven't covered Git for a while, so that'd be good.
00:22:07.400 --> 00:22:16.440
Yeah, for sure. So there's famous, like, you know, rock star famous, Julie Roberts movie star famous.
00:22:16.440 --> 00:22:22.120
There's like maybe a step down, but still pretty cool. There's geek famous, right? Like on the
00:22:22.120 --> 00:22:25.700
regular street, nobody would recognize you, but at a conference, you're kind of cool. I think probably
00:22:25.700 --> 00:22:28.800
Gita Van Rossum definitely fits geek famous, right?
00:22:28.800 --> 00:22:29.080
Yeah.
00:22:29.140 --> 00:22:30.980
And then apparently there's Git famous.
00:22:30.980 --> 00:22:36.100
Oh, is that, is that when you have like your pixelated face as your Git history?
00:22:36.100 --> 00:22:41.020
It's really complicated, but if you time it just right, you can, yeah. No. So there's this project,
00:22:41.020 --> 00:22:45.300
Bjorn Olson sent this over and said, Hey, you should check this out. It's, it's quick and fun and kind of
00:22:45.300 --> 00:22:51.720
useful. If you want to go to a project and answer the question, who kind of created this or who mostly
00:22:51.720 --> 00:22:56.540
worked on this? And I have this all the time. When I go look at these projects that we're
00:22:56.540 --> 00:23:00.980
researching and covering, maybe I want to talk to the person about a question or something. I'm like,
00:23:00.980 --> 00:23:04.980
all right, well, if I can go to the contribution thing and GitHub, maybe it'll show me, but that's
00:23:04.980 --> 00:23:09.720
more of an over time and who's recently worked on it and stuff. So it's not super good. And if you're
00:23:09.720 --> 00:23:15.480
not on GitHub, then obviously it doesn't help. So there's a thing called get fame, which is a Python
00:23:15.480 --> 00:23:21.540
library. And the idea is you pip install get fame and then associate it with get, you have a new
00:23:21.540 --> 00:23:26.580
command. You say, get space fame and it will go through and it'll like, look at all the commits
00:23:26.580 --> 00:23:31.700
and all the people and how many lines of code were changes, changed and files and whatnot by everyone.
00:23:31.700 --> 00:23:36.720
And then it'll give you a ranking of these are all the people who've contributed and here's how many
00:23:36.720 --> 00:23:42.340
files they've changed, how many lines of code they've changed and so on. It's pretty cool. And it sorts them
00:23:42.340 --> 00:23:49.080
by most popular, most largest contribution downward. That's cool. Yeah. And it's super easy. It's super easy.
00:23:49.360 --> 00:23:56.260
Like pip install, get fame, get config and set an alias to fame to run the Python command. And they just type
00:23:56.260 --> 00:24:03.040
get fame and it just goes and it uses the TQDM. I think that might be the right order. Progress bar,
00:24:03.040 --> 00:24:09.280
you know, to show you its progress. I ran it on a somewhat large, somewhat large project,
00:24:09.440 --> 00:24:15.580
small to medium project, I guess, in terms of regular software. And it found 596 commits and it
00:24:15.580 --> 00:24:20.360
took seven seconds to do that. And it processed 76 files a second. That's pretty good.
00:24:20.360 --> 00:24:26.080
Yeah. I totally like the idea, especially around a very useful for us when we want to talk to one of
00:24:26.080 --> 00:24:28.460
the people that's really involved with it. Yeah, exactly.
00:24:28.720 --> 00:24:34.780
Yeah. And like you said, often some of the most recent ones are valued, of course, but not major
00:24:34.780 --> 00:24:39.080
changes to the library or something. Right. Exactly. So it's a little bit hard to know. So this kind of
00:24:39.080 --> 00:24:43.540
gives you the historical view of who's really contributed to this project and how many lines
00:24:43.540 --> 00:24:47.720
of code have they changed and so on, which is not always a great measure, but you know, it's still
00:24:47.720 --> 00:24:53.240
interesting. Yeah. I totally missed the, my guess. I, my guess was it was an alias to rewrite get
00:24:53.240 --> 00:25:00.260
blame because blame is so, I don't know why they named it that. I know. credit, maybe get credit.
00:25:00.260 --> 00:25:06.280
It should be called credit. There's positive and negative credit, right? Yeah. Yeah. So it basically
00:25:06.280 --> 00:25:12.760
runs get blame over and over and over on each file and then analyzes the file, the result of get blame,
00:25:12.760 --> 00:25:16.920
and then builds out this, this history based on that. That's pretty cool. Yeah. Yeah. Pretty cool.
00:25:16.920 --> 00:25:21.440
super easy to use if you're into it. And, that wraps up all of our items, Brian,
00:25:21.440 --> 00:25:25.900
got any extras you want to share with folks? I wanted to thank everybody that's supporting
00:25:25.900 --> 00:25:32.300
the show through Patreon because I went in and took a peek today and we have 26 supporters. And if you
00:25:32.300 --> 00:25:37.900
want to, we have links in the show notes and also links on our site, if you want to help out the show
00:25:37.900 --> 00:25:44.240
through Patreon, but you can also go to patreon.com slash Python bites and many people donate a dollar a
00:25:44.240 --> 00:25:49.440
month. And that is awesome. Thank you. And if you go above and beyond and contribute a little bit more,
00:25:49.440 --> 00:25:56.320
so I wanted to do a special shout out to those that are contributing more than a buck. So thank you,
00:25:56.320 --> 00:26:04.400
Brent Kintzer, Brian Cochran, Bert Raymakers, Richard Stonehouse, and Jeff Kiefer all donating more than a
00:26:04.400 --> 00:26:08.980
dollar. So thank you very much. Awesome. Yeah. Thank you guys. That really does help support cover,
00:26:09.040 --> 00:26:15.720
things like editing and transcripts and all that kind of stuff. Now I have a quick follow-up for,
00:26:15.720 --> 00:26:22.560
last time we spoke about dunder py packages and
things like that to where you could set up,
00:26:22.560 --> 00:26:27.040
uh, I think it was pyflow we were speaking of, where if you interact with Python through pyflow,
00:26:27.040 --> 00:26:35.480
basically it will use this node JS like behavior that is really still coming hopefully in PEP 5.8.2.
00:26:35.980 --> 00:26:40.020
So after that, someone, it was Paul Everitt who sent over a message and said, Hey,
00:26:40.020 --> 00:26:46.360
did you know Kushal Das, who is one of the folks core developers working on this whole idea has a
00:26:46.360 --> 00:26:52.480
little Python example, just a single Python file that you can use to basically implement this. And it
00:26:52.480 --> 00:26:57.380
says, this would probably be really great for like trainers and students and teachers and stuff like
00:26:57.380 --> 00:27:03.700
that to kind of sidestep the whole virtual environment story. Okay. That's cool. I got to try this out.
00:27:03.700 --> 00:27:09.240
Yeah. So a quick little link to a working version. That's not just a whole overhaul like pyflow,
00:27:09.240 --> 00:27:14.580
but a simpler thing. All right. Now this last one, Brian, this joke here, you know, wrap it up with a joke
00:27:14.580 --> 00:27:18.880
as always, you've got to open it up because it's an animated GIF. Okay. First, let me ask you what shell
00:27:18.880 --> 00:27:26.340
to use on your Mac. Bash. Bash. Okay. So I'm a, oh my Z shell kind of guy because I love like the history and
00:27:26.340 --> 00:27:30.860
it keeps a really good track of all the stuff I've done. And sometimes I'll type like one or two letters.
00:27:30.860 --> 00:27:34.560
I'll try to go back and I'm like, no, no, that's not, instead of just typing out the stupid thing,
00:27:34.560 --> 00:27:41.200
I'll just go back and back. And so here's like this clear, like super bearded guy. Who's some kind
00:27:41.200 --> 00:27:47.120
of sysad man, Linux exaggerated person, I guess you would say. And it's an animated GIF, right? The guy's
00:27:47.120 --> 00:27:51.100
just clicking his finger, clicking his finger up, up, up, up, up, up, up, up, up. Shows him doing that,
00:27:51.100 --> 00:27:54.880
doing it some more. Now he's got a drink. He's clicking on, he's drinking his drink,
00:27:55.520 --> 00:27:59.660
clicking up. And then finally, he's so excited. Oh, finally. What does he say?
00:27:59.660 --> 00:28:03.040
I knew I had that some, that LS somewhere in my history.
00:28:03.040 --> 00:28:07.820
And eventually it just says, yeah, LS, right? He's up arrowed until like forever to just
00:28:07.820 --> 00:28:09.600
soon enough to type LS.
00:28:09.600 --> 00:28:10.660
Oh man.
00:28:10.660 --> 00:28:11.440
Have you ever been there?
00:28:11.440 --> 00:28:14.960
No. Cause I, what kind of key binding? Do you use VI key bindings?
00:28:14.960 --> 00:28:15.260
No.
00:28:15.260 --> 00:28:15.700
Okay.
00:28:15.700 --> 00:28:17.760
Do you like a backward search or something like that?
00:28:17.760 --> 00:28:21.200
Yeah. You can just search through your history to find the, find them.
00:28:21.400 --> 00:28:27.000
But then you have to press more than just the up arrow. Anyway, people, this has got a cool,
00:28:27.000 --> 00:28:33.140
a cool little animation cartoon thing. So I just linked over to comicstrip.com where,
00:28:33.140 --> 00:28:36.180
where the title is definitely not lazy.
00:28:36.180 --> 00:28:41.780
Yeah, definitely. You know, I was thinking about it. I don't even remember the key sequence to do
00:28:41.780 --> 00:28:46.780
the searching. I would have to do it. I just, it's one of those built in muscle memory things now.
00:28:46.780 --> 00:28:50.060
So that's right. Yeah. I was trying to remember it today and I couldn't remember it. I'm like,
00:28:50.060 --> 00:28:55.560
whatever, up arrow, up arrow, up arrow. So yeah, pretty funny. All right. Well,
00:28:55.560 --> 00:28:59.340
thanks for bringing all these items and sharing with everyone. Great to chat with you as always.
00:28:59.340 --> 00:29:00.100
Thank you. Bye.
00:29:00.100 --> 00:29:05.480
Thank you for listening to Python Bytes. Follow the show on Twitter via at Python Bytes. That's
00:29:05.480 --> 00:29:12.240
Python Bytes as in B-Y-T-E-S. And get the full show notes at pythonbytes.fm. If you have a news item
00:29:12.240 --> 00:29:16.940
you want featured, just visit pythonbytes.fm and send it our way. We're always on the lookout for
00:29:16.940 --> 00:29:21.160
sharing something cool. On behalf of myself and Brian Okken, this is Michael Kennedy.
00:29:21.160 --> 00:29:24.600
Thank you for listening and sharing this podcast with your friends and colleagues.