Learn Python with Talk Python's 270 hours of courses

#245: Python packaging landscape in 2020 Transcript

Recorded on Thursday, Nov 21, 2019.

00:00 Python is growing incredibly fast, and it's found its place in many facets of the developer and

00:05 computational space. One area that is still shaky and uncertain is packaging and shipping software

00:10 to users. I'm not talking about building reusable libraries and hosting them on PyPI. I'm talking

00:15 about shipping executable software to non-developers. Take a moment and stop and think about the ways

00:21 you would send an end-user a program built with Python that they can simply run. It's a bit of a

00:26 mixed bag, isn't it? On this episode, we welcome back Christian Medina to run through the state of

00:31 Python packaging. This is Talk Python to Me, episode 245, recorded November 21st, 2019.

00:38 Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries, the

00:56 ecosystem, and the personalities. This is your host, Michael Kennedy. Follow me on Twitter,

01:00 where I'm @mkennedy. Keep up with the show and listen to past episodes at talkpython.fm,

01:05 and follow the show on Twitter via at Talk Python. This episode is brought to you by Tidelift and

01:10 Linode. Please check out what they're offering during their segments. It really helps support

01:14 the show. Chris, welcome back to Talk Python to Me.

01:17 Hey, thanks. How's it going? It's been a while.

01:19 It has been a while. It has been since the summer of 2018, so not quite two years, but it's definitely

01:25 been a while since you were on. Previously, you were on to talk about continuous integration,

01:30 continuous delivery with Python. That's right.

01:33 And you know, that was a really popular episode, actually. I thought the topic would be popular,

01:38 but you came across with all these little tools and techniques that people just loved. And so,

01:43 yeah, it was really great. And we'll probably learn some more about cool tools and techniques

01:47 this time around, too.

01:48 Yeah, sure. It was a good episode to kind of get everything plugged together and a nice little

01:54 summary for all that. So, yeah, anybody that's interested, it's a good one.

01:57 So, let's maybe fill people in on what you've been up to lately, day to day.

02:03 Sure.

02:04 You were on the software development side, but it sounds a little bit like you're also on the testing

02:07 and process, making sure stuff works for the folks around you, like that they don't build bad software

02:13 as well.

02:13 Yeah. So, when we recorded that last episode, yeah, I was mostly doing development side,

02:19 but I was in a small team, so I was tied into everything, QA builds and everything. But since then,

02:24 I've transitioned to a different organization and I'm mostly doing QA now. So, QA tooling,

02:31 which still involves build stuff, but not really developing a product, more developing tools to

02:37 help test and release code.

02:39 That's cool. So, you're basically in the developer tool space, but internally for your company,

02:44 not like JetBrains or Microsoft or something like that.

02:47 Right, right. And I've done that in my career a lot. I actually like it because I can walk over

02:52 and talk to my customers and tell them, did you like this? And they were like, no, it sucked.

02:56 Okay, so I'll go fix it.

02:57 That is a super cool feeling. I've worked in small offices where basically the users of the software,

03:03 they were a few offices or a little lab space down. And it was like, all right, what we need

03:10 for next week is this. Come back three or four days later. This is what I've built. I know you

03:14 asked for this, but I think this part can be automated too. What do you think about it?

03:19 Like either like, oh, that's amazing or no, what were you doing? Like, of course you can't do that.

03:23 And so on and so on. Yeah. It's that quick feedback loop is pretty cool.

03:27 Yeah. It just helps you produce something productive for people that'll help their productivity.

03:32 Yeah.

03:32 Yeah. Yeah. Cool. So, well, that sounds really fun. And, also related a little bit to what

03:38 we're going to be talking about now.

03:40 Yeah. Slightly. Slightly. Yeah. So I want to start really high level with our conversation.

03:46 So the idea is we're going to dig into some of the options for packaging Python applications.

03:52 And I think before we even dig into the details of how we do that, some of the cool tools

03:58 that are out there, honestly, I think we have to define what the heck that means. And it's not

04:05 because we just need to be precise, but I think some different people, they have vastly different

04:10 expectations and needs and some tools completely solve that. And if your, your desire is different,

04:16 it's completely broken. Like imagine I want to get my web app onto a server to run consistently.

04:24 Maybe Docker and Kubernetes is the perfect answer. If I have a accounting application,

04:30 I want to give to accountants running a Kubernetes cluster is not the right answer, right? Like these

04:35 are really, really different. So maybe what are some of the definitions and like of what packaging

04:41 might mean for different people? What's the spectrum out there?

04:43 Right. So even in the org I'm in right now, we actually have this problem because we have a wide

04:47 range of tools, right? So if you're building a bunch of services with REST APIs to help you

04:53 deliver something to that's remote or let's call it cloud-like to people, right? That might,

05:00 like you said, that's something you might want to package as a Docker container, as a service running

05:05 on a server, which is a different deliverable than say a double click this icon here, desktop application

05:15 that you'd want to deliver if you're wanting to say, create a log viewer for somebody to help them

05:21 process that information, right? Right.

05:23 Which then is completely different from some utility where you just want to provide a quick library

05:29 for other people to write more code using your library, right? And all that you'd want to deliverable

05:37 for all of that would be different and something that makes more sense to the user in the environment

05:43 that they're in because they're all different environments.

05:45 Yeah, absolutely. Like I suspect you're kind of on the border at work, right? Because you are working

05:51 with developers. So it's probably reasonable to say, well, there's a REST endpoint or there is a command

05:58 line tool. You type this in the command line and magic happens.

06:01 Right. So the REST endpoint, easy, right? So there's this GUI uses some REST API and you can track your

06:07 execution of your tests, for example, right? And then you can see how things are going. But when you're talking

06:12 about the actual test you wrote, then that needs a library for you to access the infrastructure

06:19 and a bunch of services in that infrastructure that might relate to just stuff you need, requesting

06:25 resources for testing or using other, you know, integrating with other tooling that will help you

06:30 with that, right? Which is then completely different from some utility that'll tell me, give me the list

06:36 all my compute that I have available to run tests on, right? Yeah. And then that utility needs to run

06:43 on every developer's machine. And then how you distribute that starts getting complicated.

06:47 Yeah. And do you help these developers that you're working with? Do you help them

06:50 distribute their tools, maybe to more end user type folks?

06:55 Not so much. Some of the libraries that the organization runs are or might soon be open

07:01 sourced. So we might wind up using IPI and GitHub to distribute some of that stuff. Internally,

07:06 we have like internal private IPI repos and Docker registries and things like that today.

07:11 Okay. Yeah. Yeah. Very cool. All right. Now I'm going to throw out as part of this high level

07:15 discussion, an idea. I don't know if it's popular or not. It's not super positive, but I do want to kind

07:21 of start there because I think this is a pretty serious issue. And I'm going to say that Python's

07:28 in this broad sense that we've set it up, not necessarily like virtual environments and like

07:32 pip install, but in the broad sense, Python's packaging of for applications in particular,

07:38 it's fairly broken. How does that say with you?

07:41 There's definitely a number of areas that need improvement, mostly because of the part of the

07:48 problem is that we just have so many different ways of distributing say virtual environments or

07:53 just the packages themselves or just putting the code together and giving it out to somebody.

07:59 And part of it is good because just Python is flexible enough for you for allowing you to

08:06 build whatever makes sense for your org, right? And then everybody puts it out there and then some

08:11 people use it, some people don't. But if we had the one official supported thing that goes beyond

08:16 just pip install because pip install involves a pre-existing Python executable, which is when

08:23 things start getting complicated.

08:24 Exactly. You've got to have a well-known, somewhat decent environment. You've got to have a certain

08:30 version of Python or a range of version. It's got to be over 3.5 or say over 3.6 if you're using

