WEBVTT

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

00:00:04.500 --> 00:00:11.280
your earbuds. This is episode 186, recorded June 10th, 2020. And I'm Brian Okken.

00:00:11.280 --> 00:00:12.160
And I'm Michael Kennedy.

00:00:12.160 --> 00:00:17.460
And this episode is actually brought to you by us. And we'll talk more about some of the ways

00:00:17.460 --> 00:00:23.320
you can support myself and Michael a little later in the show. But first, let's side table that for

00:00:23.320 --> 00:00:23.820
a little bit.

00:00:23.820 --> 00:00:29.340
Side table it. Yeah, let's put it to the side and talk about side table. Yeah, so side table

00:00:29.340 --> 00:00:35.880
is something that I noticed as new project from Chris Moffitt. And longtime listeners of the show

00:00:35.880 --> 00:00:42.700
will definitely know that I'm inspired by visuals. And this is one of those that's really nice, right?

00:00:42.700 --> 00:00:49.700
Like not long ago, when Guido was on the show, we talked about a missing number of visualizer for

00:00:49.700 --> 00:00:55.100
pandas. So you could have a quick view of just like, I got this data, I just need to really quickly see

00:00:55.100 --> 00:00:58.380
kind of what it looks like what's missing correlate missing elements and whatnot.

00:00:58.680 --> 00:01:04.860
And so side table is in this general zen of things. It's like, I've loaded up some data,

00:01:04.860 --> 00:01:08.920
I just want to quickly ask some questions and get a sense of what's going on. Like,

00:01:08.920 --> 00:01:13.040
I've got a pandas data frame. And I want to be able to say, you know, can you just break this down by

00:01:13.040 --> 00:01:17.640
like, show me the top 20% of this and then group the other stuff into just like an other category.

00:01:18.220 --> 00:01:24.220
Also, instead of just getting like a plain text output, you get a cool, like alternating row color,

00:01:24.220 --> 00:01:33.780
nice table with extra information, and whatnot. And it's usually something really, really simple. Like, I could go to the data frame and say,

00:01:33.780 --> 00:01:38.680
just give me the frequency of state and just, you know, group it by that or something. And it's,

00:01:38.900 --> 00:01:54.540
it does a group on those and a whole bunch of cool stuff. So really, really neat visualization. There's a picture in the show notes that shows you without it and with it. And given that the nicer version requires even less typing than the not nice version, I kind of like it.

00:01:54.820 --> 00:02:02.100
Yeah, and just out of the box, having just like the alternating gray and white stripes is good.

00:02:02.100 --> 00:02:18.540
Yeah, absolutely. So basically, all you have to do is a pip install, of course, but then import side table, and it adds an STB functionality to data frames to panda data frames. And then you can ask it questions like frequency. There's other stuff that you can also ask. There's like a bunch of different functionality there.

00:02:18.740 --> 00:02:36.400
So really nice for exploring new data sets. And it's basically a supercharged version of pandas value counts with a little crosstab mixed in. So yeah, it's easy to use. And if you're working with pandas, especially in Jupyter context, you know, that's really where this makes sense. Give it a shot. I think it looks great.

00:02:36.400 --> 00:02:37.000
Does it look good?

00:02:37.000 --> 00:02:37.500
Good job, Chris.

00:02:37.500 --> 00:02:38.500
Yeah, and I

00:02:38.500 --> 00:02:39.080
Yeah, go ahead.

00:02:39.080 --> 00:02:44.200
No, I didn't. I totally didn't even intend to do another table one back to back. But

00:02:44.200 --> 00:02:46.800
We're kicking it off with all the tables. Yeah, which one you got here?

00:02:46.800 --> 00:03:14.660
So this was a suggestion from Tom McDermott. And for the tabulate package, this is not for it's not intended for Jupyter stuff. It's intended for just standard out sort of things. So you want to pretty print a tabular data in Python for command line utility. Actually, I've been using this for years. I was like, I'm sure we've covered this. And I looked it up. And I don't think we have or at least I can't find it.

00:03:14.660 --> 00:03:30.080
I don't remember us covering either. And it's really sweet. It's like, it generates nice formatted tables, but in ASCII. So like before I said, you know, side tables awesome, if you're going to be doing this within Jupyter. But this is like if you're doing it within just a terminal command line app.

00:03:30.080 --> 00:03:46.060
By default, you've got a list of lists or a list of tuples or something to represent the rows. And you just want to print it with tabulate. It just does it automatically. But you can also, I usually use it with headers. So you pass in the headers separate.

00:03:46.060 --> 00:04:07.220
So header information. And by default, it just prints stuff out with prints of headers and then dashed lines and then your columns underneath. But it also like spaces it correctly because that mean actually that trying to get that right by yourself by hand is just a pain to try to figure out how wide things are supposed to be and whatever.

00:04:07.820 --> 00:04:09.760
So this just does it. And it's great.

00:04:09.760 --> 00:04:19.060
Not only does it do it by text, like the example that you have in the show notes really illustrates like the nuance here. So it's got a list of planets, their radius and masses.

00:04:19.980 --> 00:04:36.840
And for the sun, it has it in scientific notation like 1.8, 1.989 times 10 to the ninth. And then for the other ones, it's like 5,973.6. It aligns the decimal places, not all to the right. I mean, it's glorious.

