Latest / Talk Python To Me / #472: State of Flask and Pallets in 2024
Transcript
- 0:00Flask is one of the most important Python web frameworks, and it powers a bunch of the
- 0:04internet.
- 0:04David Lord, Flask's lead maintainer, is here to give us an update on the state of Flask
- 0:09and palettes in 2024.
- 0:10If you care about Flask and where it is and where it's going, you'll definitely want
- 0:15to listen in.
- 0:15This is Talk Python To Me, episode 472, recorded July 9th, 2024.
- 0:21Are you ready for your host, please?
- 0:24You're listening to Michael Kennedy on Talk Python To Me.
- 0:28Live from Portland, Oregon, and this segment was made with Python.
- 0:31Welcome to Talk Python To Me, a weekly podcast on Python.
- 0:37This is your host, Michael Kennedy.
- 0:39Follow me on Mastodon, where I'm @mkennedy, and follow the podcast using @talkpython,
- 0:45both accounts over at fosstodon.org, and keep up with the show and listen to over nine years
- 0:51of episodes at talkpython.fm.
- 0:53If you want to be part of our live episodes, you can find the live streams over on YouTube,
- 0:57subscribe to our YouTube channel over at talkpython.fm/youtube and get notified about upcoming
- 1:03shows.
- 1:03This episode is sponsored by Sentry.
- 1:06Don't let those errors go unnoticed.
- 1:08Use Sentry.
- 1:09Get started at talkpython.fm/sentry.
- 1:12And it's also brought to you by us over at Talk Python Training.
- 1:16Did you know that we have over 250 hours of Python courses?
- 1:21Yeah, that's right.
- 1:22Check them out at talkpython.fm/courses.
- 1:25Before we jump into the interview, I want to let you know that we still have some spots
- 1:29left in my Code in a Castle event.
- 1:31If you're looking to learn some of the premier frameworks and techniques in Python, and you'd
- 1:36like to have a bucket list type of experience while doing so, then check out talkpython.fm
- 1:41slash castle.
- 1:42In October, I'll be running a six-day Python course for an intimate audience in a villa
- 1:48in Tuscany.
- 1:49Half the time we'll be learning Python and the other half will be exploring the best of
- 1:53what Italy has to offer.
- 1:54Check out the course outline, the excursions, and all the details at talkpython.fm/castle.
- 2:01Or if you'd like to just shoot me an email, michael at talkpython.fm, or find me on the
- 2:06socials, and I'm happy to talk about it.
- 2:07I hope to see you there.
- 2:08David, welcome back to Talk Python To Me.
- 2:11Great to have you here.
- 2:12Yeah, hello.
- 2:12Going to be super fun to talk about Flask and more broadly, Palettes.
- 2:17Just all the different projects around Flask and tools and variations like Quart and so
- 2:24on.
- 2:25And you gave a really nice talk at Embedded FlaskCon.
- 2:29Talk a bit about that in a second.
- 2:30About the state of Palettes.
- 2:32And I thought, you know, let's just take that idea and share it with everyone.
- 2:35So looking forward to talking about that.
- 2:37Yeah, there's been a lot going on.
- 2:39I bet there has.
- 2:40I bet there has.
- 2:41So yeah, it's been, I can't remember exactly when you were on.
- 2:44I think it's about a hundred episodes ago, which puts out like a couple of years.
- 2:48What have you been up to the last couple of years?
- 2:50Just more Flask.
- 2:51It's all Flask all the time.
- 2:54Seems like such a simple API, but you can work on it forever, right?
- 2:57I've acquired a few more libraries, so like written more libraries and stuff as well.
- 3:01But still same job.
- 3:03Well, I guess I got a house.
- 3:04I got married.
- 3:05Okay, congratulations.
- 3:07Two times.
- 3:08Yeah.
- 3:08That's awesome.
- 3:09So a little bit of life changes.
- 3:11Life keeps marching on.
- 3:12It's amazing.
- 3:13Flask is certainly one of the most popular web frameworks.
- 3:17It's, I guess we could start with like giving people a sense of the popularity, but my thought
- 3:23is just like, wow, the pressure of working on something that affects so many folks.
- 3:28Like if you push out a change, you know?
- 3:31Yeah.
- 3:32I've had a weird thought before that like, I try not to think about the numbers too often
- 3:37because it's like 100 million or more if you add up all the different libraries and stuff
- 3:41a month.
- 3:42And I've had a thought before, like if I push out something that doesn't work for enough
- 3:46people, like that probably has some like very minor but noticeable like effect on the tech
- 3:54like sector for that day or hour, which is scary.
- 3:59Yeah.
- 3:59It's not quite an AWS US 1 East downtime, but it's also not that, you know?
- 4:07Yeah.
- 4:07I think a lot, I think over the past, definitely since I've started, a lot more people have
- 4:13become aware of like better practices around like pinning their dependencies, that sort of
- 4:18thing in part because we did make some, you know, deprecations and then breaking changes
- 4:25in Flask and the other libraries.
- 4:26And people came to our issue tracker saying, oh, you know, you broke something.
- 4:30And ultimately, you know, I had to tell them like, you need to be using a tool.
- 4:35There's quite a few tools out now, although we don't have like a lock file standard yet,
- 4:39but there's pip compiled, there's PDM, there's Rai.
- 4:42You need to use a tool and pin your dependency tree because then you can see when there's
- 4:48updates and you can like update them deliberately and test and make, adapt to those changes.
- 4:53And I was giving that message a lot in the beginning.
- 4:57And over the past like five years or so, it is, I've definitely had to post it less often.
- 5:02I feel like more people are like aware of those tools and practices now.
- 5:07Well, I would also add that the tooling has gotten a lot better at that.
- 5:12It used to be, okay, so what you're going to do is you're going to write a requirements.txt file
- 5:18and then you set your versions explicitly.
- 5:19And that for many people only addressed the primary dependencies, not the transitive depensity,
- 5:25you know, right?
- 5:26They might pin Flask, but did they depend Vexo?
- 5:29I don't know.
- 5:30They may have, probably they didn't, you know, unless they use pip freeze,
- 5:33but then you gather a bunch of like garbage that isn't actually about your project
- 5:37that got sucked in from some other thing that got, you know, it's like,
- 5:40it was really sort of funky before.
- 5:42And I think, I don't know, you mentioned pip-tools and pip compile.
- 5:46I am loving that workflow these days.
- 5:48Yeah, that's what I've switched all the projects themselves to.
- 5:51So if you go look at Flask or Vexoic or any of those,
- 5:54we have like a requirements folder with different environment files that say like,
- 5:59here are our direct dependencies.
- 6:01And then we compile those into like fully locked dependencies and all our tests run off of those.
- 6:05Our build and publish workflow runs off of those.
- 6:09So it's not quite the same because like those are our development dependencies instead of our runtime dependencies.
- 6:15But it's still really helpful just to know that like, if we don't do anything,
- 6:19our process will continue to work because it worked last time.
- 6:22Yeah.
- 6:22And if we give, if we have like contributors at sprints, now like it's much easier.
- 6:28Like I had, like I had a problem the first few sprints I was running where, you know,
- 6:31every developer would try to set up their own machine and get like different versions of things or have different versions.
- 6:36Point in time snapshots of just whenever they got started, right?
- 6:39Yeah.
- 6:39So now they like all install the exact same list of dependencies.
- 6:42So everybody's development environment looks exactly the same, which is a lot more usable.
- 6:47Yeah, that's excellent.
- 6:48I have the same workflow.
- 6:49I have a top level dependencies that I actually would consider my dependencies.
- 6:53And then I pip compile, the unpinned and I pip compile those to a pin dependencies.
- 6:58And I just do the upgrade when I feel like, oh, let's, let's go get some new dependencies and see how that goes.
- 7:03Yeah.
- 7:03Yeah.
- 7:04Very nice.
- 7:04Okay.
- 7:05Well, let's start with FlaskCon.
- 7:07Okay.
- 7:07I called it the, I called it an embedded conference and this is different than it has been before.
- 7:12I think FlaskCon at one point was a purely online one, or maybe that was just COVID.
- 7:16Yeah.
- 7:16It was just a matter of time.
- 7:17I remember.
- 7:18It was, it was timing really years ago, like right as COVID, right before COVID started or quarantine
- 7:26started, I had been like, like working myself up to do an in-person conference.
- 7:32It's something I've wanted to do for a while because I love attending conferences.
- 7:36I love the community around it.
- 7:37Django con happened in San Diego a few times and that was really fun.
- 7:41So I just crashed it.
- 7:42It was the Flask person.
- 7:43I was the Flask person.
- 7:43I was the Flask person.
- 7:46and, so I was like getting ready to do that.
- 7:49And then, COVID happened, but some other members of the community, the palettes
- 7:54team and he stepped up and said, Hey, we can do like an online one.
- 7:57running a conference, even online is very hard.
- 8:01There's a lot of stuff to keep track of.
- 8:03Oh yeah.
- 8:04But it was, we ran three online conferences.
- 8:06I think 2020, 2021 and 2023.
- 8:10I think we skipped one, but those are all on like, pivideo.org.
- 8:14If you want to find it.
- 8:15And now Flask on 2024 is there also.
- 8:18And, so I finally got the opportunity with, PyCon.
- 8:22They, they previously had this hatchery program, where you could kind of propose, I want
- 8:27to do this event.
- 8:28And, the hatchery program will say like, that sounds great.
- 8:31We'll give you, you know, we will handle the venue, the food, the insurance, the legal
- 8:37stuff.
- 8:38you get one of our rooms and you can do whatever you want in it or whatever you propose
- 8:42in it.
- 8:43and so last year at PyCon, I talked to some of the organizers.
- 8:48And they suggested, Hey, the hatchery is coming back.
- 8:50This would be a great way to do it.
- 8:51So that you don't have to learn everything at once.
- 8:54Right.
- 8:55You can practice.
- 8:55yeah.
- 8:56So, we managed to do some advertising.
- 8:59It's hard to advertise new conferences in general.
- 9:03And then especially now that, like most of the Python, a lot of the Python community
- 9:08is not on Twitter anymore.
- 9:10I'm not.
- 9:11and even if they were, everything is kind of fragmented more.
- 9:14so it was hard to get the reach and get enough, like, CFP.
- 9:18so we had a lot of the proposals, but we did get, a few and, ended up accepting
- 9:22two people from the community that gave just wonderful talks.
- 9:25and it, I saw one on doing PWAs.
- 9:29And what was the other one on the talks?
- 9:32Was it progressive?
- 9:33no, there was one on single page.
- 9:35Sorry.
- 9:35And there was one on observability and then, yeah.
- 9:40PWAs or single page apps and, extension, the extension ecosystem and kind of like the
- 9:45idea around defining plus plugins.
- 9:47And then there's my talk, which was just, the subject of this podcast.
- 9:52Yeah.
- 9:53Welcome people.
- 9:54Yeah.
- 9:55Yeah.
- 9:56That's cool.
- 9:57will it maybe be a PyCon next year?
- 9:59or are you going to branch out?
- 10:01I don't know yet.
- 10:02I think they would accept me back, but I wouldn't want to like, I always, I kind of view the hatchery.
- 10:07I mean, I don't know if this is true, but I kind of view the hatchery as like, we're
- 10:10going to help you get started, but not like keep coming back for the same thing.
- 10:13but I don't want to like, right.
- 10:15Right.
- 10:15Right.
- 10:15Right.
- 10:15Right.
- 10:15I'm a 10 year rookie.
- 10:17You know, you're not a rookie anymore.
- 10:18Get out here with the, or let me, I would still love to run, a conference somewhat
- 10:24selfishly so that I can run one like in San Diego or on the West coast at least.
- 10:29That's what I was going to say.
- 10:30How about San Diego?
- 10:31Then we can, I'm going to come down there and stay by the beach.
- 10:34Yeah.
- 10:35I mentioned DjangoCon before, but they, they stayed in San Diego for three years straight at
- 10:38this, little hotel that was really nice.
- 10:40Had a pool.
- 10:41People just kind of, congregated and it was like 15 minute drive for me.
- 10:45And, so yeah, next year at PyCon, I might not be there.
- 10:49we're expecting our daughter to be born in January next year.
- 10:54Congratulations.
- 10:55And that might take precedence over PyCon.
- 10:57I'm going to have a lot less time in general, which will be, which will come up in other things
- 11:01we're going to talk about, but yeah, I probably like for the first time since 2016 or 2015, I
- 11:07will not go to PyCon probably.
- 11:08yeah.
- 11:09Yeah.
- 11:10But there was a, conference, right?
- 11:12This was the last conference I went to before quarantine.
- 11:14two weeks before quarantine hit, I went up to Los Angeles for PyBeach, which was this
- 11:19very, very small, first time conference.
- 11:22and I just love those like little ones.
- 11:24Yeah.
- 11:25And, I met the organizer, Nick Cantar at, North Bay Python a few times now.
- 11:31And I've told him like, we should try to bring that back.
- 11:33Like I bet, like, I think there's a few other people who are interested as well.
- 11:36And I'm like, it doesn't have to be FlaskCon specifically, but if I could like run some sort
- 11:40of local conference and I can do some flat stuff or attract some flat stuff, you know?
- 11:44Well, I'm pretty excited that, PyCon is going to be in Long Beach, year after
- 11:49next.
- 11:50Yeah.
- 11:51Two years from now, that'll be really nice as well.
- 11:53So that'll be really nice, but maybe you can drum up a bunch of interest and connect with
- 11:57a lot of people who are conference goers of that place, but like encourage them to sign
- 12:01up for a list and like get notified about whatever this other thing is, cause it'll be in the same
- 12:05basic neighborhood.
- 12:06Yeah.
- 12:07So, Jazzy out in the audience asks, can we attend FlaskCon online?
- 12:13this year or this in-person one in 2024, we weren't able to do that, but all the talks
- 12:20are available now on our YouTube channel.
- 12:23If you just search FlaskCon 2024, you'll find it.
- 12:26or pyvideo.org has all of them listed.
- 12:29the last, the first three we ran were purely online, so you could watch them streaming.
- 12:34this year we just didn't have the infrastructure for it.
- 12:37So we couldn't really manage to do a live stream and the recordings at the same time.
- 12:42I was lucky enough to get, Elaine Wong's help doing the recordings and she brought all
- 12:46her special, cool specialized equipment.
- 12:48So we were able to get the recordings up really fast at least.
- 12:51Yeah, that's really good.
- 12:52Are the ones for PyCon even up yet?
- 12:54I don't think they are.
- 12:55Not that I'm aware of.
- 12:56Maybe they're going like really slowly, but yeah, it was really nice.
- 12:58Like we just recorded this hard drive and like, she was like, Oh, you guys timed that,
- 13:03you timed all your starts and stops really well.
- 13:05So all I have to do is like do these like simple cuts and it's all up.
- 13:08From the edges and upload.
- 13:09Perfect.
- 13:10Yeah.
- 13:11Yeah.
- 13:12Yeah. That's really cool.
- 13:13So yeah, I'll link to the playlist of FlaskCon 2024 for folks in the show notes.
- 13:17They can check that out.
- 13:18Awesome.
- 13:19Well, we'll see what 2025 brings.
- 13:21Hopefully some more good conference.
- 13:23Yeah.
- 13:24We might have other like members besides me, attending PyCon as well.
- 13:29So we'll see what happens.
- 13:30Right?
- 13:31Sure.
- 13:32If nothing else, I usually just run out of space or something.
- 13:34So there's always something going on.
- 13:35Yeah.
- 13:36Yeah, for sure.
- 13:37Now I want to talk about the state of pallets in 2024, but surely there are, you know, quite
- 13:42a few people out there who listen, who are really new to Python and programming.
- 13:46You'd be surprised.
- 13:47A lot of people say they use it like this podcast, like language immersion.
- 13:50Like you want to learn Portuguese.
- 13:52You used to move to Brazil.
- 13:53You want to learn Python.
- 13:54You just put on your earbuds and listen until it makes sense.
- 13:57So especially for those folks, like what is pallets?
- 14:00pallets is an open source organization.
- 14:03So we're not a company.
- 14:04but we do have like a team of volunteer open source maintainers who volunteer their free
- 14:10time to work on flask and the libraries that make up flask.
- 14:15So, this portion of talk Python to me is brought to you by Sentry.
- 14:19Code breaks.
- 14:20It's a fact of life with Sentry.
- 14:22You can fix it faster.
- 14:23As I've told you all before, we use Sentry on many of our apps and APIs here at talk Python.
- 14:29I recently used Sentry to help me track down one of the weirdest bugs I've run into in a long time.
- 14:34Here's what happened.
- 14:36When signing up for our mailing list, it would crash under a non-common execution paths, like situations where someone was already subscribed or entered into a
- 14:44invalid email address or something like this.
- 14:47The bizarre part was that our logging of that unusual condition itself was crashing.
- 14:53How is it possible for our log to crash?
- 14:56It's basically a glorified print statement.
- 14:59Well, Sentry to the rescue.
- 15:01I'm looking at the crash report right now, and I see way more information than you'd expect to find in any log statement.
- 15:07And because it's production, debuggers are out of the question.
- 15:10I see the traceback, of course, but also the browser version, client OS, server OS, server OS version, whether it's production or Q&A, the email and name of the person signing up.
- 15:22That's the person who actually experienced the crash.
- 15:24Dictionaries of data on the call stack and so much more.
- 15:27What was the problem?
- 15:28I initialized the logger with the string info for the level rather than the enumeration dot info, which was an integer based enum.
- 15:37So the login statement would crash saying that I could not use less than or equal to between strings and ints.
- 15:44Crazy town.
- 15:46But with Sentry, I captured it, fixed it, and I even helped the user who experienced that crash.
- 15:52Don't fly blind.
- 15:53Fix code faster with Sentry.
- 15:55Create your Sentry account now at talkpython.fm/sentry.
- 15:59And if you sign up with the code TALKPYTHON, all capital, no spaces, it's good for two free months of Sentry's business plan, which will give you up to 20 times as many monthly events as well as other features.
- 16:12That was kind of its purpose when it was created was, hey, Flask has these set of libraries.
- 16:17Armin, the original author of them, was not as involved in them anymore.
- 16:22And like the community, he wanted the community to be more involved in them.
- 16:25So he created this organization.
- 16:26This was right around when I was becoming maintainer two, eight years ago.
- 16:29And so it's kind of the organization that holds those projects and like the team that kind of maintains and sets policies and that sort of thing.
- 16:40So Flask is like the most popular library that everybody ever heard of, followed by Jinja and Click.
- 16:46But then we also have Verksoig, which is the lower level stuff below Flask.
- 16:50And then MarkupSafe and It's Dangerous are two little helper libraries for those things.
- 16:55And then now we've also got Cort, which is the async version of Flask.
- 17:01That's an official palettes project now, even though it started as just kind of a separate thing made by Flask.
- 17:07Yeah, it was an outside thing that Philip Jones worked on and now it's coming closer and closer to being official.
- 17:13Yeah.
- 17:14And like we're doing a lot of work on that to kind of try to unify Flask and Cort as much as possible.
- 17:22So behind the scenes, they're sharing a lot more code now.
- 17:26Cort, like Verksoig is all the low level request response handling for the Flask uses.
- 17:32And Cort wasn't using that at first because it needed like much more async things.
- 17:36But we've managed to develop a lot more things called the term is called sans IO, like without input output, where we have all like the behavior that's common to both.
- 17:48That doesn't require asyncio versus sync processes shared between Cort and Flask.
- 17:54And eventually we're slowly moving in that direction.
- 17:57The idea is that at some point you will not pip install Cort or import Cort anymore.
- 18:03You'll just pip install Flask and then do like from Flask import Cort instead.
- 18:07Oh, interesting.
- 18:08So the library as well once we get to like a point that we're really comfortable with.
- 18:12See you're shipping shipping one thing.
- 18:14Yeah.
- 18:15Will you be able to use the same app?
- 18:17You know, we say add app get or will that be a, will there be a.
- 18:20Yeah, that's, that's the one thing.
- 18:22App F equals Flask and app Q equals Cort.
- 18:25Yeah.
- 18:26You'll still have one single app, but you're going to have to pick ahead of time.
- 18:30We've tried to think of ways around this, but just the way that Flask is constructed means that so much of it is customizable by extensions.
- 18:40And that, that, that those hook APIs that extensions can customize all the extensions out there expect that they're sync, they're deaf, whatever, not async deaf.
- 18:50Right.
- 18:51And, maybe we'll figure out something, but so far we can't figure out a way to unify that into a single object.
- 18:58So you're going to have to still pick.
- 18:59I want to be async first or sync first.
- 19:03And yeah.
- 19:04Yeah.
- 19:05but at least it'll be in one place.
- 19:07Like you're not going to have to decide, oh, I need to know about Cort.
- 19:10You can just look at the Flask docs and see like, oh, I'm going to be doing mostly like, like web requests or like video processing or something that's like the IO intensive.
- 19:18I should pick court or, or I'm just doing like the basic API that everybody makes for their, you know, data science project.
- 19:25I just need Flask.
- 19:26Hopefully it makes it a little easier.
- 19:27Yeah.
- 19:28Yeah.
- 19:29Yeah.
- 19:30Really interesting question out in the audience.
- 19:31Will it, it sounds like it'll work both WWSGI, WSGI and ASGI ASGI.
- 19:37any future where it just goes all, all async, not likely in the short term.
- 19:42It sounds like great.
- 19:43yeah.
- 19:44Like Flask will always be WSGI.
- 19:46because it's so tied to how sync processes work.
- 19:50ASGI has an ability to, and so like, if you use like HyperCorn, which is a popular, ASGI server, which is also by Phil from Cort.
- 20:01you can run a WSGI application as an ASGI application.
- 20:05you don't necessarily get all the benefits of ASGI, but you can at least run it with that.
- 20:11and some, and kind of like in a similar vein, like if you're using Cort, you can write both sync and async things and they all just work together.
- 20:18Yeah.
- 20:19You just, and, and with Flask, you can write async stuff in Flask right now.
- 20:23you just don't get the benefits of ASGI's connection pooling.
- 20:27so you're still doing one worker per request response, but you can in that worker kick off like async, code.
- 20:34Right.
- 20:35Okay.
- 20:36More easily.
- 20:37Interesting.
- 20:38Yeah.
- 20:39I've written a decorator that it decorates both sync and async methods.
- 20:45And it's pretty tricky.
- 20:46There's just basically.
- 20:47Yeah.
- 20:48Jinja has two, two.
- 20:49Yeah.
- 20:50Two rappers.
- 20:51It goes, all right, well, which are you, we're going to actually apply that one to, you know, it's, it's a, it's tricky to juggle.
- 20:55And then the, well, the plugins, like it's gotta be a gnarly combination.
- 20:58Yeah.
- 20:59We're, we're, we're like, basically we're just like taking it in baby steps and we're hoping like, as we keep unifying their code, like their shared code more and more, we can start like discovering.
- 21:08Like discovering like good patterns for writing an extension that works in both, for example, and documenting those and maybe helping, some extensions, that are popular update to that.
- 21:19yeah.
- 21:20And so it's a slow process, but like it's surmountable.
- 21:23Yeah.
- 21:24Maybe you get to a point where they're close enough.
- 21:26You're like, oh, now it's really obvious how these things.
- 21:28Yeah.
- 21:29You know, by the beginning it wasn't right.
- 21:31Okay.
- 21:32So what's the state, how are things?
- 21:34What's the state?
- 21:35maybe start with the big, the big boy flask and inbox zero is like one of the biggest takeaways.
- 21:40Inbox zero.
- 21:41That was, it was actually, that wasn't 2024.
- 21:43That was the 2021 or 22, I think.
- 21:46But, I, yeah, we don't have like true zero most of the time, although I do get down to it every now and then.
- 21:53but, I did hit inbox zero.
- 21:56So when I first started maintaining all these libraries, I think combined, there was probably over a thousand open issues and PRs.
- 22:03and that's a nightmare.
- 22:06If you know all the code, like if you, if you were the author, but I was not the author of this code.
- 22:10Like, so I was both unfamiliar with the internals of all these libraries and like had to keep track of all these issues.
- 22:17So I was like learning libraries, learning how to be a maintainer and trying to keep track of like all these requests.
- 22:23Going back and forth and like competing PRs and all that sort of stuff.
- 22:26So it was, early on, it was a goal I identified of like, I just need to make this manageable.
- 22:31And, once I got there, it's become a lot easier.
- 22:34Like once you're at inbox zero, it's a lot easier to keep it.
- 22:37Hovering.
- 22:38I really feel in, I'm feeling rough about my true inbox.
- 22:41I'm looking at like five or six persistent emails.
- 22:43I really got to get back to you, but it's a whole different deal than if it's 10,000.
- 22:47Did you declare, any sort of bankruptcy equivalent of like inbox bank or you just go like archive.
- 22:53A good, like if it's two years or older, I'm just going to archive it and it'll come back if it matters.
- 22:57Or did you literally go through everyone and deal with it?
- 23:00I did go through everyone individually.
- 23:03I didn't just blanket say everything older than two years is closed.
- 23:06yeah.
- 23:07But I did kind of treat things as like, I don't like stale bots.
- 23:12So we don't run a stale bot.
- 23:13Like, yeah, I don't like those either.
- 23:14Yeah.
- 23:15Yeah.
- 23:16Like I don't object to things being closed, like as the resolution versus fixed, but I want like somebody to be making that decision.
- 23:25right.
- 23:26Right.
- 23:27And put a reason behind it.
- 23:28so yeah, I tried like going through every single issue.
- 23:32Basically my workflow is just every single day, pick an issue, work on it, like pick another one.
- 23:38Okay.
- 23:39It's been a couple hours.
- 23:40Wait until the next day.
- 23:41And, yeah, just like had to keep making calls on them.
- 23:44Yeah.
- 23:45Like, all right, two come in a day.
- 23:46I'm going to do 20 a day until I catch our sounds like that.
- 23:49Right.
- 23:50There was a lot of stuff also where it was, it had just been sitting open for years, you know, and nobody had really commented on it besides like, or maybe they had the most people that commented on was saying like me too, but they hadn't actually like moved the discussion forward.
- 24:06And yeah, I, you know, it would be nice if open source, if like more people like contribute, I don't blame anybody for not like contributing, you know, or being a contributor, but I would love to like attract more long-term contributors and stuff.
- 24:19But that's like kind of the way it starts is you need to like help people like make calls and stuff, evaluate things.
- 24:24Right.
- 24:25you know, instead of saying me to start looking into it and saying like, okay, me too.
- 24:29And okay, here's all the like issues that might come up when we do this, or I looked at their code base and we could do it this way.
- 24:35Yeah.
- 24:36Right.
- 24:37Exactly.
- 24:38We weren't doing that.
- 24:39I also want it, but I want it.
- 24:40And I think here's a path forward or here's a, you know, like they have to advance the conversation.
- 24:44and that wasn't like happening in a lot of the old issues.
- 24:47So I did kind of like, I didn't already just close old issues, but like, I did say like, okay, this thing is old and it hasn't seen any movement or like, there's a lot of things also where it's like, yeah, it's a reasonable request, but is it necessary for flask?
- 25:01Does it belong in flask or an extension?
- 25:03Right.
- 25:04Like this is something I'm trying to figure out.
- 25:06Like, I want to be writing like documentation for other maintainers on the team, you know, so they understand like how I did this sort of stuff.
- 25:14And it's really, this is like the trickiest problem.
- 25:16I don't know how I'm going to document yet, but like, I got a sense over time of just like being able to really quickly make a call of like, yes or no.
- 25:23One thing, like I can look at an issue and say like, okay, no, this doesn't belong in for X, Y, Z or something.
- 25:31because like flask had like all the libraries in palettes have like very focused core, like goal of them.
- 25:38And, they try to be extensible to some degree.
- 25:40So a lot of the things you can do by making extension.
- 25:42so really what I try to look for is like, I need this thing in flask because it is literally not possible to write an extension to do this without being able to like hook into it this way or something like that.
- 25:52No, that makes sense.
- 25:53Sure.
- 25:53And part of the Zen of flask is that it's minimal and then you build around it.
- 25:59You pick your database, you pick your whatever, and then go from there.
- 26:02Yeah.
- 26:03Yeah.
- 26:04Cool.
- 26:05All right.
- 26:06Well, three, three open issues and incredible as, as in 67,000 stars.
- 26:10That's also pretty incredible.
- 26:11let's see.
- 26:12So you join each one of these different ones.
- 26:14You kind of gave a sense of like how many downloads.
- 26:16So for flask, maybe these numbers changed, but I think it hasn't been about a couple of months.
- 26:20It's around 75 million downloads a month.
- 26:23That's a, that's a hefty chunk of user base there.
- 26:26Yeah.
- 26:27I occasionally look at pypi stats.org or pepi.tech, are the two like websites that track these numbers.
- 26:35so I can look at the current flask is downloads in the last day, 3.15 million downloads in the last month, 66 million.
- 26:46okay.
- 26:47It's that much time.
- 26:48People are telling.
- 26:49Yeah.
- 26:50Look at that.
- 26:51Look at that.
- 26:52Yeah.
- 26:53Yeah.
- 26:54And there's like, sometimes there's like random, you can see in this graph here, like there's just random times where it just suddenly drops by like a couple of hundred thousand or right or rises.
- 27:03Yeah.
- 27:04Like if you look at the left half of this graph, it's higher.
- 27:06Like, I think that's just because like big services like come in and out of existence or like do an upgrade or whatever.
- 27:14so there are some like very big systems out there that are just download doing a ton of downloads.
- 27:20Yeah, it's pretty wild.
- 27:21It's definitely wild.
- 27:22You'll probably also spot some pypi outages.
- 27:24Well, I imagine in that graph, which is got nothing to do.
- 27:28And like they also change the way they report over time, like pypi pip and stuff change how they report statistics.
- 27:34So, okay, I usually just look at like the overall numbers pretty consistent.
- 27:39Yeah.
- 27:40Try not to look at it too often.
- 27:41Like I said at the beginning, like it's a, it's a big number to know that like this many people are about to download any change you make.
- 27:48yeah, and when I think about these kinds of numbers, it's not just if you make a change to flask, then it affects this many people.
- 27:55But these are themselves applications using this, each of which has many, many, many users potentially.
- 28:01So there's a multiplier on top of this, right?
- 28:04Yeah.
- 28:05And, yeah, that's been, that's, that's been difficult.
- 28:07That's one of the other state of flask.
- 28:09that's the other half of the state of flask is like, we've been making a lot of progress, but like this amount of responsibility, rests.
- 28:17pretty heavily on it.
- 28:19It's like, it can be pretty stressful.
- 28:21and you did mention a baby and being potentially tired in the future and stuff like that as well.
- 28:26Yeah, exactly.
- 28:27but like combined, you know, these numbers combined with the thought that anything I do could break a bunch of people and get them to complain at me or people will complain at me, even if I don't break a ton of people.
- 28:38And, just kind of like the ever present notion of, we are not at inbox zero on some of the projects and stuff.
- 28:45So there is still a lot of open stuff.
- 28:47It's, yeah, it's a lot of stress for me.
- 28:49And it's been, I've like suffered burnout a few times from, per year for the last four years or so.
- 28:55Oh man, that's rough.
- 28:56are you getting some support from the other people at the Oregon potentially from?
- 28:59Yeah, I, I, I, there is, there are other people on the team.
- 29:03So it's not like we're a bus factor of one in the sense of like, if I was not here for some reason, other people would have access to these things and could keep them going.
- 29:13But the reality is, not to downplay all the work that they do in the community and, when they, when they are working on code, but like I do probably 90% of the code and like the decision making and all that sort of stuff.
- 29:27Right.
- 29:27So it would definitely be a very different project if I wasn't around.
- 29:31It would at minimum be a scramble.
- 29:33Right.
- 29:34Like when Guido stepped down, like, wait a minute, who's doing what now?
- 29:38Yeah.
- 29:39So like I, I, so this is what I've been like trying to work on for a long time because I've, kind of always recognized that, I've been kind of the, not limiting factor, but like the, I'm like the point of failure in this thing.
- 29:53and so I've been trying to grow the team and, trying to make our processes more automated, you know, try.
- 30:00now what I'm trying to do is, because I know I have this hard deadline in January when I'm going to have less time, is I'm trying to document how to do what I've learned to do.
- 30:11like how to be a maintainer is something we don't really have a lot of, it feels like is, and we have contribute, we have a contributing guide, right.
- 30:19Or we have user documentation or developer guide, like how to use flask, but we don't have a, how to maintain flask documentation.
- 30:26Yeah.
- 30:27Yeah.
- 30:28It must be kind of missing from the community in general.
- 30:30Yeah.
- 30:30I, I presume that'd be out in public.
- 30:32People interested could check it out whenever that gets written.
- 30:35Oh yeah.
- 30:35It's, it's not like a private, it's not gonna be a private thing, but, it's not, it's not ready yet, but it's something I'm actively working on.
- 30:41It's like, identifying like all the stuff I've accumulated in my head and what I've learned how to do or decisions I've made or like services we use.
- 30:52Like just the fact that, oh, you know, we're part of the PSF.
- 30:55This is how you contact the PSF.
- 30:57Yeah.
- 30:58Right.
- 30:59It's not written down.
- 31:00Yeah, exactly.
- 31:01Or like that we're part of Tidelift and you know, these other, donation sources.
- 31:07Yeah.
- 31:08Also like stuff like how, how do I make a decision on whether to keep something closed or open or, when is it time to make a new release or what is our version policy or our support policy or our security policy?
- 31:20Like a lot of these things are, under documented right now if they're documented at all.
- 31:25And, so that's kind of my goal for the rest of this year as is to like make pallets more sustainable, regardless of, how much availability I have.
- 31:34Maybe a little more systematized maybe a little bit.
- 31:37Yeah.
- 31:38so before we move off of PI PI stats, Goosra has an interesting meta question.
- 31:42Is PI PI stats built on Flask itself?
- 31:45Do you have any idea?
- 31:46I have no idea.
- 31:47I know they're open source.
- 31:50Oh yeah.
- 31:51Okay.
- 31:52So maybe you could tell that way.
- 31:53I was gonna say there's not like a header or something that Flask sends.
- 31:55So, yeah.
- 31:57I can't find it.
- 31:58Yeah.
- 31:59We don't know.
- 32:00It is open source.
- 32:01Oh, here we go.
- 32:02Here we go.
- 32:03We've got a requirement.
- 32:04We've got a project.tomo.
- 32:05Yeah, it's flask.
- 32:06There you have it.
- 32:07How about that?
- 32:08There we go.
- 32:09Beautiful.
- 32:10It's very rewarding every time I, every time I find out a new place that like, like,
- 32:15just decided to use Flask and has been using it and it's just completely behind the scenes
- 32:20and you can't tell like nothing's like, it's all just working.
- 32:23Yeah.
- 32:24But I love, like, I love going to like conferences for that reason too.
- 32:26Cause so many people come up to me and like say like, Oh yeah, we use Flask to like run
- 32:30the Mars Rover or, somebody, one of the, one of the people giving a talk at
- 32:38Flask on it was like my company, writes the like energy management software for this conference center.
- 32:47And it's in Flask.
- 32:48It's very fun to learn all those new, no uses.
- 32:51Have you ever gotten onto the JPL?
- 32:53I know it's like a blowers drive.
- 32:55That'd be fun, right?
- 32:56To go out there and actually see the Flask.
- 32:58I would see it.
- 32:59That's what runs in the Rover and the helicopter.
- 33:01Awesome.
- 33:02All right.
- 33:03So that's Flask.
- 33:04what one do you want to talk about next?
- 33:06Next on my tablets, I got Jinja.
- 33:07We can go wherever you want.
- 33:09So like maybe that a good foundation.
- 33:10Yeah, we did, like Flask and Variksberg are pretty tied, because most of the stuff that people report to Flask is actually an issue with one of the other libraries that Flask is using.
- 33:21And most often that's with Variksberg.
- 33:23So you can see we're not at inbox zero.
- 33:25We're at inbox nine right now.
- 33:26That's still, that's incredible.
- 33:28you know, maybe like I asked you to explain palettes like Variksberg, you know, that's probably not how English speaking folks would say that.
- 33:35Workzoyger, Workzug or something, right?
- 33:38But Armin, the creator of this is German or Austrian, but speaks German.
- 33:42And so that's the German pronunciation.
- 33:44And hence, that's why we're saying it that way.
- 33:46Right.
- 33:47That's my best approximation of the, I'm sure I'm doing it wrong also, but, pretty close.
- 33:51Yeah.
- 33:52It literally is like, it means like work thing, which is like, yeah.
- 33:56Yeah.
- 33:57Yeah.
- 33:57Basically tool.
- 33:58Yeah.
- 33:58It's like tools, like work, work, work, your carpentry tools or yes.
- 34:02Handyman tools type thing.
- 34:03Yeah.
- 34:04This is, this was written before, before flask existed.
- 34:07And it's, it, I think it was written more when like WSGI was like, was becoming a spec or had just become a spec.
- 34:14because it is just a bunch of utilities for doing HTTP header parsing, doing all the low level WSGI, environment management, wrapping that information in request and response objects.
- 34:27So you can kind of work with them a little easier.
- 34:30so it's all like the underlying tools that you need, to build flask.
- 34:36there's also like the whole routing system, you know, so you can, in flask, you just do at app dot route, but behind the scenes, what that's doing is it's adding it to a, route map that very so like defines.
- 34:49And that defines like, here's how we actually like collect that and like turn it into a bunch of rules that we can match URLs against.
- 34:55And there's other things in there as well.
- 34:57The reloader, the debugger, the dev server.
- 35:00So one of the updates you gave on Vexo is, performance improvement by way of getting rid of the stir bites duopoly.
- 35:10Yeah.
- 35:11I've been doing a lot in Vexo.
- 35:13So that, that one and the, URL of one that we'll talk about, were two big things, but basically like this library, like I just described it.
- 35:21It's like just a huge collection of tools and little utility functions.
- 35:26And there, there was a his, there's a history there because when this, when all these libraries first started, Python three didn't exist or barely existed.
- 35:34And so everything was written originally for Python two, where strings and bytes worked a lot different.
- 35:41it was one of the primary breaking changes.
- 35:45There were other changes, but that was the, that was the long, the one that people really had a long live bug tracking, you know, if it's different syntax, you just change the syntax.
- 35:54But if it's subtle behavior changes, then trouble looms.
- 35:57Yeah.
- 35:58and so, yeah, in Python two, it was much easier to like, like, well, not, yeah, it was easier to treat like incoming data as bytes, but like treat it as a string.
- 36:08There wasn't like as big a distinction between strings and bytes, which was convenient in some ways, especially for like low level tools like HTTP, where you just work in ASCII bytes.
- 36:18Yeah.
- 36:19So I was gonna say if you like ASCII, it's probably fine.
- 36:20If you don't like ASCII, you might not like it so much.
- 36:22Yeah.
- 36:23But it also like cause like, like, like I first learned Python three.
- 36:27So I like, I have a kind of difference on this, but I like, I like Python three's distinction.
- 36:32I think it's much better to have that distinction.
- 36:35Yeah. You and me both.
- 36:38but at the time, like when it was first happening, it wasn't as clear cut, like, oh yeah, this is better or this is easier because you had to support both.
- 36:45And, so when Python three came out and started getting like more momentum, all these libraries tacked on, support for both Python two and Python three, which among other things meant that you had to now check for like, whether you were getting strings or bytes everywhere.
- 37:03because you might be in Python two land where you might be in Python three land where you're getting strings and need to like do other conversions.
- 37:10So it was especially bad because it's a collection of like kind of independent utility functions.
- 37:16some functions build on each other, but every function could potentially be imported and used for its own little piece of functionality.
- 37:25And so every single function needed to check all its arguments for like, am I a string or bytes?
- 37:30So even if most of the time, especially nowadays, people aren't using VaricsOic directly and all these tools, they're using flask, which just does the right thing from the get go, which means all those intermediate checks on the way are totally unnecessary.
- 37:42You know, because you already knew from like the first function that it's already testing 10 times for the same thing down the cross.
- 37:48Right. And this was just pervasive throughout, VaricsOic was just everywhere with all these unnecessary checks.
- 37:54And it made the code more complex to maintain reason about made the like execution slower.
- 38:00there's kind of a, another thing going on at the same time, which is like we had, because we could support like, because we were working with bytes in a lot of places.
- 38:09there was also like a lot more support for, well, maybe the data is encoded in this encoding or this one, but nowadays everybody like I looked at before I made this decision, I looked at stats.
- 38:21everybody, 99.5% of people, web applications on the web right now are using UTF-8.
- 38:28So they're never dealing with other encodings.
- 38:30And UTF-8 can encode everything.
- 38:32Yeah.
- 38:33and, so like BericsOic was doing all these things about letting you pass encodings all over the place.
- 38:38And switch between things.
- 38:40And that was also complexity.
- 38:42So finally decided, okay.
- 38:44I had heard some anecdotes as well, from people who had switched from using Python 2 to Python 3 or had stuck with Python 2 and old versions of BericsOic because they had noticed a significant performance difference in the first versions of BericsOic that added that 2 and 3 compatibility.
- 39:00and so I figured, okay, I'm going to get a similar speed up if I remove that now, now that we don't support Python 2 at all.
- 39:07that was very complicated.
- 39:08I basically like just had to go through every single function and start removing it, run all the tests, see what failed, pick another function to keep working on and just slowly, slowly pull it all apart.
- 39:20but I did end up with, so now BericsOic just supports strings everywhere except in the very few places where it works directly with the request and response data, where it, like, it was like.
- 39:33Right.
- 39:34Like multi-part form file.
- 39:35Yeah.
- 39:36When you first get the request in and it's just the raw body that you might turn into JSON or form data, et cetera.
- 39:42or, when you're finally producing the response and taking like either file data, which is binary or, you know, string data and turning it into the bytes.
- 39:52that's the only place now where it deals with bytes everywhere else is strings.
- 39:56And the boundary there is always UTFA.
- 39:59and if UTFA isn't your thing, it's not, we're not preventing you from using other things.
- 40:03It just means that when you're at those boundaries, you pick the new, you know, you can take the bytes directly and work with them.
- 40:10Cool.
- 40:11surprisingly I have gotten, like, this was a huge, massive change and I have not gotten any bug reports about it, which I'm just, I was, I was like, I was stressing so much about like, okay, this is huge.
- 40:23I mean, we tested it first and, like maybe the releases and everything, but those go to almost no attempt.
- 40:29Talk Python To Me is partially supported by our training courses.
- 40:33Do you want to learn Python, but you can't bear to subscribe to yet another service at Talk Python training?
- 40:39We hate subscriptions too.
- 40:41That's why our course bundle gives you full access to the entire library of courses for just one fair price.
- 40:46That's right.
- 40:47With the everything bundle, you save over 80% off the full price of our courses.
- 40:52And you own them all forever.
- 40:54That includes the courses published at the time of purchase, as well as courses released within about a year after the bundle.
- 41:01Stop subscribing and start learning at talkpython.fm/everything.
- 41:06All right.
- 41:08I can't leave the house for the next week.
- 41:10Publish.
- 41:11Yeah, no, like you joke, but like, seriously, when I hit the publish button or when I used to hit the publish button, I would be like, I want to go for a walk now because I just did a ton of work and I just want to clear my
- 41:22head, but oh God, then an hour from now when I get back, what is my inbox going to look like?
- 41:27Yeah.
- 41:27Yeah.
- 41:28Yeah.
- 41:29That's great.
- 41:30And you know, you talk another part of your presentation at FlaskCon was about project level stuff.
- 41:37And you also talked about the systemization type of thing you're looking for.
- 41:41So one of the things you switched to is the trusted publishers.
- 41:44That's kind of cool, right?
- 41:45Yeah.
- 41:46Yeah.
- 41:47So I mentioned a little bit about like when we were talking about, sorry, when we were talking about pinning requirements, I was saying, oh, you know, it makes it a lot easier for every contributor to work on things at sprints if every single environment is the same.
- 42:03And so kind of on a meta level, I, there's a lot of like different tools and configurations and workflows we use across projects.
- 42:13But they've kind of been developed over time as I've learned them.
- 42:17And so I've been doing, I've been doing work on like a meta level.
- 42:21So every project now, if you go look at Flask and Verksoeg and Jinja and you clone, clone all the repos, all the repos look exactly the same.
- 42:28And they all have the same files, the same directory layout, the same tool configurations, et cetera.
- 42:34Because just like it should be easy for every contributor to get the same environment, it should be easy for anybody who's used to contributing to Flask to go over to Verksoeg and be just as comfortable in that project.
- 42:44It's the Flask way and it all goes the same, right?
- 42:47Mm-hmm.
- 42:48So yeah, like trusted publishing, that was another big part of this was like making workflows.
- 42:54So we have a workflow for running tests, for example.
- 42:57But publishing used to be a very manual process.
- 43:01And it's evolved over the years too, because we were on Travis before.
- 43:04And then we needed to make like Windows builds for MarkupSafe, which has wheels.
- 43:10So we were on AppVayor also.
- 43:12Then Travis went away and stuff and GitHub Actions became more.
- 43:16And so, but like that was all for tests.
- 43:18Like for building, we basically, when we wanted to make a new release, it was way harder in the past, which is why releases happened less often.
- 43:31So we had to do all the little bookkeeping stuff to like set the release version and the release date and everything.
- 43:36Now I have to go get my Mac, get my Windows machine, get my Linux machine, make the builds on all of them.
- 43:42Oh my gosh.
- 43:43So we can manually like consolidate them, upload them manually to PyPI, etc. and make sure that all worked.
- 43:49So what I have now is they have a standard publish workflow on every single project.
- 43:54It works exactly the same way.
- 43:56And you make a PR so that you can see all the tests run.
- 43:59You know, you make a PR that just does that version bump and the date, you know, says the release date.
- 44:03You watch all the tests pass and then you push a tag before you merge, you push the release tag and that kicks off the build workflow.
- 44:10So we run our build.
- 44:12We do SLSA or SALSA out of station, say like these are, these builds are associated with these commits in Git and were built by these workers.
- 44:22It's kind of like a supply chain level thing.
- 44:24And then we automatic, like it will collect all that stuff, show you here is the release.
- 44:30Like here's a draft release for this here.
- 44:33Like you have one more opportunity to look at the files and then a maintainer can go in and click publish in GitHub's UI.
- 44:39And that will kick off like, okay, maintainer said everything's good.
- 44:43We're just going to upload it now.
- 44:44And that's all automated.
- 44:45You don't, we're using the trusted workflow, trusted publishing workflow between PyPI and GitHub.
- 44:51So I no longer have to have my password stored locally for PyPI or have like tokens made for each project.
- 45:00All the authentication happens between GitHub and PyPI automatically and securely.
- 45:05It's pretty cool.
- 45:06If you go look up like trusted publishing on PyPI has like a blog or documentation that explains it.
- 45:11But it is really, really convenient.
- 45:14And it makes like this whole workflow means that whenever I want to make a new release, I just make a regular PR, push a tag and then see everything pass and say, yes, we're good.
- 45:23So I just basically have to push three buttons now.
- 45:26Yeah, that's fantastic.
- 45:27Which makes it a lot easier to just make more regular releases.
- 45:30Like even bug fix releases.
- 45:31I was always unwilling to make them fast because it was so much work.
- 45:34Well, if it's a matter of just pushing, pushing a commit and then saying, okay, you're way more likely to quickly ship fixes and ship smaller releases and all sorts of stuff.
- 45:43It's really good.
- 45:44So you don't have the whole supply chain problem of your machine somehow got hacked.
- 45:49But then now when you do your build, somebody's injected something gnarly into the wheel, right?
- 45:54Because it never goes through you.
- 45:55It just goes from GitHub directly to PyPI through GitHub actions, right?
- 45:59Yeah.
- 46:00And GitHub added their own.
- 46:02So the SLSS attestation that I was talking about, if you scroll down on this screen, you can see that multiple.intoto.jsonl.
- 46:12If you click on it, it's just a big blob of text.
- 46:15But that's basically describing here are these wheel files, like those wheel files and SDISD files.
- 46:20And here's like signatures and about like the GitHub environment that built this and everything.
- 46:27GitHub itself is adding that similar sort of attestation.
- 46:30And then PyPI is also adding more attestations.
- 46:34It's not out yet though, but I'm sure I'm testing it once they're starting it and release it in beta.
- 46:40So being able to attest that like our build environment was consistent with what the artifacts you're seeing and like the upload along the way was secured and like it is gaining more, like that's more getting more attention nowadays.
- 46:54Yeah, that's really trying to keep it all.
- 46:57It's excellent.
- 46:58It's also makes it easier to hand it over to someone else and trust that they're doing it right.
- 47:02Not like something new.
- 47:04Oh, they only like windows seven.
- 47:05So you got a weird wheel or something now.
- 47:07Yeah.
- 47:08Yeah.
- 47:08I mean, this.
- 47:09Yeah.
- 47:09This line is on.
- 47:10It's like was such an impediment to finding other maintainers because you had to teach.
- 47:14Like, I think I probably had some document that explained how to do this build before.
- 47:18Like all the steps I went through, but it was like it was so complicated.
- 47:22And like, yeah, if somebody else wanted to make a release, I would have to make sure they did everything correctly.
- 47:27I had just gotten used to it.
- 47:29It was like wrote for me, but it was a lot of steps.
- 47:31Yeah.
- 47:32Now it's just anybody does the same, you know, make a PR, push a button.
- 47:36Everything else is done for them.
- 47:37Yeah.
- 47:38Yeah, that's awesome.
- 47:39All right.
- 47:40So the two takeaways that I got from Virksog's update was this dropping of the two to three juggling
- 47:46made it 50% faster for request response.
- 47:49And URL lib is no longer URL lib-ish.
- 47:53Yeah.
- 47:54Yeah.
- 47:55So that was the other part.
- 47:56If we're going back to Virksog.
- 47:57So we removed the string bytes, testing all over the place.
- 48:02And Virksog, this was again, historically because of like Python two versus Python three differences
- 48:08and then compatibility and stuff.
- 48:10But another of the changes in Python three was URL lib.
- 48:13In Python two, there was like URL lib and URL lib two.
- 48:17And that's why there's also the project URL of three.
- 48:19Yeah.
- 48:20But Python three kind of consolidated that back into URL lib with sub packages instead.
- 48:26And so it kind of changed the interfaces and where everything was.
- 48:30So at the time it made sense for Virksog to just copy that code into our own code base
- 48:37and then make our own tweaks to it to be compatible with everything.
- 48:42And, but what that ended up meaning was we had an entire copy of URL lib with our own tweaks in our code base.
- 48:49And then we weren't keeping up with changes.
- 48:52So like CPython has a, has like a hundred different core devs on it.
- 48:56I mean, they're not all paying attention to URL, but they're making regular, you know, security updates or just performance improvements and that sort of stuff.
- 49:04And we're not getting any of those benefits because we now have like this vendor copy that we've changed ourselves.
- 49:08We couldn't even bring in the changes.
- 49:10And just like the string bytes everywhere, it, it having that our own copy of that really complex low level code made it harder to reason about the code and be like maintain it.
- 49:19And all this stuff is kind of like, it's not the essential parts of Virksog.
- 49:23Virksog is like trying to be the WSGI utilities and stuff.
- 49:26It's not trying to be like every single possible, like it's not trying to, we don't need to make our own URL of utility, everything to be Virksog.
- 49:33Yeah.
- 49:34So that was another big one where identified like, okay, this is just a lot of complexity.
- 49:37I didn't actually expect this to be a performance improvement, but when I actually went through and removed URL lib and our own copy and replaced it with Python's version, we got like a 30% speed up just on our own.
- 49:52So the combined of those two big changes was like about a 50% speed up in our request response handling.
- 49:57Yeah, that's awesome.
- 49:58Like it turns out that the, like Python's implementation of all this was just faster than ours.
- 50:04And it's still, you know, does all the same things.
- 50:07Yeah.
- 50:08So now you don't have to mess with it.
- 50:09You get it for free.
- 50:10Yeah, exactly.
- 50:11Like everyone else.
- 50:12We can, like the, a lot of these changes, a lot of the changes in all the libraries, stuff where I've been, you know, like, like I said, I wasn't the original author of this stuff.
- 50:22So I've had to like, learn the code bases.
- 50:25I've had to like dig into them and say like, what is written here?
- 50:28Why is it written this way?
- 50:29How is it all related?
- 50:30And along the way, I just keep identifying like, okay, this is the actual, you know, purpose of this library.
- 50:38Does this fit into that purpose or can we be doing something different?
- 50:42And so kind of trying to like slim down the libraries and like focus, tighten up their, the focus on their like purposes more.
- 50:50Right.
- 50:51If there's parts that are, it needs to work, but it's not its purpose.
- 50:54Maybe that can come from somewhere else.
- 50:55Yeah.
- 50:56Yeah.
- 50:57All right.
- 50:58Yeah, absolutely.
- 50:59We've got about 10 more minutes.
- 51:01Okay.
- 51:02Probably.
- 51:03So what else do you want to cover to, to, to, to, the state?
- 51:07There's there, I'll mention, Jinja and click really briefly because, these two libraries are also huge.
- 51:14They're used everywhere.
- 51:15downloaded a ton.
- 51:16Jinja is a templating library.
- 51:18you write template files and then you can render them with, you know, variables to produce output.
- 51:23HTML, you know, but also like text files or all sorts of stuff.
- 51:27yeah, I think people, yeah, I think people pigeonhole Jinja2 much.
- 51:33They think, okay, well I'm generating dynamic HTML from a server request.
- 51:37Like you can use Jinja to generate all sorts of files.
- 51:40I use it on, stuff basically on, Python generate like emails.
- 51:46Somebody wants to reset their password, right?
- 51:48Like I'll generate an email body from it, for example.
- 51:51Right.
- 51:52That kind of stuff.
- 51:53Yeah.
- 51:54And then click is a, just like flask is a framework for web applications.
- 51:57Click is a framework for command line applications.
- 51:59and both of these libraries have gotten a lot of attention from me, but they are not at inbox zero.
- 52:06Unlike the other libraries, I have not managed to get them down there.
- 52:09because I was working on all the other libraries.
- 52:12And, so these are where I'm like going to need to focus.
- 52:17like I said, like, like my current focus for the rest of this year is writing maintainer documentation.
- 52:22So I'm trying to do less code and all of these libraries are stable.
- 52:25Everybody downloads them.
- 52:26Like a ton of people download them.
- 52:27They all work.
- 52:28You know, we can make them better and everything, but they're not in like, it's not like they're, immediate danger or need of anything.
- 52:34But I do want to like clear out the backlogs of those as well.
- 52:38And, you know, looking for more contributors for that, help with that.
- 52:42you said you're looking for contributors who are really psyched about typing and also for God, if anybody isn't, if anybody knows, like is an expert in typing and like type annotations and static type tools.
- 52:55All the libraries do pass my PI strict tests and, export.
- 53:01they're like, we do do some testing against PI, right?
- 53:04To some degree.
- 53:05but I'm just typing.
- 53:08Just, it's very hard for me to understand.
- 53:11Like it's a very complicated, subject on its own versus all the other stuff I have to be doing.
- 53:17So I really would like somebody who's like, I am an expert at typing.
- 53:21I'm going to like start fixing up what you're, cause I like had to, I had to learn typing as I was like adding it to these libraries.
- 53:28yeah, yeah, that's a big thing that we can improve.
- 53:31okay.
- 53:32Yeah.
- 53:33And yeah, you know, there's like, we've gotten a lot of attention, a lot of the stuff in click and Jinja also, we have PRs for a lot of stuff.
- 53:40It's just a matter of me having the time to go through and review all of them to cut down that backlog, but we're getting there.
- 53:45I'll get there eventually.
- 53:46Yeah.
- 53:47Beautiful.
- 53:48and then the last, so the last thing I want to mention, or we ran out of time completely is, besides pallets, the core projects itself.
- 53:55I've kind of mentioned this theme of trying to make the projects more maintainable and grow the community and the team.
- 54:02And part of that that I've started identifying is, the greater ecosystem around these projects.
- 54:09so flask is great to use on its own, but it's made even better by all the extensions out there that people have written, you know, for doing email, doing database stuff, authentication, all sorts of things.
- 54:24and just like flask itself, you know, and all those libraries, there was a long period where they weren't getting as maintained, you know, as much attention and stuff.
- 54:34And then I started stepping in, a lot of those extensions were written quite a long time ago now.
- 54:39And the maintainers of those have kind of moved on to different things.
- 54:43And so there's a lot of stuff in the ecosystem that isn't getting as much attention as it needs.
- 54:47And a lot of the times, maintainers are aware of this and they're willing to like say, like to take help, you know, to, to get help with those things.
- 54:56And so, I was really inspired by a project for Django extensions called Jazzband.
- 55:01Oh yeah.
- 55:02we're basically they're an organization that says, are you a popular Django extension or pip or pip-tools?
- 55:09For some reason they also control pip-tools, but, do you not have time to be the maintainer of it anymore?
- 55:14come over to Jazzband.
- 55:17We'll you'll, you'll still be like, you can still be involved in the project, but we'll also help you find more people from the community.
- 55:24Like we will open up the maintaining, the maintain, maintaining process to your interested, you know, users in the community.
- 55:32and so I'm doing a similar thing with pallets called pallets eco or ecosystem.
- 55:37Okay.
- 55:38so if you don't go to github.com/pallets, eco, yeah.
- 55:42Yeah.
- 55:44Yeah.
- 55:45Pallets, dash eco, GitHub.
- 55:46What we've started to do is reach out to, maintainers of like, well flask, SQL, Alchemy flask, admin flask, security flask, mail, blinker caching, debug toolbar, like all these huge extensions.
- 56:00So many of them, have these huge backlogs just like flask and all the other projects did when I got started with them, you know, and, their, their maintainers are overwhelmed.
- 56:08And so I reach out to them.
- 56:10I've been reaching out to them and, you know, kind of explaining, Hey, we're, we're starting this thing up.
- 56:14Do you want to add your project?
- 56:15so we've had some successful already.
- 56:18we've had people at sprints contribute to them.
- 56:21And, like I was talking about, I've kind of standardized.
- 56:24How flask and the other projects look like all the tools they're using the layouts they're using the workflows they're using.
- 56:30I'm taking that same approach and trying to standardize all the extensions we get to.
- 56:35so the idea is that anybody who's used to contributing to one of these extensions should, it should be just as familiar to them to jump into another extension and contribute there as well.
- 56:45Right.
- 56:46That's a great idea.
- 56:46Yeah.
- 56:47and so with pallets eco, we can help find maintainers, from the community, add them, but the core team for pallets themselves still has access as well.
- 56:58So, you know, if we make some change to flask that finally removes something that some, like some internal thing that somebody was relying on and like suddenly this popular live extension no longer works.
- 57:10We at least have access.
- 57:11Like we're not, we're probably not going to take on the responsibility of being the like core maintainers of all these things, but we can step in and make an emergency release that just, Oh, you just needed to change this line here.
- 57:20Make a bug fix release really quick so we can at least keep the ecosystem going while we like work on finding longer term sustainability with more maintainers.
- 57:29I love that idea.
- 57:30Cause a lot of times it is a really small change, but if it doesn't work, it doesn't work.
- 57:34Right.
- 57:35Right.
- 57:36Exactly.
- 57:37Like a lot of the times it's been like, I like we have made like little deprecations and then remittles and stuff, which have just, that was the one thing that some random extension was relying on that every, like half the ecosystem ended up relying on.
- 57:48And we just had to let you know, change a line or change an importer or add an argument.
- 57:52Yeah.
- 57:53So yeah, like that's, that's my big focus.
- 57:55Now, if people are interested in contributing to pallets, they're welcome to, you know, contribute to like Jinja and click or any of the projects as well.
- 58:03If there's open issues, they can work on them, but like a huge new source of like involvement for people can be, what are the extensions you're using?
- 58:11Let's get you involved in those as well.
- 58:13Yeah, it makes a lot of sense because to make a change to flask is, it's a highly polished piece of software, but the extensions potentially are more open to just jumping in and getting into it.
- 58:25Yeah.
- 58:26It's really, it's really hard for people.
- 58:27It's hard to tell people this, but like, you know, people come in excited, like, Oh, I want to contribute to flask.
- 58:32And then they look at it and they're like, Oh, three open issues.
- 58:35What do I do?
- 58:36You know, or like, and these three issues are like really low level stuff or like they've already been handled or something.
- 58:41Sure.
- 58:42And so we like, yeah, like what we're telling people now is like, okay, well flask, not only is it made up of these five other libraries, but there's also this whole extension ecosystem out there for you to contribute to.
- 58:52Like everybody's heard of flask, you know, so we can point them at the right place.
- 58:57They come to us and then we point them.
- 58:59Yeah.
- 59:00Excellent.
- 59:01Well, I'll be sure to link to that in the show notes as well.
- 59:02Yeah.
- 59:03And with that, I think we're out of time.
- 59:04Thank you for being here.
- 59:05Just final call to action.
- 59:07You know, people either want to contribute or just want to use flask.
- 59:10What do you tell them?
- 59:11Yeah.
- 59:12Yeah.
- 59:13So like I said, we're like developing all its eco.
- 59:15I'm currently writing maintainer documentation.
- 59:17So it'll make it easier for people to get involved in that way, writing a new website with a lot of our policies and everything.
- 59:24But the main point of contact for all of this and the way we could coordinate with our community is on our discord server.
- 59:31So if you go to discord.gg/palettes, that will let you join the palette server.
- 59:37It's, you know, open to everybody.
- 59:40We need help, you know, not only contributing to libraries, but answering questions in our questions channel or, you know, like triaging issues and all sorts of things.
- 59:49There's lots of different ways to be involved in the projects without writing code.
- 59:53And it all starts on that discord server.
- 59:55Awesome.
- 59:56Well, thanks again for being here and catch you next time.
- 59:59Yeah.
- 1:00:00Thank you.
- 1:00:01Bye.
- 1:00:02Bye.
- 1:00:03This has been another episode of Talk Python To Me.
- 1:00:05Thank you to our sponsors.
- 1:00:07Be sure to check out what they're offering.
- 1:00:08It really helps support the show.
- 1:00:10Take some stress out of your life.
- 1:00:12Get notified immediately about errors and performance issues in your web or mobile applications with Sentry.
- 1:00:18Just visit talkpython.fm/sentry and get started for free.
- 1:00:23Want to level up your Python?
- 1:00:24We have one of the largest catalogs of Python video courses over at Talk Python.
- 1:00:28Our content ranges from true beginners to deeply advanced topics like memory and async.
- 1:00:33And best of all, there's not a subscription in sight.
- 1:00:36Check it out for yourself at training.talkpython.fm.
- 1:00:39Be sure to subscribe to the show.
- 1:00:41Open your favorite podcast app and search for Python.
- 1:00:44We should be right at the top.
- 1:00:45You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the direct
- 1:00:51RSS feed at /rss on talkpython.fm.
- 1:00:54We're live streaming most of our recordings these days.
- 1:00:57If you want to be part of the show and have your comments featured on the air, be sure
- 1:01:01to subscribe to our YouTube channel at talkpython.fm/youtube.
- 1:01:05This is your host, Michael Kennedy.
- 1:01:07Thanks so much for listening.
- 1:01:08I really appreciate it.
- 1:01:09Now get out there and write some Python code.
- 1:01:10Get out there and write some Python code.
- 1:01:11Get out there and write some Python code.
- 1:01:11Get out there and write some Python code.
- 1:01:12Get out there and write some Python code.
- 1:01:12Get out there and write some Python code.
- 1:01:12Get out there and write some Python code.
- 1:01:13Get out there and write some Python code.
- 1:01:14Get out there and write some Python code.
- 1:01:15Get out there and write some Python code.
- 1:01:16Get out there and write some Python code.
- 1:01:17Get out there and write some Python code.
- 1:01:18Get out there and write some Python code.
- 1:01:19Get out there and write some Python code.
- 1:01:20Get out there and write some Python code.
- 1:01:21Get out there and write some Python code.
- 1:01:22Get out there and write some Python code.
- 1:01:23Get out there and write some Python code.
- 1:01:24Get out there and write some Python code.
- 1:01:25Get out there and write some Python code.
- 1:01:26Get out there and write some Python code.
- 1:01:27Get out there and write some Python code.
- 1:01:28Get out there and write some Python code.
- 1:01:29you
- 1:01:29you
- 1:01:30Thank you.
- 1:01:32Thank you.