08:36 f-strings or whatever version it has to be. That has to all be in place and set up.

08:43 Even when that works, it's usually difficult to give somebody an icon to double click to make their

08:48 app go, right? Like, why is my thing not like Firefox? Well, you see, there's all these rules. Let me tell

08:56 you about dependencies. Nobody wants to hear that, right? They want to go, I want the icon that I click.

09:02 Yeah. It gets even more complicated once you're distributing compiled code along with it, like some

09:08 of the machine learning stuff or whatnot, which is why you see all these alternative systems like,

09:13 say, Anaconda exists to just help with that, right?

09:17 Right. Yeah, yeah. That's a good point. That is sort of why Anaconda exists. I mean, it also focused a

09:22 little more on the developer side, but right, it kind of tries to solve some of the challenges of how do I

09:26 get some of the foundational bits in place for the developer users, right? Yep. So there was, here's a

09:34 quote from the PyOxidizer page. So Greg, I believe, is on board with this idea. And this is from Russell

09:43 Keith McGee's PyCon 2019 keynote talk. So he's on idea. He's on board with this idea. But he gave a talk

09:51 basically about these black swan events for Python. Are you familiar with this idea? Did you see his talk?

09:58 Yep. And it was discussed in a couple episodes. I think you guys talked about it probably in a Python

10:03 bytes episode before as well. Yeah, I do think we might have done that. Yeah. Yeah. So the idea of the

10:08 black swan event roughly is like this thing that is very rare that people don't see coming in an

10:15 ecosystem and society and cycles, whatever, that are potentially existentially critically bad,

10:23 right? So the original example was something like a turkey thinks the farmer loves them. Every day,

10:30 the farmer comes in and greets them, treats them really well. Feeds them. Yeah, feeds them. And nobody saw

10:36 Thanksgiving coming, right? Something like that or, you know, things along those lines. I guess maybe

10:42 another one might be traditional photography and Kodak and digital cameras, right? Like that might like

10:49 nobody saw that coming in the sense, like well enough, I guess. I'll give you one more with server

10:55 development and the commoditization of that and what happened with the larger manufacturers when

11:02 all the cloud companies started to develop their own servers. Yeah, probably first they're like,

11:07 you know what? It's no big deal that there's all these cloud hosting places because they're just

11:12 going to buy our servers and put them in their data centers and we'll be fine until they said,

11:15 you know what? We could do better on efficiency and our biggest cost is electricity. So thanks,

11:19 but no thanks. Yeah, exactly. Yeah. Yeah. So Russell Keith McGee said there are a couple of things that he

11:26 believes are these black swan type of threats for different parts of Python, right? He loves Python,

11:33 but like what might undo this great success that Python has had over the last couple of years and

11:39 one of them is definitely about packaging. Yeah. Look, I believe some of the others, there was mobile,

11:45 there was packaging and there was a few others, but those are the two that really stood out to me.

11:50 It was like, you know, people who are coming into programming, why would they come into Python if they can't take the cool little app they built and share it with

11:57 their friends, right? They're going to do it in JavaScript or they're going to do it in something

12:01 else where they can package it up and share their game or whatever, right? Exactly. Yeah. So that's

12:06 why I think this is a big challenge, right? I think it's important. It's also tricky, but I think it's,

12:10 I do think it's really important. Also, you probably heard me go on and on about like building GUIs in

12:15 Python, right? Like this is another, another one. And I've done my GUI thing too. So yeah. Yes,

12:19 you have. That's right. You gave a talk at PyCaribbean about it. That's cool. And

12:23 I think one of the reasons people don't build more desktop applications and GUI applications in Python

12:29 is because one, yeah, there's a, there's a little bit of a gap in the tooling there, but things like

12:34 cute and what, whatnot, they're actually quite decent. Cocoa touch and not Cocoa touch, but some of the

12:41 PI OBJC or whatever, the wrappers around the Cocoa APIs, those are probably pretty much okay. But

12:49 even once you build those, then you come back to this packaging problem that we're talking about here.

12:55 I think it's, it's so much of a problem that people don't put any energy to build out the GUI apps,

13:01 the GUI capabilities, because heck, once you build them, it's, you still can't really give them to

13:05 anybody in like a super decent way. So why, why bother building, like, you're just going to build a web

13:10 app or, or whatever. I think there's a bit of a chicken and egg problem where like people don't work on

13:15 trying to distribute their application because it's so hard to build the type of applications that get

13:20 distributed. So like, it's just kind of like, it's a little anemic in that space. So what I'm trying to

13:25 say.

13:26 No, no, I'm with you. And, and even, so when I said like, I did my GUI thing. And so I have my attempt

13:32 at a GUI framework where I, I went through the analysis or what you're just talking about. And I

13:36 just pretty much just gave up and said, well, the web one, we can just make our GUIs in the web.

13:43 Let's figure out how to do that a little bit easier and just go down the Chromium distribution

13:48 kind of electron JS equivalent to do everything. And then everybody just gets a web browser,

13:53 which is cool that that works. But then when you start thinking about the, what else you're

13:58 distributing with your application, just to do a simple GUI or whatever, like an entire web browser

14:02 or whatnot, then just seems kind of wasteful as well. Yeah.

14:05 Yeah. Yeah. I do think actually that might be something that happens for Python, something

14:11 like electron, right? That's actually really totally possible. And the WebAssembly stuff

14:16 could make that really interesting as well. If you could package up the runtime as a web

14:19 assembly and just drop that with your, your electron distribution.

14:22 I managed to do it. It works. I'm not using electron itself. I'm just using the stuff that

14:26 electron uses in the backend. So it's all totally possible.

14:31 This portion of Talk Python to Me is brought to you by Tidelift. Tidelift is the first managed

14:36 open source subscription, giving you commercial support and maintenance for the open source

14:40 dependencies you use to build your applications. And with Tidelift, you not only get more dependable

14:46 software, but you pay the maintainers of the exact packages you're using, which means your

14:50 software will keep getting better. The Tidelift subscription covers millions of open source projects

14:55 across Python, JavaScript, Java, PHP, Ruby, .NET, and more. And the subscription includes

15:00 security updates, licensing, verification, and indemnification, maintenance and code improvements,

15:06 package selection and version guidance, roadmap input, and tooling and cloud integration.

15:11 The bottom line is you get the capabilities you'd expect and require from commercial software.

15:16 But now for all the key open source software you depend upon, just visit talkpython.fm

15:22 slash Tidelift to get started today.

15:26 All of this conversation sort of started from this, it's almost like a retrospective on a journey

15:33 that you went on. This blog post that you wrote, four attempts at packaging Python as an executable.

15:40 I'll put the link for that original article over there. So maybe just tell us a little bit about

15:45 what that was all about in the journey and then we can dive into some of the details that we pulled

15:50 out of there. Sure. So in the, even in the previous episode, when I was working on mostly CICD stuff,

15:56 as part of that CICD system, there's a, you know, you need to execute some code inside it to like keep

16:03 your process going. Right. And one of the limitations I had at the time was that the containers that I was

16:09 using required Python to be installed in it. And I wanted to remove that dependency. I knew it was

16:14 possible to compile my code down to an executable. I wanted to figure out what, what method worked for

16:20 me. And I tried, I didn't have a lot of time. So I tried four systems, which at the time was

16:25 Cython, PyInstaller, Nutka and PyOxidizer. Right. And each one had, you know, I fumbled through most of

16:35 them and, and, you know, I'd use PyInstaller before. For simple cases, you could get it to work,

16:38 right? Like Cython, you sort of got it to work, but only for a simple app. Yeah, exactly.

16:42 I got what I wanted. It works pretty well. It's been in production for my side of the world for a

16:47 while. So I'm, I'm happy with it. But yeah, so out of that came, you know, this analysis of where we're