00:04:36.840 --> 00:04:42.780
Yeah, the alignment is neat. I really appreciate that. So you have control over some of your number formatting and your alignment.

00:04:42.940 --> 00:04:59.940
But also, if you're outputting for different things, there are multiple different formats, including like a simple markdown type table. But it also does GitHub flavored markdown tables and pipes that just look nice if they just kind of make it look like boxes.

00:04:59.940 --> 00:05:09.600
And there's Jira style and MediaWiki and HTML and just plain if you don't want any sort of stuff in between, just spaces in between. It looks nice.

00:05:09.600 --> 00:05:17.360
That's cool. So you could like output this in Jira format and like paste it into a Jira issue as like, here's what we're doing now or here's the problem or here's the data.

00:05:17.360 --> 00:05:21.380
Yeah, definitely. It's a good one for keeping track of tables.

00:05:21.380 --> 00:05:22.500
Yeah. Wow.

00:05:22.500 --> 00:05:29.180
Another good thing is all the stuff that you and I have to offer people to learn more information about lots of stuff.

00:05:29.180 --> 00:05:32.200
Yeah, absolutely. We have the podcast, but we also have other things as well.

00:05:32.200 --> 00:05:43.760
Yeah. So if you want to support what we're doing, one of the things you can do is become a Patreon supporter. So there's a link on the page where you can throw a couple bucks at us a month if you want. But also, I've got a book.

00:05:43.760 --> 00:05:47.060
If anybody was not aware of that, there's a pie test book.

00:05:47.060 --> 00:05:48.240
You've written a pie test book?

00:05:48.240 --> 00:05:50.200
Yeah, I did.

00:05:50.200 --> 00:05:51.640
It's good. I really like it.

00:05:51.640 --> 00:06:03.160
Another podcast called Testing Code. I'd love to have more people go check that out and suggest what you want. So I'd like to have people talk, tell me about what other topics should be covered there.

00:06:03.160 --> 00:06:03.520
Yeah.

00:06:03.520 --> 00:06:07.360
You also offer quite a few learning opportunities for people.

00:06:07.360 --> 00:06:18.320
Yeah, absolutely. The main thing for me, if you want to support me, like obviously we have the Patreon and that's great. But if you want to support us and get something back, you could take one of our courses over at Talk Python Training.

00:06:18.320 --> 00:06:24.620
We're doing all sorts of cool stuff there. We've got like 120 hours of Python courses and exercises beyond that.

00:06:24.620 --> 00:06:30.320
But we recently just kicked off a cohort thing where people can go through as groups.

00:06:30.320 --> 00:06:35.040
So that's something I'm trying to put together and, you know, it will probably be more opportunities to do that as well.

00:06:35.040 --> 00:06:38.540
So, yeah, check it out if you want to learn Python. That's where I recommend people go.

00:06:38.540 --> 00:06:46.500
Yeah. I want to bring something up about your courses. There's a lot of the courses that are, there's a lot of content there and it's wonderful information.

00:06:46.700 --> 00:06:56.820
One of the things I really love, especially in this working from home environment where I don't often have a lot of time, is the way you've broken up all the courses into little tiny pieces.

00:06:56.820 --> 00:07:01.600
So there's a table of contents so you can go through the course and see what you've seen and see what you haven't.

00:07:01.600 --> 00:07:03.880
But you can keep track of what you haven't.

00:07:03.880 --> 00:07:09.620
And there's often just, if you've got like three to five minutes, you can fit in a little extra video.

00:07:09.620 --> 00:07:10.900
Yeah. Thank you so much. That's awesome.

00:07:11.000 --> 00:07:12.440
And I like that you've done that.

00:07:12.440 --> 00:07:17.100
Yeah. I really want to try to make the courses have meaning as a reference afterwards as well.

00:07:17.100 --> 00:07:22.080
And like nobody wants to go back and scan a 30 minute video for that 30 second clip you're looking for.

00:07:22.080 --> 00:07:22.720
Yeah. That's good.

00:07:22.720 --> 00:07:24.380
Awesome. You know what else is really good?

00:07:24.380 --> 00:07:25.260
Tree beards.

00:07:25.260 --> 00:07:27.740
Yeah. For real. Tree beards are pretty awesome.

00:07:27.740 --> 00:07:29.540
Is that like a neck beard?

00:07:30.800 --> 00:07:31.720
But for a tree.

00:07:31.720 --> 00:07:32.340
Okay.

00:07:32.340 --> 00:07:33.140
Okay. Yeah.

00:07:33.140 --> 00:07:36.620
So I actually have no idea the relationship of the neck beard to the tree beard.

00:07:36.620 --> 00:07:41.520
But tree beard is continuous integration for notebooks, which is pretty cool, actually.

00:07:41.520 --> 00:07:42.220
That is cool.

00:07:42.220 --> 00:07:43.960
So this was recommended by Brian Skin.

00:07:43.960 --> 00:07:49.920
And it's continuous integration for a particular subset of notebooks.

00:07:49.920 --> 00:07:52.220
Those are the notebooks that are binder ready.

00:07:52.220 --> 00:08:00.420
So if you're not familiar with binder, I recently did a Talk Python episode on this and came to appreciate binder way more than I originally did.

00:08:00.580 --> 00:08:08.160
So binder is a place where you can basically point a GitHub repo or some repo at.

00:08:08.160 --> 00:08:10.100
Go to binder, point it at your repo.

00:08:10.100 --> 00:08:11.360
Say here's the notebook.

00:08:11.360 --> 00:08:13.380
Here's the dependencies files and everything.

00:08:13.380 --> 00:08:17.220
And then you just click a button and say, let me run this on binder.

00:08:17.220 --> 00:08:20.780
Because if you go to GitHub, you see that possibly the output from the notebook.

00:08:20.780 --> 00:08:23.240
But that's like cached what was run the last time.

00:08:23.240 --> 00:08:26.920
If you want to actually run it and play with it, you can click launch a binder.

00:08:26.920 --> 00:08:30.500
It'll fire up a little Docker image somewhere magically in the cloud.

00:08:30.500 --> 00:08:32.080
And it'll just run it.

00:08:32.080 --> 00:08:38.520
So you basically configure the repo to describe to binder what it needs to run successfully.

00:08:38.520 --> 00:08:39.000
Right?

00:08:39.000 --> 00:08:40.960
So that's how this works.

00:08:40.960 --> 00:08:52.600
Is Treebeard basically says if there's something that can be run on binder, then it will use that same functionality to automatically install the dependencies, which could be like conda or pip or whatever.

00:08:52.820 --> 00:09:00.800
And then it'll run the notebook using that cool library called Paper Mill, which sort of converts notebooks into kind of function type things.

00:09:00.920 --> 00:09:01.340
It'll upload the output.

00:09:01.340 --> 00:09:17.620
It'll upload the output and do an NB convert on the notebook to save it and create like a version stamped last run of your notebook that you can go back through your continuous integration and see the history of the outputs saved as HTML, which is pretty awesome.

00:09:17.840 --> 00:09:22.340
And it integrates with a GitHub app that'll like push notifications back to your repo.

00:09:22.340 --> 00:09:23.740
It integrates with Slack.

00:09:23.740 --> 00:09:26.040
It has all kinds of interesting things like this.

00:09:26.120 --> 00:09:32.100
So really a neat mechanism to make sure that your code just keeps running if it's a notebook.

00:09:32.100 --> 00:09:32.360
Yeah.

00:09:32.360 --> 00:09:33.800
It's even got like secret management.

00:09:33.800 --> 00:09:38.180
So you can, if you have to connect with different things with passwords and stuff.

00:09:38.180 --> 00:09:39.960
Don't you just put those in the notebook?

00:09:39.960 --> 00:09:40.880
No.

00:09:40.880 --> 00:09:41.300
No?

00:09:41.300 --> 00:09:41.960
Darn it.

00:09:41.960 --> 00:09:42.200
No.

00:09:43.740 --> 00:09:44.080
Yeah.

00:09:44.080 --> 00:09:44.780
No, that's really cool.

00:09:44.780 --> 00:09:46.580
It has secret management and all kinds of stuff.

00:09:46.580 --> 00:09:52.120
And basically, when I first saw this, I thought, okay, well, what's the criteria of success, right?

00:09:52.120 --> 00:09:56.040
Like how do I write a test to indicate a successful notebook experience?

00:09:56.040 --> 00:09:58.760
The way it works is basically it runs all the cells.

00:09:58.760 --> 00:10:02.520
And if all the cells run without exceptions, then it's successful.

00:10:02.520 --> 00:10:07.140
So it's not like it's making assertions, but it's kind of like a smoke test.

00:10:07.140 --> 00:10:09.100
Like it didn't entirely explode.

00:10:09.100 --> 00:10:10.900
So we think it's probably okay.

00:10:10.900 --> 00:10:12.200
That's not bad for a starter.

00:10:12.420 --> 00:10:15.980
I mean, conceptually, you could put asserts in there and that would throw an exception.

00:10:15.980 --> 00:10:16.500
Exactly.

00:10:16.500 --> 00:10:16.720
Right.

00:10:16.720 --> 00:10:19.200
You could build in the test at like some layer in there.

00:10:19.200 --> 00:10:22.920
Like have even a Python file that you import that like does the test.

00:10:22.920 --> 00:10:23.260
I don't know.

00:10:23.260 --> 00:10:23.480
Whatever.

00:10:23.480 --> 00:10:24.440
There's a lot of options.

00:10:24.440 --> 00:10:24.960
So you're right.

00:10:24.960 --> 00:10:27.860
You could make your notebook report out.

00:10:27.860 --> 00:10:28.280
Make some cells in there.

00:10:28.280 --> 00:10:28.480
Yeah.

00:10:28.480 --> 00:10:30.840
Make some cells that'll blow up if things go wrong for sure.

00:10:30.840 --> 00:10:31.280
Yeah.

00:10:31.280 --> 00:10:33.520
Somebody should get a hold of us and tell us why beard.

00:10:33.520 --> 00:10:33.920
Yeah.

00:10:33.920 --> 00:10:36.560
Because trees generally don't have beards.

00:10:36.560 --> 00:10:38.740
Well, okay.

00:10:38.740 --> 00:10:41.480
We live in Oregon, so they're often very mossy.

00:10:41.480 --> 00:10:42.360
That's true.

00:10:42.360 --> 00:10:43.620
They've got that little moss thing.

00:10:43.620 --> 00:10:45.940
If it's just right, actually, it could totally do that.

00:10:45.940 --> 00:10:46.300
You're sure?

00:10:46.300 --> 00:10:46.640
Yeah.

00:10:46.640 --> 00:10:47.080
Okay.