16:52 at with like how to turn your Python script into a double click executable kind of thing.

16:58 Yeah. And I definitely think it depends on what level you need to be at, right? If you're building

17:04 a tool for fellow developers, that's one thing. If you're building a tool, like I said, for accountants

17:08 or lawyers, exactly. They expect something to put next to their word icon in their macOS doc or

17:15 whatever, like that's a different type of thing. Right. So let's go through it. I guess we've got

17:21 it broken up into some, some nice taxonomy here. Let's talk about delivering an application first.

17:29 Yeah, sure. So just to give the overall taxonomy a little bit, right? We have three things based on

17:35 what deliverable, what your end goal is from having this Python package, this distribution to your end

17:42 user, right? And we have the idea of putting it together as an application that you run or putting

17:48 it together where you just distribute a virtual environment with it, or you just give out a specific

17:53 executable. And then there's some other things along with it that we talk about later. But if you want

17:59 to deliver an application or a service type of application, one of the best things to use these

18:04 days is Docker. I've used it successfully to run pretty much everything Python related. And in fact,

18:11 there's an official Docker image that you can run that's based on Debian, I believe. And I use that in

18:17 my automated testing all the time.

18:19 That's supported by the PSF. I've learned, right? That's pretty interesting.

18:22 Somewhere in the Python builder, a little bit after that comes an official Python Docker image

18:27 that you can just pull from and use.

18:29 Yeah, that's cool. Docker is cool. But it makes me a little bit nervous because you're taking like

18:34 layers of customized operating system that maybe different people have, you know, changed or built

18:40 on stuff. And then, you know, how sure are you that those are not, you know, that somebody hasn't

18:45 slipped something in there. I think the Docker files are maybe a safer bet, of course, right?

18:50 To just like build it yourself rather than to download the full container.

18:53 But you still need to start from an image, right?

18:56 Yeah.

18:56 So if you start from, say, some official distribution of something like the Python one,

19:01 but just the same, there's like all kinds of other images from Postgres, Ubuntu, MySQL,

19:05 whatever that you can use. You can, you know, slowly build up with your Docker file,

19:09 whatever dependencies it is that you need.

19:11 Now, the advantage of this is that you're distributing all the dependencies for your

19:16 operating system along with the Python executable that you need along with your actual application,

19:23 right?

19:23 Yeah.

19:24 That makes the, it worked on my machine problem go away, essentially.

19:29 I do think Docker is a pretty cool solution. If having Docker running on your operating system,

19:37 it's not a big deal to you, right? You've already got the desktop Docker or whatever.

19:41 Or it's installed on your server.

19:43 Right.

19:44 Then this is a pretty solid way, certainly to deliver like services and stuff.

19:48 If it's just a matter of pulling it down and say, you know, Docker run this container or whatever,

19:54 then it's, it's okay.

19:54 Yeah. I've also come across a couple of applications, I would call them that where you,

20:01 you run a CLI and the, your interface is the CLI, but in the backend of CLI,

20:06 Docker runs something for you. So it all runs in its own little contained environment.

20:10 And then just exits.

20:11 Yeah. One of the slicker instances of this was from Gigantum. Are you familiar with them? They're pretty new.

20:18 Nope.

20:18 So I just had them on the show three or four episodes ago, not very long ago.

20:22 Okay.

20:23 And basically what they are is they are like a collaboration environment for data science.

20:28 So they distribute their application to you as a Docker container. And then each environment you create starts from one of these containers as well.

20:38 So either it's like an Anaconda pre-configured container or it's a, you know, just a bare one with Python or whatnot.

20:45 But yeah, it's really cool that the PS has enough PSF has an official Docker container. Cause I didn't, I didn't realize it. That's great.

20:51 Yeah. Yeah. It really does help it along.

20:54 Yeah. The other thing that can be tricky with Docker is you're trading that,

20:59 well now set up this version of Python in this way for now make sure you expose these ports and the right way.

21:05 And you map that volume over there. There's just like, there's still some friction to distribute and stuff as a Docker container, right?

21:12 Yes, that's correct. So if once your application, if you get like something that's really somewhat complicated and you need to have persistent data and things like that,

21:21 then you got to worry about making the proper volumes or mapping the correct directories into it so that you can persist the data outside the container or even access it without having to get into the container.

21:32 And then when you have to do things like when you depend on networking in some way, like if say you're running HTTP server, then you need to make sure you pass in the right commands to open the correct ports for it to work for you.

21:43 So that's some of the complications you get there.

21:45 But it could get wrapped up, right? Like you don't, the example you pointed out where you don't really know that you're doing Docker when you're working with your CLI.

21:54 It just happens to Docker behind the scenes to make things reliable. Like that's a pretty good use case.

21:59 Yeah, I think so.

22:00 Cool. All right. So another one that you have out there, which is maybe pre-Docker.

22:05 Yes.

22:06 I'm just going to give you a virtual machine and you can just run that.

22:10 Yep. And along with that. And so like the original thing was, yeah, here's your virtual machine application, essentially.

22:16 And you just, it starts an entire operating system that you can run in VirtualBox, but along as well as other virtual machine environments.

22:25 But along with that came Vagrant, which was kind of like a Docker file for virtual machines, except before Docker files.

22:33 And so you can sit there and say, oh, it's a VM. It's going to have this configuration for your network, for memory, CPU, whatever, file systems and whatnot.

22:41 And spins up essentially a pre-configured OS, fully packaged OS for you.

22:47 And now, of course, when you distribute a VM, you're distributing a whole OS.

22:52 So it's going to be a large image that you're giving out, which is the difference with something like Docker, because it's a layered file system.

23:00 Then you only need to, you only distribute the pieces that you're adding on top of some basic image.

23:06 Any changes you make to that virtual machine maybe requires like a new 5 gig download, whereas a change or two Docker file might just, well, you just rebuild like the last layer of that Docker image.

23:17 Yeah. And then you can find, like for the Docker side, you can find, you know, tiny OS images in the tens of megs versus a full VM, right?

23:27 That'll be like probably a couple of gigs. You can get small VMs too.

23:30 Yeah, a couple of gigs to start. Yeah, yeah, true.

23:33 The other thing that seems like a challenge with the VM option is it's now your puppy.

23:40 You've got to caretake it, right? So if it has a security vulnerability or something like that, then you've got to go in there and like patch it and whatnot.

23:48 Right. Which you technically still have to do with Docker.

23:51 But if you spin off your image on top of an existing one, for example, let's go back to the Python thing.

23:59 If I have my application built on Python 3.6 and 3.7 comes out, I just need to change my base image to 3.7 and stuff just starts working on top of that.

24:09 Right. Or you could just live a little bit out on the edge and do something like Ubuntu Python colon latest.

24:14 Right. Exactly.

24:15 Something like, right. Whatever's the latest. If there happens to be a new latest when I rebuild it, get the new latest and then give me that.

24:22 That one's probably patched at the OS level and got the newer version of whatever in it.

24:26 Right. Exactly.

24:27 There's a risk that it's not 100% repeatable potentially, but things like Linux and Python, they're pretty backwards compatible.

24:35 Yep.

24:35 As opposed to I now have to log into my Docker images and patch them. That's another level of effort.

24:42 Yeah, exactly. That's a lot more complicated.

24:45 Usually, it's just considerably easier to just update the base image.

24:49 Right, right, right.

24:50 It's also a great little test thing, right? If you want to check whether your code works in 3.7 versus 3.5, for example, just start an image with 3.7 in it and you're done.

25:02 Yeah, and run it through your CI and see what happens.

25:04 Yep.

25:05 Another thing that might be a benefit of the Vagrant VM style, though, could be background work, background jobs and whatnot.