00:10:47.080 --> 00:10:51.540
So one thing that surprises me, Brian, that seems to keep coming up and up and both of us

00:10:51.540 --> 00:10:52.520
are talking about it next.

00:10:52.520 --> 00:10:56.140
Like I feel like we've aligned perfectly so far.

00:10:56.140 --> 00:10:56.460
Oh my gosh.

00:10:56.460 --> 00:10:56.880
We are.

00:10:56.880 --> 00:10:57.180
Dude.

00:10:57.180 --> 00:10:59.140
We're both talking about virtual environments.

00:10:59.140 --> 00:11:00.280
You go first.

00:11:00.400 --> 00:11:00.640
Okay.

00:11:00.640 --> 00:11:07.320
So there's a couple of things that we just, in episode 184, we discussed virtualenv and venv.

00:11:07.320 --> 00:11:13.120
And actually I learned quite a bit to find out that virtualenv is still pretty cool and fast,

00:11:13.120 --> 00:11:14.900
but that was in 184.

00:11:15.040 --> 00:11:19.960
But we had people get a hold of us and say, hey, there's more information that you guys don't know.

00:11:19.960 --> 00:11:20.800
And I love that.

00:11:20.800 --> 00:11:21.940
Please keep it coming.

00:11:21.940 --> 00:11:24.740
If we do half the story, give us the rest of it.

00:11:24.740 --> 00:11:34.200
In Python 3.9, so venv, the built-in one, it has a cool new flag called upgrade depths for upgrading your dependencies.

00:11:34.660 --> 00:11:38.240
It's like not all of your dependencies, but it's for virtual environments.

00:11:38.240 --> 00:11:41.900
Every time you create one, we commented that you have to upgrade pip.

00:11:41.900 --> 00:11:44.660
And this new flag allows it.

00:11:44.660 --> 00:11:52.520
So when you install, create a new virtual environment, it automatically upgrades set of tools and pip for you.

00:11:52.520 --> 00:11:53.180
Yeah, that's cool.

00:11:53.180 --> 00:11:53.480
Which is nice.

00:11:53.480 --> 00:11:55.560
That's in Python 3.9.

00:11:55.560 --> 00:11:57.020
I tried it out already.

00:11:57.020 --> 00:11:58.500
I tried it on beta 1.

00:11:58.500 --> 00:12:00.180
Beta 3 is already out.

00:12:00.180 --> 00:12:01.680
So you can try it out if you want.

00:12:01.800 --> 00:12:08.420
The other news is the virtualenv is getting something new, and it's not there yet.

00:12:08.420 --> 00:12:10.820
And I'm not sure when it's coming, but I think it's soon.

00:12:10.820 --> 00:12:14.960
It's getting a feature called periodic update, which is super cool.

00:12:14.960 --> 00:12:23.980
So one of the things, so virtualenv, since it's separate from your Python, or you can have it install, make virtual environments for multiple Pythons, for instance.

00:12:24.200 --> 00:12:33.320
But it also keeps its own cache of new pip, new setup tools, and new wheel, that package you need if you're creating wheels.

00:12:33.320 --> 00:12:35.780
And so it has those upgraded already.

00:12:35.780 --> 00:12:43.940
But the periodic update, it will just have this extra thing that in the background goes off and checks to see if there's new ones around.

00:12:43.940 --> 00:12:53.660
So whenever you actually need to create a new virtual environment, it'll automatically have an updated one that it can install right away, which is neat.

00:12:53.660 --> 00:12:54.600
Yeah, that's pretty cool.

00:12:54.600 --> 00:12:55.280
Nice.

00:12:55.280 --> 00:13:01.860
And if you don't want it to go off and do it in the background, you can manually say, okay, right now I want you to go off and upgrade it right now.

00:13:01.860 --> 00:13:03.400
Okay, that's a cool idea.

00:13:03.400 --> 00:13:04.040
I like it.

00:13:04.100 --> 00:13:10.340
So you've got a better chance of having updated stuff if you're working without an internet connection at the moment or something?

00:13:10.340 --> 00:13:15.160
It already had kept its own version of it that would upgrade it.

00:13:15.160 --> 00:13:19.520
So you already can, it's newer than if you're using VENV.

00:13:19.520 --> 00:13:21.280
But I'm excited about it.

00:13:21.280 --> 00:13:27.700
And one of the other things I wanted to mention is I kind of complained about that the prompt is different.

00:13:28.060 --> 00:13:34.240
And I got a little bit of the skinny about why the prompt is different in virtualenv versus VENV.

00:13:34.240 --> 00:13:41.880
And it had to do with the prompt formatting on different operating systems was different, which is weird.

00:13:41.880 --> 00:13:45.660
But they coalesced it and made it a single prompt.

00:13:45.660 --> 00:13:50.300
And the need for, like, sometimes you actually want to not have a space.

00:13:50.300 --> 00:13:52.220
You might not want to have those parentheses.

00:13:52.220 --> 00:13:56.500
So there may be reasons to not have the parentheses in space.

00:13:56.680 --> 00:13:58.680
So there's reasoning behind it.

00:13:58.680 --> 00:14:00.260
It just still annoys me.

00:14:00.260 --> 00:14:01.160
But that's okay.

00:14:01.160 --> 00:14:03.760
It's cool to actually know why, though.

00:14:03.760 --> 00:14:04.600
That's really nice.

00:14:04.600 --> 00:14:04.820
Yeah.

00:14:04.820 --> 00:14:09.620
So all these things that make working with virtual environments better are great.

00:14:09.620 --> 00:14:12.820
But how about we just don't have virtual environments, but we still do?

00:14:12.820 --> 00:14:13.920
Wouldn't that be better?

00:14:13.920 --> 00:14:14.720
I don't know.

00:14:14.720 --> 00:14:17.860
So let me tell you what I'm thinking.

00:14:17.860 --> 00:14:25.320
So a while ago, for the 3.8 timeframe, there was a proposal called PEP582.

00:14:25.320 --> 00:14:32.720
And PEP582 is put together by a bunch of folks, Steve Dower and four or five other people.

00:14:32.720 --> 00:14:33.980
I'm forgetting Donald Stuff.

00:14:33.980 --> 00:14:36.100
And I know there's two other folks that I'm forgetting.

00:14:36.100 --> 00:14:36.940
Sorry about that.

00:14:36.940 --> 00:14:38.100
But anyway, it was put together.

00:14:38.100 --> 00:14:50.380
And the idea is that it proposes to add a mechanism to automatically recognize a DunderPy packages and prefer importing packages installed in there over global packages.

00:14:50.520 --> 00:14:56.760
So the idea is you just go to your project and say at the top of your project, go, here's the top of my project.

00:14:56.760 --> 00:15:00.740
And then when you pip install stuff, it will put things there.

00:15:00.740 --> 00:15:07.500
You won't have to activate a virtual environment because you're not changing anything outside the global system.

00:15:07.500 --> 00:15:10.000
It's just going to drop it in right there.

00:15:10.000 --> 00:15:10.400
Okay.

00:15:10.500 --> 00:15:12.600
Basically, this is how Node.js works, right?

00:15:12.600 --> 00:15:19.840
So if I'm by npm install a thing, it just traverses up the directory until it finds a node modules.

00:15:19.840 --> 00:15:21.780
And it's kind of like that, right?

00:15:21.780 --> 00:15:25.860
So it says, if you have this folder here, we're going to automatically install stuff there.

00:15:25.860 --> 00:15:28.080
And then Python will automatically know to look there.

00:15:28.080 --> 00:15:39.040
So if you're anywhere in a subfolder without even activating the virtual environment and you type Python something to run a command, as long as you're in the folder structure, it's going to use that environment.

00:15:39.040 --> 00:15:39.900
Oh, that's pretty cool.

00:15:39.900 --> 00:15:40.820
Yeah, that's pretty cool, right?

00:15:41.740 --> 00:15:48.100
So the motivation, at least, is it's like every time someone's new to Python, they're like, well, I can't install this thing.

00:15:48.100 --> 00:15:49.560
It says access denied.

00:15:49.560 --> 00:15:51.060
You're like, you know, permission denied.

00:15:51.060 --> 00:15:53.940
You're like, well, okay, let me talk to you about virtual environments and why you need them.

00:15:53.940 --> 00:16:06.280
And also to activate the environment on the different shells and the different platforms like Windows versus POSIX, you know, source versus not source and bin versus scripts is different.

00:16:06.280 --> 00:16:07.480
And so that's kind of a pain.

00:16:07.680 --> 00:16:13.900
So the idea also, every time you open up a new terminal or command prompt, you've got to reactivate it.

00:16:13.900 --> 00:16:15.920
Like I've all all for all of these things.

00:16:15.920 --> 00:16:18.140
I have aliases that make this happen, right?

00:16:18.140 --> 00:16:18.440
Yeah.

00:16:18.440 --> 00:16:22.420
So the idea here is that you don't have to worry about any of that stuff.

00:16:22.420 --> 00:16:25.200
You just have to like init your Python project somehow.

00:16:25.200 --> 00:16:27.800
It doesn't I don't remember seeing how that was supposed to happen.

00:16:27.800 --> 00:16:32.920
But once that PyPackages folder is there, it's like, well, that's the top of the project.

00:16:32.920 --> 00:16:33.900
We're going to install there.

00:16:33.900 --> 00:16:37.500
And you presumably could have like a fallback one at the top of your user profile.

00:16:37.500 --> 00:16:39.440
Or something along those lines.

00:16:39.440 --> 00:16:40.540
Yeah, you have that.

00:16:40.540 --> 00:16:42.180
So that's for the packages.

00:16:42.180 --> 00:16:44.140
But what about in virtual environments?

00:16:44.140 --> 00:16:47.920
You also have local scripts that come along entry points.

00:16:47.920 --> 00:16:48.200
Yeah.

00:16:48.200 --> 00:16:49.600
Do you know if it deals with that?

00:16:49.600 --> 00:16:50.340
I don't know.

00:16:50.340 --> 00:16:51.520
I don't know about it.

00:16:51.520 --> 00:16:51.940
It's possible.

00:16:51.940 --> 00:16:53.520
I didn't read like every word of it.

00:16:53.520 --> 00:16:55.500
So it's in draft mode.

00:16:55.500 --> 00:16:59.820
But I was a little confused because it says its version is Python 3.8.

00:16:59.820 --> 00:17:00.960
I'm like, well, 3.8 shipped.

00:17:00.960 --> 00:17:03.720
It should either be closed or published.

00:17:03.720 --> 00:17:05.600
That seems weird.

00:17:05.600 --> 00:17:08.620
So I sent a message to Steve Dower just a moment ago on Twitter.