25:13 Like, Docker, typically, it has the Docker container, but then there's, like, the one thing it runs as its life, right?

25:20 Like, there's not a system D in Docker that I'm aware of and things like that, right?

25:25 Right. Depending on what you want to do, right?

25:28 Because you can configure it to do whatever, pretty much.

25:31 And there's, like, privileged containers, too, right?

25:34 So, you got some limitations on your normal stuff, but you can also add other kernel privileges to it to help it communicate or create new devices and whatnot.

25:42 And, yes, the process manager and service managers inside the container aren't there by default.

25:49 So, if you want to do that, you get to configure it yourself.

25:51 Right.

25:52 Right, which is complicated, but it can be complicated, but it's also good because you get, like, a really base thing.

25:58 So, if you don't need it, you don't have it.

26:01 Yeah.

26:01 One of the things that's cool about that, though, is you have all the control, right?

26:05 That's correct.

26:06 Once you set it up, it might be painful to set it up, create that Docker file that's just right, but once you got it, like, you put it in version control and you just forget about it, right?

26:15 You just build on top of it.

26:16 Yeah, exactly.

26:17 Yeah.

26:17 Yeah.

26:17 Yeah.

26:17 And you can have, like, a build container, for example, in version control just exists to build your code, for example, or package your code.

26:25 Yeah.

26:25 And then just gets destroyed afterwards.

26:28 Yeah.

26:28 Yeah.

26:28 So, we've got these different container technologies, like, really big shipping container style, and then, like, the small, I don't know, Tupperware style with Docker and VMs.

26:38 Right.

26:38 But we also have, you know, things like PyInstaller, right?

26:41 Yep.

26:41 So, with PyInstaller, it has been around for a while.

26:44 That's what I used to distribute the GUI stuff we were just talking about earlier.

26:50 So, PyInstaller can take your Python application, like you pointed to your directory, and it can output fully installable application in both Linux, Windows, and Mac.

27:02 So, in Mac, you'll get a .app, you know, in Windows, you'll get an executable, and for Linux, you'll get another executable file.

27:10 I used it recently to do something simpler, which is what I discussed in my recent article, but I used it in the past to not only write a Python app that ran, say, a WebSocket server in it, right?

27:23 It also included an entire Chromium browser along with it and got delivered almost like an Electron application.

27:30 Yeah, that's super cool.

27:31 Yeah.

27:32 I do think PyInstaller is quite nice.

27:34 It's been around for a while, but it seems to be, like, one of the go-tos that people are keeping around.

27:39 Yeah.

27:39 So, actually, after I wrote my post, I got a number of folks that pinged me when, like, talking about how great PyInstaller is, and they've been using it for a while.

27:46 Yeah, yeah, super cool.

27:47 This is pretty close to here's your executable you can have and run.

27:53 Yeah, just double-click and go.

27:54 Yeah, I've had pretty good success for it.

27:56 I used GUI, you know, GUI, G-O-O-E-Y.

27:58 Yep.

27:59 I used GUI to build a little app, which was a super simple thing, and then I packaged it up with PyInstaller.

28:07 And it was good except for it ran fine on Windows.

28:11 Like, it had a .exe.

28:13 It, like, had an icon.

28:14 You double-clicked it.

28:15 It did the thing.

28:17 On macOS, I had a .app file.

28:19 Mm-hmm.

28:20 And you double-clicked it and did its thing, except for it also opened a terminal kind of off to the side.

28:26 Oh, really?

28:26 Which, for the life of me, I couldn't get it to go away.

28:28 Like, the commands to make the terminal not show were obviously working on Windows, but not on Mac.

28:33 And I was like, ah, it's so close to working.

28:35 Oh, that's interesting.

28:36 Yeah, yeah, yeah.

28:37 So, I still think there's some rough edges, but it definitely seems...

28:40 Like, the other stuff I tried didn't get that far, right?

28:43 So, that was cool.

28:44 Yeah, so I haven't had that experience.

28:46 But I have had complications, because when you package your application, now you have to worry about things that depend on some of the Dunder methods to come in with Python, like the Dunder file stuff.

28:57 Which is supposed to tell you the directory in which the file that you're working on is located.

29:03 Right.

29:04 Well, that's kind of different, because the way PyInstaller works is it bundles your application, all the files, and whatever extra data you want with it, and it bundles a Python interpreter in it.

29:14 So, when it runs, it just extracts all this stuff into some internal directory that you're not aware of.

29:21 So, Dunder file just doesn't work.

29:23 It gives you anything.

29:25 I can't remember.

29:26 It's wrong, right?

29:27 So, but PyInstaller provides its own little API to get the actual directory where the files actually exist.

29:33 So, you just got to be aware.

29:34 You do a check in your Python code to say, oh, we're inside PyInstaller, so we need to check here and go here instead.

29:40 Okay, that's interesting.

29:41 Yep.

29:42 Can you use the Dunder file to still get, like, I need to go up one folder and get that other file next to it, or is it even relative stuff is not really working?

29:52 Even relative stuff is not quite set up right.

29:55 Okay, but if you build for it, it's not a big deal, it sounds like.

29:58 Yeah.

29:58 Yeah.

29:59 And then another option is, I mentioned Russell Keith McGee.

30:03 Right.

30:03 And his big project is the whole Beware project.

30:05 And one of those is about packaging, right?

30:08 Yeah, briefcase.

30:09 Yeah, briefcase.

30:09 And so, you know, Beware is a whole slew of individual repositories that provide different functions, specifically a way to, together, they provide a way to build cross-platform Python applications, which involve GUIs in mobile devices, as well as your desktop app or the web.

30:30 And as part of that, they need a way to package the application.

30:32 And so they built a briefcase, which is the repo that lets them do that.

30:36 And so you can take, essentially, write a base app and using briefcase, produce, you know, an Android application and iOS application and everything else.

30:47 I haven't particularly used it to do anything major.

30:52 So I don't know a lot about the internal details, but I know it's there and people are working with it.

30:58 Yeah, certainly it's pretty interesting that it has iOS and Android.

31:01 Yeah.

31:01 And I have seen the apps work.

31:03 And, you know, Russell's done several talks on how that all does all this stuff.

31:08 It's actually pretty neat, all the things that they're doing.

31:10 Some of the Android stuff, last I checked, was transpiling some of the Python code.

31:15 Some of the iOS stuff was directly calling into Objective-C, a few things.

31:19 So it's pretty neat.

31:20 Yeah.

31:21 So that is some subset of the options for delivering an application, right?

31:27 Like, I want to have the whole environment come along and whatever that takes, if that's a VM or bundling stuff up like Chrome or whatever you need, do that.

31:36 Maybe another level is delivering a virtual environment, right?

31:41 This sounds like it's most useful kind of for developer and automation and server type stuff.

31:47 Great.

31:47 So say you have an organization or customers that you know are on a set Python interpreter.

31:53 So you don't need to bundle your Python interpreter with you.

31:57 Then you can use some of these tools to bundle your application along with all of its dependencies into one file.

32:04 So the ones I'm talking about here are PEX, for example, which was built by the folks at Twitter and SHIV, which was built by the folks at LinkedIn based on the PEX stuff.

32:16 And the idea is they take all your code and they bundle it into one file and you can feed that file into Python and it follows a, I forget, I should have made note of that.

32:26 There's a PEP that explains how to build these zip apps.

32:31 PEP 441.

32:32 There you go.

32:33 Python zip applications.

32:34 Yeah.

32:35 Right.

32:35 And so then with one command, you can just feed that into your Python interpreter and it knows how to unpack it and run all the stuff in it.

32:41 Nice.

32:42 And does PEX and SHIV, do these package up the dependencies?

32:45 Yes.

32:46 Like if I depend upon HTTPX or requests or Sook Alchemy, it'll take it with it?

32:50 It'll do it.

32:51 Yeah.

32:51 That's pretty cool.

32:52 But typically the virtual environments, at least on the Unix, Linux, macOS systems, are like symlinks back to the real Python, right?

33:01 They're not full copies of Python.

33:03 Right.

33:04 Right.

33:04 Yeah.

33:05 So is that kind of how it works?

33:06 It's like, here's a little virtual environment shell and just link back to the main Python and then run?

33:12 Right.

33:13 So you'll be using whatever the Python it is.

33:15 And I haven't done this, but I imagine you could make a virtual env with your Python interpreter that you want to use.

33:21 And then in that virtual env run your PECS or your SHIV package code.

33:23 Yeah.

33:24 Yeah.

33:24 I would think so as well.

33:25 Yeah.

33:26 So you still, basically the idea is you still got to have Python bare bones as a thing, the version that you need as a thing.

33:34 There to bootstrap.

33:36 But once you have that, at least you don't have to say, first step is create the virtual environment.

33:40 Second step is pip install dash are the requirements.

33:43 Like you can skip all of that.

33:45 Long as Python is present, you can basically run it potentially.

33:49 That's correct.

33:49 Yeah.

33:50 Okay.

33:50 Yeah.

33:51 That looks really cool.

33:52 When I first saw that, I was like, oh, please let this package up the Python runtime with it.

33:57 And no, you're right.

33:59 It just builds on top of that PEP 441 to say, basically you can create these zip versions that are directly executable by Python.

34:09 That's it.

34:09 Yeah.

34:10 Yeah.

34:10 Yeah.

34:10 So if you have like a, in a large organization, sometimes you have a standard virtual developer, virtual machine or developer laptop or desktop stuff that you distribute to everybody.

34:20 And if you have the stuff in place, which not everybody does to automatically keep that up to date with say whatever Python interpreter it is that you're running, then you can make a safe assumption that your customers, your users are all going to have this Python environment and just go from there.

34:36 Yeah.

34:36 It definitely seems like an interesting way to ship stuff to a server.

34:39 Right.

34:39 Instead of creating the environments and setting them up there and installing the packages, just like, I'm going to take this zipped up virtual environment, send it over there and say run.

34:49 It's not quite Docker works on my machine level, but it's closer.

34:55 Right.

34:55 So other things you'd have to think about at sites from the interpreter would be any other like external dependencies of your package.

35:02 Those will probably not get zipped up with it.

35:04 I think there's some options to help that along on both of them, but I'm, I don't know all the details with that specifically.

35:10 Right.

35:10 But maybe you need Redis on the machine and like, that's not a Python thing.

35:14 Or you need lib MySQL.

35:16 I see.

35:17 Yeah.

35:17 Or something like that.

35:18 I'll throw one more into this part of the taxonomy delivering as a virtual environment.

35:22 PIPX.

35:23 Are you familiar with PIPX?

35:24 I am.

35:25 I use it a little bit.

35:26 Yeah.

35:27 I haven't done much else after initial config.

35:30 Yeah.

35:30 Yeah.

35:30 So PIPX is interesting because PIPX, if you have Python on your machine and you pip install PIPX, from then on, you can do basically the way things like homebrew or chocolatey work for installing like utilities into your, your OS.

35:47 If those utilities are based on Python, PIPX serves the same role as say homebrew.

35:53 Right.

35:53 Right.

35:54 So I can go, and if I pip install --user PIPX, from then on, I now have a PIPX command.

36:00 And I could say like PIPX install glances.

36:03 And glances is like a cool terminal sort of process explorer type thing with, you know, ASCII bar graphs and whatnot.

36:12 Right.

36:13 So if I wanted that, I could say PIPX install glances and we'll create a dedicated virtual environment just to run and install glances.

36:22 And if then, if I want HTTPY, which is a cool alternative to curl, that's Python basic, I say PIPX install HTTPY and it'll actually go and create a dedicated isolated environment for that command line tool.

36:32 So if you've got a command line option that you want to, a command line tool that is Python based and you want to be able to have it upgrade itself because you can say PIPX upgrade all and stuff like that.

36:44 And it's isolated.

36:45 It's not being installed in one of your projects.

36:47 It's just something you want on your machine.

36:48 PIPX is actually a pretty cool option.

36:50 Yeah.

36:50 Like I would use it for, I would even use it for something like a linter or a, you know, install flacate.

36:57 And then you can use, when you type flacate anywhere, it'll just run your PIPX frozen essentially.

37:02 environment for that.

37:04 Yeah.

37:04 Yeah.

37:04 That is pretty cool.

37:06 And then along with that, if you want to create a package that fits into that world, I want to create a package that I'm going to create as a tool for somebody.

37:14 Then you can create an entry point in your package, right?

37:18 Which is a thing you can do in your, I think in the setup PY, where you put it.

37:22 Yep.

37:22 Yep.

37:23 And you say, here's the command and here's the entry point.

37:26 And like, here's actually what that means in terms of my package, right?

37:29 Like black or whatever.

37:31 Right.

37:32 Yep.

37:32 So you can set those up.

37:33 And then if you install them with PIPX, now you're managing that almost as a separate command line set of APIs.

37:40 Right.

37:41 That could automatically be updated.

37:42 Obviously you can install them with PEP elsewhere, but PIPX is cool because it's isolated and automatically, well, upon request will automatically upgrade stuff for you.

37:51 Yeah, no, that's another cool utility.

37:52 This portion of Talk Python to Me is brought to you by Linode.

37:57 Whether you're working on a personal project or managing your enterprise's infrastructure, Linode has the pricing, support, and scale that you need to take your project to the next level.

38:06 With 11 data centers worldwide, Linode delivers the performance that you expect at a price that you don't.

38:21 Get started on Linode today with a $20 credit and you get access to native SSD storage, a 40 gigabit network, industry-leading processors, their revamped cloud manager at cloud.linode.com, root access to your server, along with their newest API and a Python CLI.

38:37 Just visit talkpython.com.com when creating a new Linode account and you'll automatically get $20 credit for your next project.

38:45 Oh, and one last thing.

38:46 They're hiring.

38:47 Go to linode.com slash careers to find out more.

38:50 Let them know that we sent you.

38:54 All right.

38:54 And then the third part of our trifecta, three or four, something like that, is basically what I started with.

39:05 I want an icon next to Firefox and Word in my doc.

39:09 I click it and I want to see it run and do its thing.

39:12 Right?

39:13 Like that type of thing.

39:15 Take us through what our options are here.

39:17 Great.

39:17 So we already kind of discussed PyInstaller and that's the best one for the icon, double click and go.

39:23 Yeah, it works for all the operating systems, right?

39:25 It works for macOS and Windows and Linux.

39:27 But don't you need those systems in place to build the deliverables?

39:33 That's correct.

39:33 Right?

39:34 Like if I just have Windows, I'm in trouble because I don't have a Mac to build my Mac version.

39:38 Right.

39:39 In fact, to the point where I even considered it would be interesting to set up some online stuff that creates PyInstaller packages for you

39:47 that just somebody that's essentially renting out the Windows or the Macs for doing it.

39:53 Right?

39:53 Yeah.

39:53 That would actually be a really cool service.

39:55 It's like, here's my Python application.

39:57 Here's its icon.

39:59 Here's what I wanted to just make that for all the operating systems and give it back to me as like an MSI installer on Windows,

40:06 a .app on a Mac and a Linux binary or something like that.

40:09 Right?

40:09 That would be a super cool project.

40:10 And yeah.

40:11 So PyInstaller gives you that.

40:12 And, you know, we mentioned it earlier.

40:14 And you can also get just a package application without all the extra pretty stuff along with it.

40:19 But the one that makes it the most pretty so far for me has been PyInstaller.