00:17:08.620 --> 00:17:16.820
And he said that Kushal Das, one of the folks proposing it, I think the primary guy, is still

00:17:16.820 --> 00:17:17.400
working on it.

00:17:17.400 --> 00:17:21.840
The text itself hasn't been updated before 3.8's release, which is why the header is still a

00:17:21.840 --> 00:17:22.440
little bit out of date.

00:17:22.440 --> 00:17:26.540
So it's probably more like a 3.10 thing or something.

00:17:26.640 --> 00:17:27.400
But it's still pretty cool.

00:17:27.400 --> 00:17:32.660
If you want to try to live in this world and see what it's like, David O'Connor has this

00:17:32.660 --> 00:17:33.600
thing called PyFlow.

00:17:33.600 --> 00:17:36.480
And PyFlow basically does this.

00:17:36.480 --> 00:17:38.800
It integrates with PyProject.tom.

00:17:38.800 --> 00:17:40.440
Well, man, we lined it up good this week.

00:17:40.440 --> 00:17:45.640
And you go through, instead of saying pip install, you say PyFlow install.

00:17:45.640 --> 00:17:50.440
Instead of saying Python run, you say Python script, you say PyFlow script.

00:17:50.440 --> 00:17:55.540
Because it has to reinitialize that every time because it's not actually changing something.

00:17:55.980 --> 00:17:57.200
Anyway, it's interesting.

00:17:57.200 --> 00:17:59.900
I would like to see something kind of like this.

00:17:59.900 --> 00:18:00.680
I think it's pretty neat.

00:18:00.680 --> 00:18:05.100
There's also some interesting possibilities around DIRT ENV that I'm looking into.

00:18:05.100 --> 00:18:11.920
Just talking to someone, Chris, who has got some cool ways to have DIRT ENV automatically

00:18:11.920 --> 00:18:16.160
activate virtual environments, which would be kind of cool as well.

00:18:16.160 --> 00:18:18.200
So there's a lot of stuff happening here.

00:18:18.200 --> 00:18:19.760
It still kind of blows my mind.

00:18:19.760 --> 00:18:25.320
There's so much action around something that feels like it's just a, I don't know, so plumbing

00:18:25.320 --> 00:18:25.960
and foundational.

00:18:25.960 --> 00:18:26.540
Yeah.

00:18:26.540 --> 00:18:31.780
But like you said, it is plumbing and foundational, but it's also one of those things that's one

00:18:31.780 --> 00:18:32.980
of those tripping things.

00:18:32.980 --> 00:18:39.620
It's like the loose stone on the sidewalk that trips up all the new people all the time.

00:18:39.880 --> 00:18:45.060
So far, what we've managed to do is we've managed to like spray paint a yellow line on both sides

00:18:45.060 --> 00:18:45.360
of it.

00:18:45.360 --> 00:18:46.220
You know?

00:18:46.220 --> 00:18:48.680
Somebody needs to shave that bad boy down.

00:18:48.680 --> 00:18:51.120
But right now, at least it's like got a little marker on it.

00:18:51.120 --> 00:18:55.880
And I just want to say thanks to Louise Erbier on here.

00:18:55.880 --> 00:18:58.580
Send that over and let me know about this whole project.

00:18:58.580 --> 00:18:59.740
So thank you for that.

00:18:59.740 --> 00:19:00.480
Yeah, that's nice.

00:19:00.480 --> 00:19:00.740
Yeah.

00:19:00.740 --> 00:19:05.080
So speaking of PyProjects.toml, I actually really love, I kind of like this.

00:19:05.080 --> 00:19:06.500
I like awesome lists.

00:19:06.500 --> 00:19:08.400
So awesome lists are a thing.

00:19:08.400 --> 00:19:10.420
We've covered many of them in the past.

00:19:10.420 --> 00:19:12.240
There's even a Python Bytes awesome list.

00:19:12.240 --> 00:19:12.720
Yeah.

00:19:12.720 --> 00:19:15.200
This one is awesome PyProjects.

00:19:15.200 --> 00:19:17.440
PyProject.toml projects.

00:19:17.440 --> 00:19:24.160
So this is one of the great things about different sorts of source code lists is to go and look at

00:19:24.160 --> 00:19:24.560
examples.

00:19:24.560 --> 00:19:30.660
So this is a list of other projects that are out there that already use PyProject.toml.

00:19:30.660 --> 00:19:33.920
So you can look to see how other projects are doing it.

00:19:33.920 --> 00:19:38.360
So if you want to figure out for your own project, this is helpful.

00:19:38.360 --> 00:19:41.720
For instance, a lot of the testing and formatting stuff came along early.

00:19:41.720 --> 00:19:43.600
So covers.py is in there.

00:19:43.600 --> 00:19:46.380
pytest, Tox, Black, iSort.

00:19:46.380 --> 00:19:48.180
I knew all of those.

00:19:48.180 --> 00:19:49.840
Ward was a new one to me.

00:19:49.840 --> 00:19:56.260
So Ward is apparently a way to test things without like string named test functions instead of function

00:19:56.260 --> 00:19:56.680
names.

00:19:56.680 --> 00:20:00.040
I haven't really played with it much other than looking at the documentation.

00:20:00.040 --> 00:20:01.380
But it looks neat.

00:20:01.380 --> 00:20:08.880
But there's a code analysis like PyLint and Unimport and the really long titled We Make Python