40:24 Yeah.

40:25 Now the next contender.

40:26 So actually, before I go with that, let's just talk about Newtka a little bit.

40:30 So that package has been around for a while.

40:34 And so PyInstaller produces and packages all of your stuff together for you.

40:39 It doesn't compile it for you.

40:42 Right?

40:42 Okay.

40:43 Yeah.

40:43 It just takes Python along with it.

40:46 And then it like drops your files out and then like runs those.

40:49 It doesn't fundamentally change what's happening.

40:53 That's right.

40:54 It just delivers the two pieces and it clicks them together and says go.

40:57 Like CPython already.

40:59 Yeah.

40:59 Right.

40:59 If you want to actually compile it and get some extra speed boosts out of having an actual compiled C code instead of an interpreted language,

41:08 then you can use something like Newtka, which actually produces the one file.

41:13 You can just .slash run or double click and get it to run your stuff.

41:18 Right?

41:19 Now there's, of course, since you're compiling it, things get a little bit more complicated and you have to start thinking about having compilers,

41:27 having the correct libraries in order to do all of that and the dependencies of those libraries.

41:32 So it's slightly harder to do it.

41:35 But you'll get in the end code that doesn't, you know, when you run your application in PyInstaller, you're extracting the application and then running it.

41:45 But if you run it on something like Newtka, you don't need to extract it.

41:48 It's just the one file that just runs.

41:50 Right.

41:51 It's converted to machine instructions that just do its thing.

41:54 That's correct.

41:55 Yeah.

41:55 So that sounds actually like an incredibly good option.

41:59 Right?

42:00 It's got to run pretty fast.

42:01 It sounds like it's nice and independent.

42:03 That's great.

42:04 But what if I depend on other complex things?

42:09 Like I'm using NumPy or I'm using SeqAlchemy, which has its own compiled bits or something like that.

42:18 So if you're using something like NumPy, then you're not going to get a lot of speed boosts out of it.

42:23 Right?

42:24 Right.

42:24 Because you're already running at C.

42:26 Is it going to take NumPy along with it?

42:29 Like, can it handle like dependencies of this type?

42:32 Do you know?

42:33 Pretty sure it can.

42:34 I haven't had to do it myself.

42:36 Yeah.

42:36 I've not tried either.

42:37 Yeah.

42:37 Yeah.

42:37 I mean, if it could, that would be pretty cool, actually.

42:39 Yeah.

42:39 All right.

42:41 Want to talk about the new kid on the block?

42:43 The new kid on the block is PyOxidizer, which has come up a few times this year already.

42:49 Clever name.

42:50 Yep.

42:50 It's built on the packaging tools that the Rust programming language brought with it.

42:57 And so it can produce executables for you.

43:02 It still bundles things as well.

43:05 The difference is that instead of extracting them into the file system like PyInstaller does,

43:10 it extracts it into memory.

43:13 So you'll get a faster startup time when, and all your library loads are going to happen

43:18 straight off of memory because it's all mapped in there.

43:20 That sounds really good.

43:21 I know that you tried this on your example in the article that you wrote and you didn't

43:25 go with this.

43:26 That's correct.

43:27 Like, if I had to just guess, close my eyes and say, all right, I don't really know too

43:31 much, but I'm going to guess, I would, I would actually guess PyOxidizer might be the

43:35 place to start because it's a little fresher, but what was the challenge there?

43:39 So there's just a couple of different things similar to the PyInstaller stuff.

43:43 Dunder file doesn't work.

43:45 So you got to configure a few things.

43:47 And in this case, it's a slightly more complicated because it's not like it's a different directory

43:51 because there's no directories in memory.

43:53 In memory.

43:53 Yeah.

43:54 Yeah.

43:54 Right.

43:55 But they have like very extensive documentation on how to get past it.

43:58 And so that, that was like my biggest holdup, which at the time to me just kind of felt like,

44:03 I need to think about it a little more.

44:05 So I just put it on the side as a come back to this later.

44:09 But the thing I really liked about it was it's like the config options you have for the, for what

44:15 you can, the output that you can get out of it are really neat.

44:18 And so you can get an executable that runs a function inside a module, or it just runs file,

44:26 works as if you were running your file from the CLI, your Python file from the CLI.

44:29 Or you can get, which is what I like because I can play with, you run it and it just starts

44:35 your Python interpreter, your REPL with your entire virtual environment along there available.

44:42 So you just say, create my REST API application, a client application, and I can just run client,

44:51 not that PI because it's compiled, right?

44:54 And well, it's an executable and I'll get a Python REPL with, you know, requests already

45:00 available for me to import it.

45:01 And I don't have to pip install anything.

45:03 That's cool.

45:04 So in that sense, it's slight.

45:05 And I think you can do that with pecs and shiv as well.

45:08 There's a way of doing that.

45:09 But this was really neat.

45:11 You have a lot of control over it and you can watch it, pull in all the dependencies.

45:15 You can have it, it'll pip install everything for you into this, this kind of directory structure

45:19 when it's trying to put itself together.

45:22 And so it grabs all the dependencies fresh out of PI PI or whatever indexes you feed it and

45:26 then creates your final environment from that.

45:29 It sounds pretty promising.

45:30 It seems like it's got a nice modern take.

45:32 I like the making your code run faster.

45:34 It's already in memory.

45:35 Yeah.

45:35 It's all pretty cool.

45:36 This one does all the OSs as well, right?

45:39 Yes.

45:39 Cool.

45:40 As I'm sitting here listening to talk about all this stuff, it seems to me like one of

45:45 the big challenges is how do I get Python to come over correctly?

45:48 How do I get the dependencies to come over correctly?

45:51 Sometimes it's a little bit tricky to get the program to actually start.

45:56 You know, it seems like there's some challenges on around some of the platform stuff.

46:00 What I don't see with any of these is what do you think the viability of saying like you

46:05 can take CPython and embed it into any application, right?

46:09 Yeah.

46:10 Like you can host CPython.

46:12 What if you created an app that is just a C-based app that obviously runs, no problem.

46:17 It already has Python compiled into it.

46:20 And its job is to unravel the virtual environment and run your code alongside.

46:27 So you're just shipping this, your EXE that already comes with Python and like it already

46:34 knows how to run totally reliably.

46:35 It's just a matter of executing your Python code as part of its like internal automation

46:40 or whatever.

46:40 Yeah.

46:41 So I haven't done too much work into all of that, but I think it's things like PyOxidizer

46:48 will help with that or even something that the ones that do the compilation for you, if

46:54 you're trying to deliver an executable like Nutca or even Cython, it can help you along

46:59 those lines.

47:00 Okay.

47:00 Interesting.

47:01 All right.

47:01 Yeah.

47:01 So you mentioned Cython, that one in your article sounded like I'm a fan of Cython.

47:07 I've used it for a couple of things.

47:08 It's really cool that it supports the Python type hints.

47:12 Now it doesn't have its own like type language necessarily.

47:16 It still has it, but it used to be, you'd have to describe your types in the Cython way.

47:22 Now, if you just describe them in the CPython way, Cython goes along with that, which is really

47:28 cool.

47:28 That means you can write kind of just annotated Python in the traditional sense or the normal

47:33 sense and you get compiled machine instruction type stuff.

47:38 That's pretty awesome.

47:39 But it's not really built for packaging, is it?

47:41 The end goal of Cython was really to integrate C and Python essentially so that you can go

47:47 into C code and use Python libraries from it, or you can go into, which is the more common

47:53 part, go into Python code and use a C library inside Python code, like say NumPy or something

47:59 like that.

47:59 Yeah.

48:00 Something beyond just C types and some of the base stuff that Python already has.

48:06 But it'll compile your Python code for you.

48:08 And it has an option to produce a single file executable.

48:12 It just isn't going to do a lot of like, for example, if you do it with Nuka, it'll traverse

48:17 all of your dependencies and compile and put them together.

48:20 But Cython will only do a little bit of that.

48:23 It won't traverse dependencies.

48:25 Right.

48:26 Right.

48:26 It probably expects like, you're going to compile these three files and then put them together

48:30 or something.

48:31 Right.

48:32 And you just want to give it a Python application and say, put these pieces together for me.

48:37 And it's just, it's not really for that, is it?

48:38 Yeah.

48:38 It's not really built for that.

48:40 But it's one of the things I tried.

48:41 Yeah.

48:42 Yeah.

48:42 Sure.

48:42 And it, you know, it does get you C code, which is, and you can compile.

48:47 And yeah, it's, it's a possibility, but it's, yeah, it just seems like it's abusing Cython

48:53 because you, because you could probably make it work, but it's not like it's goal, right?

48:57 Like PyOxidizer doesn't have another purpose other than to package up your thing.

49:01 And so it's kind of what it's for.

49:03 Yep.

49:03 Then two of the things that didn't fit in the taxonomy were Flatpak and Snapcraft, both

49:09 of which are ways to package up an application.

49:13 It's for Linux.

49:16 Is it?

49:17 And specifically Linux.

49:18 Yeah.

49:19 Linux.

49:19 And, and, but what's cool is they, they both have like their own little app store.

49:23 It's kind of like the macOS app store or the Windows 10 app store, but it's the Snapcraft

49:28 or Flat, Flat, Flatpak app store.

49:31 Yes.

49:31 It's more like apt or yum, like its own little package manager type thing.

49:36 And it, it packages everything together with you, Flatpak.

49:40 I don't have a lot of, it's been a while since I've gone into all the details of how

49:46 Flatpak did its, its thing.

49:48 And I think it even included some, some OS stuff when it did all its packaging.

49:52 So you run in a completely isolated environment, your application and Snapcraft does something

49:57 similar.

49:59 And on top of it, it's an app store.

50:01 So type experience.

50:03 So if you push an update, it'll, if you enable it, it'll automatically update your application

50:09 for you.

50:10 Yeah.

50:10 I think that's actually pretty cool.

50:11 Yeah.

50:12 I think that's neat.

50:12 There's actually a lot, actually a lot of use cases for that, even in, in large organizations,

50:17 beyond just, typical customer stuff.

50:20 Like if you're talking about developers, if you have a bunch of developer tools and

50:25 you just produce some new Python package with these tools in it, then you got to go ask all

50:30 the developers to go pip install --upgrade.

50:33 Right.

50:33 Yeah.

50:33 But if you do, if you have something like this and everybody's on Linux, which may or may not

50:38 be true, then you can just push the update out to the developers.

50:43 And since I'm on that, that just reminded me, there's another system, which isn't a packaging

50:48 system, but it's a distribution system called pulp that works a little bit like artifactory.

50:54 If you're aware of that, which is essentially a package distribution system.

50:59 it will do like a private PI PI server.

51:03 Yeah.

51:03 But yeah, it covers like all the different types and languages.

51:06 Yeah.

51:06 Docker registries and all that.

51:08 But pulp has agents that you can install on your systems and push updates to them.

51:12 Oh, I see.

51:13 And then like, Hey, run this script to make sure everybody's got like the newest engine

51:17 X or the newest whatever.

51:19 Right.

51:19 Yep.

51:20 Okay.

51:20 That's pretty cool.

51:21 I definitely like the auto update.

51:22 Now you should be able to a very strong should not necessarily could, but should, if you could

51:28 get high oxidizer or PI installer to truly work correctly, you should be able to take that

51:35 output and put it in the macOS app store or in the windows 10 app store.

51:39 I think so.

51:40 Yes.

51:41 Right.

51:41 And then you get the benefits of doing that.

51:43 Those app stores always have weird restrictions.

51:46 Yeah.

51:47 I know one of the worst parts of my mobile app.

51:50 I know you had your experiences.

51:50 Yeah.

51:51 Oh man.

51:52 I'm still, I don't want to go into it, but I'm still having, let's call them disagreements

51:57 at very strong levels with some of the app stores, right?

52:02 Like just some of them were completely weird and out of place.

52:05 Other are just, I don't know.

52:08 They're just, no, you have to change your app to be like this for no particular reason.

52:12 But they're very frustrating.

52:13 But if it works, it's actually a great experience for the user.

52:16 Right.

52:17 Right.

52:17 When I install an app on my Mac, if it has a version in the app store or I could buy it

52:25 separately, I get it in the app store because then I know it's going to be just be on all

52:28 my machines.

52:28 Yeah.

52:29 I don't have to worry about what happens if I lose the license code or I've activated it

52:32 twice, but that one machine actually died.

52:34 So I'm not actually using it, but I can't deactivate it because it's actually dead.

52:39 Like, you know, like how often have you been through this experience of like, you've over,

52:42 you've used up your five activations.

52:44 It's like, well, but the machines were virtual machines and I threw them away.

52:48 I can't unactivate them.

52:49 I don't know what you want from me, you know?

52:50 So the app stores are good in that regard.

52:53 They are.

52:53 And you can also have the experience of, well, I have all the, all of these devices that are

52:58 registered on my app store and I want to install this application.

53:04 Please install it on all of them for me.

53:06 Right.

53:07 Yeah.

53:07 Because the system's already built with the permissions to do that.

53:10 Then you're set.

53:11 Yep.

53:12 Absolutely.

53:12 Well, I think these are all really good options and I think it's most important to break it

53:18 into that taxonomy.

53:19 Like first, what are you even trying to do?

53:21 Because the fix for one of these is definitely not the fix for another one of them necessarily.

53:27 Right.

53:28 So, yeah.

53:29 But this gives people a lot to think about and a lot to go play around with.

53:32 So, yeah, it's cool.

53:33 Yeah, for sure.

53:36 Yeah.

53:36 Now, I do have one plea, one request for the folks maintaining all of these things.

53:42 Maybe not all of them.

53:44 Like Cython, Cython's off the hook.

53:46 But for many of these things, right?

53:49 For Pi Installer, for Briefcase, for a lot of these, have one or two showcase applications.

53:57 That when you go there.

54:00 And guess what?

54:01 We found this awesome open source GUI application and we built a Mac, Linux, and Windows version of it.

54:08 Here's a screenshot.

54:10 Click to download and run it and see what the experience is as a user.

54:13 Right.

54:14 Briefcase is really cool.

54:15 But I go there.

54:15 There's not like a single example of anything built with it or what.

54:20 Right.

54:20 There's no evidence to me before I commit to trying it out.

54:24 Like, look at this amazing stuff that's built with Briefcase or Pi Installer.

54:28 Right.

54:28 Like, here's three applications that are well-known apps that you probably didn't even know were built on Python.

54:34 Right.

54:35 So anyway, I'm going on and on.

54:36 I'm with you.

54:37 If people are out there like, please put this.

54:39 This will do so much to help the adoption.

54:42 If people can go see like that.

54:44 And it doesn't have to be the owner of that application.

54:46 Find an open source application that's awesome that you could package up and then package it up.

54:51 Like, you know, it doesn't even have to.

54:52 Right.

54:53 You could just do it as your own proof of concept and then tell, like, do a PR back.

54:56 Who knows?

54:57 Yep.

54:57 All right.

54:57 Well, let's maybe wrap it up there for the.

55:00 Oh, go ahead, Chris.

55:01 I was going to say maybe we need one of those awesome lists.

55:04 Awesome lists of Pi Installer applications.

55:06 Awesome list of.

55:09 That's right.

55:09 Mahmoud Hashemi just recently did an awesome Python applications.