00:20:08.880 --> 00:20:11.920
Style Guide, which is a linter and other stuff.

00:20:11.920 --> 00:20:12.780
But it's pretty cool.

00:20:12.780 --> 00:20:16.800
And then it has a couple links to articles about PyProject.toml.

00:20:16.980 --> 00:20:25.000
And then what I think is also neat is a list of projects that are discussing switching to PyProject.toml.

00:20:25.000 --> 00:20:25.820
So you can...

00:20:25.820 --> 00:20:26.040
Oh, yeah.

00:20:26.040 --> 00:20:30.260
That's probably pretty interesting if you're trying to decide yourself, right?

00:20:30.260 --> 00:20:30.660
Yeah.

00:20:30.660 --> 00:20:35.420
To figure out what sort of discussions are going on in other projects as to why to switch and

00:20:35.420 --> 00:20:35.860
why not.

00:20:35.860 --> 00:20:37.040
Yeah, for sure.

00:20:37.040 --> 00:20:38.200
Very cool.

00:20:38.200 --> 00:20:38.660
Very cool.

00:20:38.660 --> 00:20:39.080
Yeah.

00:20:39.240 --> 00:20:40.320
I think people switch.

00:20:40.320 --> 00:20:42.520
I'm using it everywhere because it's just...

00:20:42.520 --> 00:20:43.780
It's sort of easier.

00:20:43.780 --> 00:20:47.080
What confused me for a little while was that it isn't...

00:20:47.080 --> 00:20:51.680
I thought it was something you needed Flit or Poetry to be using.

00:20:51.680 --> 00:20:56.040
But you can use PyProject.toml with setup tools projects also.

00:20:56.040 --> 00:20:56.820
Okay.

00:20:56.820 --> 00:20:57.340
Interesting.

00:20:57.340 --> 00:20:57.640
Yeah.

00:20:57.640 --> 00:20:58.280
I didn't know about that.

00:20:58.280 --> 00:20:58.620
Yeah.

00:20:58.620 --> 00:21:03.860
I kind of thought it was tied to some of these higher order management things like Poetry and

00:21:03.860 --> 00:21:04.440
Flit and so on.

00:21:04.440 --> 00:21:04.680
Yeah.

00:21:04.680 --> 00:21:05.180
Yep.

00:21:05.180 --> 00:21:05.440
Cool.

00:21:05.640 --> 00:21:10.640
And like you said, there's a Python Bytes awesome list if people like awesome lists.

00:21:10.640 --> 00:21:11.120
Sorry.

00:21:11.120 --> 00:21:12.060
I put that at the end there.

00:21:12.060 --> 00:21:12.840
People can check that out.

00:21:12.840 --> 00:21:13.780
Thanks, Jack, for doing that.

00:21:13.780 --> 00:21:14.540
Yeah.

00:21:14.540 --> 00:21:16.700
So that's our six items, Michael.

00:21:16.700 --> 00:21:18.360
Anything extra to share with us?

00:21:18.360 --> 00:21:19.440
I got something for everyone.

00:21:19.440 --> 00:21:20.480
I got two things, actually.

00:21:20.480 --> 00:21:22.700
One follow-up and one new thing.

00:21:22.700 --> 00:21:27.880
First of all, we had Calvin on a while ago, a couple shows ago.

00:21:27.880 --> 00:21:28.520
Was that last show?

00:21:28.520 --> 00:21:29.380
Show before?

00:21:29.380 --> 00:21:30.640
I think a couple shows ago.

00:21:30.640 --> 00:21:32.540
And we were talking about secrets.

00:21:32.540 --> 00:21:34.620
And he also...

00:21:34.620 --> 00:21:35.280
He's in your camp.

00:21:35.360 --> 00:21:38.340
He doesn't put them in the notebook or in the right there in the source code.

00:21:38.340 --> 00:21:39.720
He's doing something else.

00:21:39.720 --> 00:21:45.420
But what he talked about is actually using 1Password as like a vault, right?

00:21:45.420 --> 00:21:48.440
So 1Password has awesome encryption and security.

00:21:48.440 --> 00:21:54.120
And so a lot of the challenges revolve around, well, if I'm going to put them somewhere else,

00:21:54.120 --> 00:21:57.860
if I just put them straight in the virtual into an environment variables, well, people can

00:21:57.860 --> 00:21:58.500
grab them there.

00:21:58.500 --> 00:22:03.400
So maybe I want to put them some other place where it's like encrypted or something, right?

00:22:03.400 --> 00:22:09.160
So he talked about his mechanism of finding all those environment variables at launch and

00:22:09.160 --> 00:22:14.280
then like just as you run your virtual environment, injecting them there, but storing them in 1Password

00:22:14.280 --> 00:22:16.640
instead of just on the file system or something like that.

00:22:16.640 --> 00:22:19.760
So he did a blog post about how he's doing that.

00:22:19.760 --> 00:22:20.980
And so I'm going to just link back to that.

00:22:20.980 --> 00:22:21.560
Yeah, nice.

00:22:21.640 --> 00:22:22.260
That looks pretty cool.

00:22:22.260 --> 00:22:26.180
And also, I want to give a shout out to Talk Python.

00:22:26.180 --> 00:22:32.240
Specifically, the last episode, at least the time of recording, it'll probably not be by the time we publish this.