55:14 I'm sure there's a bunch.

55:15 I know that there are a bunch of GUI applications there.

55:17 You could go and package one or two of those up and put it on your site.

55:21 Exactly.

55:21 No doubt.

55:22 Cool.

55:23 All right.

55:23 Well, let's leave it there for the packaging exploration landscape.

55:26 And just, you know, talk about a few things really quick before I let you get out of here.

55:30 Sure.

55:30 Is there a rumor that you might be doing less typing and more talking and communicating with the world?

55:36 Maybe.

55:38 I've been exploring the idea of starting up my own podcast, something short form type thing,

55:47 kind of 10 minute, 15 minute episodes with the idea.

55:51 A little bit like developer tea?

55:52 A little bit like developer tea where we just pick a technical topic based on some online article.

55:59 People can send suggestions and we read through it, not in complete detail, but just kind of give you my take on it and just kind of analyze what it's talking about and how it affects just development topics in general and technologies.

56:17 Well, if you get that out, I'm definitely looking forward.

56:19 Are you going to call it the Try Accept Pass podcast?

56:22 That's the plan for now.

56:23 The Try Accept Pass podcast.

56:25 I might change my mind on that, but I think that's good for now.

56:29 That's cool.

56:29 It could be Try Accept podcast.

56:31 Try Accept podcast.

56:32 Yeah.

56:34 Yeah.

56:34 If it doesn't work, make a podcast about it.

56:36 Why not?

56:36 Yeah, exactly.

56:37 Right.

56:37 That's the finally clause of the podcast.

56:39 Either way, you're going to podcast.

56:40 Exactly.

56:41 Yeah.

56:42 Yeah.

56:42 So I was looking for a way to kind of diversify the content I'm putting out with the website, try acceptpass.org, which lately has been doing, well, just finishing up a series on CICD and all the different aspects of it.

56:57 Yeah.

56:57 And you have a newsletter too, right?

56:58 That people can go sign up and hear about it.

57:00 That's correct.

57:01 If you're interested in the site and keeping an eye out for the podcast and everything that's coming up, just feel free to drop by the website and sign up for the newsletter.

57:10 We're also open for any suggestions of anything you want to hear more about.

57:14 Like my biggest request so far has been async stuff.

57:17 So I'm going to be doing a few more things on that.

57:19 Or if you want to contribute an article, it's a good way of getting yourself out there.

57:23 Yeah, absolutely.

57:24 Cool.

57:24 Well, I know the articles you have out there so far are pretty good.

57:28 So people should check it out for sure.

57:30 Yeah.

57:30 The articles are long form too.

57:32 So expect 2,000 word articles more or less every couple of weeks.

57:37 A little bit like a magazine type of article or something.

57:40 Yeah.

57:40 Yeah, cool.

57:41 Yes.

57:41 All right.

57:42 Well, excellent.

57:42 Yeah.

57:42 So keep up the good work over there at trixatpass.org.

57:44 I will keep on chugging.

57:46 Yeah.

57:47 The content creation, it never ends.

57:48 No, it doesn't.

57:49 It's fun though.

57:50 I have lots of fun doing it.

57:52 Yeah, that's awesome.

57:52 All right.

57:53 Now, time for the final two questions before you get out of here.

57:56 If you're going to write some Python code, what editor do you use?

57:58 These days I am using VS Code.

58:01 All right.

58:01 Right on.

58:02 The remote extension is awesome.

58:04 Yeah.

58:04 Yeah.

58:04 Very cool.

58:05 I just read that Facebook has made VS Code their official editor.

58:10 Oh, really?

58:11 Yeah.

58:12 Interesting.

58:12 Which is a pretty interesting move there.

58:15 Yeah.

58:16 So it's cool.

58:16 And then notable PyPI package.

58:18 There's probably some in our list here.

58:20 But what comes to mind, you're like, oh, you should totally know about this thing.

58:23 I'm going to throw out Sanic.

58:25 I've been using Sanic a lot lately as a REST framework.

58:30 But it also has WebSockets integrated with it.

58:34 And so you can provide both endpoints that answer HTTP requests and endpoints that answer WebSockets.

58:39 And it's asynchronous.

58:41 So I've been playing with async APIs, REST APIs using Sanic lately.

58:45 Oh, that's super cool.

58:46 Yeah.

58:46 Sanic is one of the contenders for the hot new async ASGI Python web framework.

58:52 So yeah, it definitely seems like it's a good one.

58:54 Yep.

58:55 I've had great experience so far.

58:56 Oh, that's good to hear.

58:57 All right.

58:58 Final call to action.

58:58 People, they got some kind of Python app.

59:01 They got to package it up.

59:02 What do they do?

59:03 Yep.

59:03 Just have a listen to the podcast and see where you land.

59:09 Make a decision on who your users are going to be and what your best deliverable is.

59:15 And make your choice based on that.

59:18 If you can help out anybody to, like we were just talking about, produce some examples of

59:24 how their packaging systems work, that would be great.

59:27 Yeah.

59:28 And if you're out there and you've built a cool application and you've bundled it up with

59:31 one of these things, shoot a note back to the maintainer.

59:35 Say if you use PyOxidizer, shoot a message back to them and say, hey, here's a cool thing

59:40 I did.

59:40 Could you feature this?

59:43 Here's a picture you can feature on the site.

59:45 Like, I don't know.

59:46 I just think we need more of that.

59:47 Yeah.

59:47 I'm with you.

59:48 And some of it, I know there's lots of apps already.

59:50 And some of them might not even be using any of these systems.

59:53 I think that just having examples of Python producing these types of system applications

59:59 is just good for the language.

01:00:01 I agree.

01:00:02 It would start to break the chicken and egg cycle.

01:00:05 Yeah.

01:00:05 And I'm tired of hearing that Python is only a scripting language.

01:00:08 Yeah.

01:00:09 So am I.

01:00:10 Awesome.

01:00:11 Well, thanks so much for being here, Chris.

01:00:14 It was a lot of fun to go through all this stuff with you.

01:00:15 Yeah.

01:00:15 Loads of fun.

01:00:16 Thanks for having me.

01:00:17 Yep.

01:00:17 Bye.

01:00:17 This has been another episode of Talk Python to Me.

01:00:21 Our guest on this episode was Chris Medina.

01:00:23 It's been brought to you by Tidelift and Linode.

01:00:25 If you run an open source project, Tidelift wants to help you get paid for keeping it going

01:00:31 strong.

01:00:31 Just visit talkpython.fm/Tidelift.

01:00:35 Search for your package and get started today.

01:00:37 Start your next Python project on Linode's state-of-the-art cloud service.

01:00:41 Just visit talkpython.fm/Linode, L-I-N-O-D-E.

01:00:46 You'll automatically get a $20 credit when you create a new account.

01:00:49 Want to level up your Python?

01:00:51 If you're just getting started, try my Python Jumpstart by Building 10 Apps course.

01:00:56 Or if you're looking for something more advanced, check out our new Async course that digs into

01:01:01 all the different types of Async programming you can do in Python.

01:01:04 And of course, if you're interested in more than one of these, be sure to check out our

01:01:08 Everything Bundle.

01:01:09 It's like a subscription that never expires.

01:01:11 Be sure to subscribe to the show.

01:01:13 Open your favorite podcatcher and search for Python.

01:01:15 We should be right at the top.

01:01:17 You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the

01:01:22 direct RSS feed at /rss on talkpython.fm.

01:01:26 This is your host, Michael Kennedy.

01:01:28 Thanks so much for listening.

01:01:29 I really appreciate it.

01:01:30 Now get out there and write some Python code.

01:01:32 We'll see you next week.

01:01:52 Thank you.

Back to show page
Talk Python's Mastodon Michael Kennedy's Mastodon