00:22:32.240 --> 00:22:39.740
But nonetheless, just recently, you were a guest on Talk Python where we talked about 15 awesome pytest plugins,

00:22:39.980 --> 00:22:48.140
mostly a few extensions like using with or alongside, but mostly pytest plugins and went through things like pytest Sugar and Freeze Gun and all sorts of fun stuff.

00:22:48.140 --> 00:22:49.880
So people can't get enough of us.

00:22:49.880 --> 00:22:54.200
They can hear you being a guest over there talking about pytest the entire time.

00:22:54.200 --> 00:22:55.300
Yeah, it's nice.

00:22:55.300 --> 00:22:55.900
Yeah, that was fun.

00:22:55.900 --> 00:22:56.720
Thanks for coming on there.

00:22:56.720 --> 00:23:03.440
I like to hear myself talk so much that I also, we cross posted that on Testing Code as well.

00:23:03.440 --> 00:23:04.720
Yeah, sounds good.

00:23:04.860 --> 00:23:08.860
And one of the things, so as an extra bit, did you know that I wrote a book?

00:23:08.860 --> 00:23:09.220
Yes.

00:23:09.220 --> 00:23:10.480
Yeah, I've heard of that.

00:23:10.480 --> 00:23:11.240
No, it's a great book.

00:23:11.240 --> 00:23:11.680
I have it.

00:23:11.680 --> 00:23:17.820
I published through Pragmatic Publishers, and I just wanted to bring up that Pragmatic has a shiny new website.

00:23:17.820 --> 00:23:25.660
So the Pragmatic site is a little different, and there's an FAQ up there if people want to know why or what's different about it.

00:23:25.660 --> 00:23:29.980
And for the most part, it looks a lot the same to me, but the entire backend is different.

00:23:29.980 --> 00:23:31.260
Yeah, yeah, cool.

00:23:31.260 --> 00:23:31.800
It's a little faster.

00:23:31.800 --> 00:23:33.300
Faster is always nice.

00:23:33.560 --> 00:23:35.280
Makes it nice to work with.

00:23:35.280 --> 00:23:36.180
All right, I have a joke.

00:23:36.180 --> 00:23:37.760
Let's pretend we're roommates.

00:23:37.760 --> 00:23:40.620
You can be the first person, and I'll be the second person, okay?

00:23:40.620 --> 00:23:41.100
Okay.

00:23:41.100 --> 00:23:42.200
Okay.

00:23:42.200 --> 00:23:48.160
Stop by the store on the way home from work.

00:23:48.160 --> 00:23:51.840
Please stop at the market and buy one bottle of milk.

00:23:51.840 --> 00:23:53.800
If they have eggs, bring six.

00:23:53.800 --> 00:23:56.180
I came back with six bottles of milk.

00:23:56.180 --> 00:23:58.880
Why the hell did you buy six bottles of milk?

00:23:58.880 --> 00:24:01.180
I just said it's just the two of us.

00:24:01.180 --> 00:24:02.280
What do you think, man?

00:24:02.280 --> 00:24:03.160
Because they had eggs.

00:24:03.160 --> 00:24:08.000
Obviously, taking this programming logic a little strong, right?

00:24:08.000 --> 00:24:09.100
Stop by the store.

00:24:09.100 --> 00:24:11.340
If they have eggs, get a bottle of milk.

00:24:11.340 --> 00:24:12.300
If they have eggs, get six.

00:24:12.300 --> 00:24:13.360
Cool.

00:24:13.360 --> 00:24:14.940
That's funny.

00:24:14.940 --> 00:24:15.960
Pretty good one, huh?

00:24:15.960 --> 00:24:17.200
Takes a little bit of thinking.

00:24:17.200 --> 00:24:20.020
So, glad we have it written down for people.

00:24:20.020 --> 00:24:20.360
Yeah, yeah.

00:24:20.360 --> 00:24:21.520
We can go back and study it, right?

00:24:21.520 --> 00:24:21.780
Yeah.

00:24:21.780 --> 00:24:22.060
All right.

00:24:22.060 --> 00:24:23.480
Well, thanks a bunch, huh?

00:24:23.480 --> 00:24:23.740
Cool.

00:24:23.740 --> 00:24:24.720
All right.

00:24:24.720 --> 00:24:25.160
Thank you.

00:24:25.160 --> 00:24:25.400
Yep.

00:24:25.400 --> 00:24:25.700
Bye.

00:24:25.700 --> 00:24:25.860
Bye.

00:24:26.080 --> 00:24:27.760
Thank you for listening to Python Bytes.

00:24:27.760 --> 00:24:30.240
Follow the show on Twitter at Python Bytes.

00:24:30.240 --> 00:24:33.260
That's Python Bytes as in B-Y-T-E-S.

00:24:33.260 --> 00:24:36.160
And get the full show notes at pythonbytes.fm.

00:24:36.160 --> 00:24:41.220
If you have a news item you want featured, just visit pythonbytes.fm and send it our way.

00:24:41.220 --> 00:24:43.260
We're always on the lookout for sharing something cool.

00:24:43.260 --> 00:24:44.440
This is Brian Okken.

00:24:44.440 --> 00:24:48.520
And on behalf of myself and Michael Kennedy, thank you for listening and sharing this podcast

00:24:48.520 --> 00:24:49.700
with your friends and colleagues.

00:24:49.700 --> 00:24:49.900
Bye.

