#79: Beeware Python Tools Transcript
00:00 Can you write me a Python app for all the major platforms out there?
00:02 Oh wait, I also want them to be native GUI applications.
00:07 And I want them to work on mobile, so Android, iOS, tvOS, and watchOS, as well as the major desktops.
00:13 Also, I need them to appear indistinguishable from the native apps in terms of the way you deploy them.
00:19 So a .app on macOS and a .exe on Windows and so on.
00:24 What technology would you use for this if you were going to build it in Python?
00:28 This week, I'll introduce you to a wide set of small, focused, and powerful tools that make all of this and more possible.
00:35 We're speaking with Russell Keith McGee, the founder of the Beware Project.
00:39 This is Talk Python to Me, episode 76, recorded October 4th, 2016.
00:56 Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries, the ecosystem, and the personalities.
01:18 This is your host, Michael Kennedy.
01:20 Follow me on Twitter, where I'm @mkennedy.
01:22 Keep up with the show and listen to past episodes at talkpython.fm.
01:25 And follow the show on Twitter via at Talk Python.
01:29 This episode is brought to you by Rollbar and Hired.
01:32 Thank them both for supporting the show.
01:34 Check them out at Rollbar and at Hired underscore HQ on Twitter and tell them thank you.
01:42 Hi, everyone.
01:43 I want to take a moment and give you a quick update about my online courses.
01:46 I just opened Access for my Python for Entrepreneurs course for pre-order.
01:52 If you're thinking about taking this course, you should act soon.
01:54 Right now, while we're still finishing the content, you can buy it for just $59.
01:58 That's $30 off the retail price.
02:00 And you'll get early access to the content while it's being developed.
02:04 Currently, there's about 3.5 hours of content, and there's more coming every day.
02:08 Check it out at talkpython.fm/launch.
02:11 The early reviews have been great, so I'm sure you'll love it too.
02:16 Now, let's hear about the Beware Project with Russell.
02:18 Russell, welcome to the show.
02:20 Thanks for having me.
02:21 It's my honor.
02:22 We're going to talk about so many things in the Beware Project.
02:25 Several of my guests have actually recommended the Beware Project as something that's really
02:29 standing out in the Python space, and I kind of have to agree with them.
02:33 You guys are doing some cool stuff, and so I'm looking forward to talking about it.
02:36 Oh, fantastic.
02:38 It's been a fantastic ride the last couple of years, and it's over the last sort of 12 months
02:43 who sort of just started to get a lot more momentum and starting to – partially because
02:47 we're actually getting to the point where we've got something we can really show that's
02:50 interesting, not just sort of theoretical.
02:52 So, yeah, really enthused to talk about it.
02:55 Yeah, great.
02:55 Now, before we get to it, let's start with you.
02:59 What's your story?
03:00 How did you get into Python and programming?
03:01 The programming story for me started a long, long time ago.
03:05 My father is a mechanical engineer who kind of saw these computer things at the point when
03:12 home computing was just starting to become a thing, and he got one of the first Commodore
03:17 64s that was available for sale in Australia.
03:20 Not with any specific plan of what he was going to do with it, just could see that these computers
03:25 were going to be a thing and kind of maybe we should play with them a little bit, which
03:29 is something he's always done with technology.
03:30 He bought a hideously expensive 3D printer when they were still hideously expensive, just
03:36 so he could play with it.
03:36 So, yeah, I got introduced to the Commodore 64 when I was 8 or 10, somewhere around that
03:42 sort of territory, and I've kind of been just tinkering with them ever since.
03:47 It's kind of gone from, hey, I can write this really, really dumb, my sister is ugly, my sister
03:52 is ugly, my sister is ugly, go to 10 loop, through to doing a PhD in computer science over
03:59 time.
03:59 So, my undergrad degree actually wasn't in computer science, it's in physics, but I picked
04:04 up all the computing degrees and computing courses I could along the way, and they kind
04:07 of encouraged me to come over to the computer science department for my postgrad studies.
04:12 So, I did my honours in computer science and a PhD in computer science, and then progressed
04:16 from there into working in industry.
04:18 My PhD supervisor and I had a very, very frank conversation at one point about halfway through
04:24 my PhD, even when we decided mutually that my future did not lie in academia.
04:28 And so, yes, from that point, she was happy to try and get me out of academia and into industry,
04:32 and I started working professionally as a computer scientist since then.
04:36 I was in a PhD program, and I know you feel like you're on the path to just keep going
04:41 into academics.
04:42 But I feel personally very lucky that I had a broader exposure around that time to see what
04:49 was possible in industry, because for every opportunity in academics, I feel like there's
04:54 100 opportunities that are just so amazing out there, you know, outside of the confines of
04:59 a university and a grant.
05:01 I think it's great.
05:02 Yeah.
05:03 I mean, for me, it was, I don't know, a slightly more practical thing is that I actually like
05:07 doing things, not just kind of the theoretical aspects of it.
05:10 And I was getting, during my PhD, I was getting very, very tied up in playing around with interesting
05:16 pieces of technology with a view to actually doing something, but wasn't actually furthering
05:19 my research at all.
05:20 So, and it's kind of a precursor to a lot of the stuff that I'm now doing in Bware in some
05:24 regards.
05:25 Excellent.
05:25 Okay.
05:26 So where along the path did you come across Python?
05:28 I first used Python back in the 1.5 days.
05:31 So a long time ago, I was talking like early, late 90s, at which point it was mostly a system
05:38 config language, mostly because Red Hat was using it in their setup tools and what have you.
05:43 At that point, it was kind of, well, this is an odd language with odd syntax.
05:47 I don't want to use odd syntax, so let's not use it.
05:50 What's up with this white space thing, huh?
05:52 Yeah, well, and that's the thing.
05:53 It was, it's the thing that everybody gets caught on.
05:56 But as I sort of grew as a software developer, that interesting property became more and more
06:03 the thing that I actually value in Python.
06:05 So it's one of these things where once you've read enough incredibly badly formatted Java
06:11 code, you realize how valuable it is having a language that literally cannot run unless
06:15 you get the white space indentation, right?
06:17 Yeah.
06:18 And so, yeah, it's sort of, over time, it grew from being just the systems language I
06:22 kind of have to use to something that I vaguely tinkered around with.
06:25 Over that whole period of the sort of mid-90s through to about 2005, when I got involved with
06:32 Django, I've had this series of little background projects that I've tinkered around with.
06:38 And whenever I wanted to learn a new language or a new framework or a new whatever, it's sort
06:41 of the first project is, let's render that in this new language.
06:44 And at some point, I got to the point where, yeah, well, hang on, I can do this in Python,
06:48 can't I?
06:48 Let's build this in Python.
06:49 And yeah, this is actually working really.
06:50 I like the way this is coming out.
06:52 I then got kind of distracted by, hang on, maybe this web thing is actually a thing too.
06:57 Oh, I can use this Python for the web.
06:59 Oh, look, here's this Django thing, which is brand new.
07:01 And 10 years later, I'm still working on the Django project.
07:06 So you actually became and have been for a while a core developer on the Django project.
07:11 That's correct.
07:11 Yeah.
07:11 So I was introduced, like I discovered Django because I was poking around.
07:18 I had this vague idea that the web was a thing that maybe I should know more about, and maybe
07:22 I could use it to solve some of these technical problems that I had.
07:25 And I found Django just before they did like the 0.91 release or around that sort of timeframe.
07:32 So very, very early days, November of 2005, effectively.
07:36 And it was sort of two things really happened.
07:40 One, because it was a really early stage project, the sort of the barrier to getting involved was a lot lower than it is today
07:46 because there's not as much sort of momentum and inertia around what's going on.
07:50 But also because it was written in Python, I come from a physics background.
07:54 I have done theoretical computer science.
07:56 But like all theory, it's utterly useless for actually doing things.
07:59 I never actually formally studied networking or anything like that.
08:03 So when I tried to work out how to build a web page with PHP, the PHP website didn't actually help me at all.
08:10 I didn't understand what it was trying to do.
08:12 But the Django tutorial got me from I don't know how the web really works to, oh, yeah, okay, I can build a website.
08:22 And this makes sense now relatively quickly.
08:25 And when I hit the limits of what Django could do, because it was written in Python, I could dive into it and I could modify it relatively easily.
08:33 I understood what was going on pretty quickly.
08:35 So within a month or two of picking up Django for the first time, I was submitting patches that would – if you've got a many-to-many relationship between two tables,
08:47 back in the day, you could only go from the model that defined it to the model that it was pointing to.
08:51 I needed to be able to go the other way.
08:53 So I added that modification into the query language.
08:56 And when you start making changes like that, the core team, Adrian and Jacob, offered me the commit bit.
09:01 And sort of the rest is history from there.
09:04 Yeah, that's really great.
09:05 Do you feel like getting started and contributing to Django was easier 10 years ago because it was a newer, less mature, less sort of solidified project?
09:15 Absolutely.
09:16 I mean, when things are – like 10 years ago, Django didn't have a backwards compatibility guarantee.
09:22 There was certainly a preference to not just move things around because, but changing backwards compatible things was at least an option.
09:30 There wasn't as much – the community was smaller, so it was easier to get consensus with a bunch of people.
09:36 There wasn't the consideration of a million – if we deploy this change, Instagram is going to break because we all of a sudden have changed this API.
09:45 So, yeah, 10 years ago, it was absolutely easier to get involved.
09:48 There's no doubt about that at all.
09:50 Yeah, that's really interesting.
09:52 I think that's a big tradeoff, right?
09:53 I mean, the value of Django is probably higher now.
09:56 But it's just – it's all sorts of projects that have been around for so long.
10:01 So, let's talk about a project that's not been around for quite that long, and that's your project, Beware.
10:05 Yes.
10:07 So, Beware is interesting because it's kind of many things that work together sort of synergetically.
10:15 And you said that your project follows the Unix philosophy for tools.
10:19 Yes.
10:20 Give us a quick overview of what Beware is and then maybe touch on that.
10:24 Sure.
10:24 Okay.
10:25 So, the place where I started with that sort of Unix philosophy is a talk that I gave at PyCon Australia.
10:29 I think it was four years ago, but I have to check the exact date.
10:32 But essentially, the theory that I was positing at that point was that the Unix philosophy as a process is quite strong.
10:38 Now, the Unix philosophy is the idea that you don't build one tool that does everything.
10:42 You build a large number of small tools, each of which has a well-defined interface.
10:47 So, that – and then the power comes from the small tools being able to plug together really easily or having a natural way of plugging together.
10:55 Now, the unfortunate corollary of the Unix philosophy has become that in order for something to be Unix, it must be text-based.
11:03 So, yes, you can run LS, and LS you can pipe into sort, and sort you can pipe into unique.
11:09 And these are really, really powerful things to do.
11:12 But at the end of the day, it's all text.
11:16 And there are many, many areas where text is not the natural interface.
11:20 And the example that I gave at the time was testing.
11:22 If you run a unit test suite or a pytest suite or whatever, what you get coming up on the screen as the user interface is dot, dot, dot, dot, dot, dot, F, dot, dot, dot, dot, dot, dot, dot, dot, dot.
11:33 Which is completely correct and completely accurate, but not helpful from a user interface perspective.
11:40 What you want to know is which dot is running?
11:42 Why did it turn up an F?
11:44 When something writes to standard output at the wrong time, which test did that?
11:49 How long has my test suite got left to run?
11:52 Now, these are all questions that you're entirely in a position to answer or at least provide good guesses for in the case of something like runtime.
11:57 But when your only user interface is writing something to console, you have – you are deliberate or you have – you have just hobbled yourself in terms of what it is you can actually display.
12:09 So what I was originally positing with the Beware project was that what we can do is build tools that are still Unix related.
12:15 Now, they do one thing.
12:17 They do one thing well.
12:18 But one of those one things can be let's display a GUI that enables me to see all these useful things.
12:24 So here is – where we started was with Cricut.
12:27 Cricut is a user interface for running test suites.
12:30 It shows a tree, which is your test suite.
12:32 You press go and it works through your test suite, highlighting the lines of the tree that are currently running as individual tests.
12:39 As the test suite is running, you can click on other pieces of the tree and see what tests have run and how long they took to run and what output they generated and whether they passed and failed.
12:47 And because you know, well, this is how long the test suite is, this is how many tests there are.
12:53 Each test takes an average of X milliseconds or seconds.
12:56 Therefore, we can estimate this entire suite is going to take 20 seconds to run.
13:00 That's really nice.
13:01 I think the visual component of it is just – I am with you.
13:04 I don't mind working the command line.
13:07 But we have such powerful and beautiful OSs these days.
13:12 Like, I feel like we're using one-tenth of what we can in terms of interactability, right?
13:18 Yeah.
13:18 I've bought a $4,000 laptop with a retina display that's able to render things at a resolution that my eye can't discern.
13:25 And I'm using it to show 80 by 25.
13:27 It just doesn't make any sense.
13:29 Yeah, it totally doesn't make any sense.
13:31 But I think that taking this idea of the Unix philosophy applied to like a modern GUI-based set of tooling, that's really powerful.
13:40 And that's one of the things that I find really appealing about your project.
13:44 Yeah, and that's sort of – like I said, we started – I started initially with Cricket as a proof of concept because, you know, unit testing is a thing that I do a lot of and I enjoy.
13:52 And the unit test suite is difficult to get into when all you've got is dot, dot, dot, dot, dot.
13:57 So here is a user interface that lets you use, interrogate, manipulate a test suite as it runs.
14:02 The other – like I also have – there's another tool called Duvet, which is a coverage tool.
14:06 It takes the code results partially from a test suite but also from anywhere else that it's running and shows you graphically which lines of code have been operated rather than giving you, you know, line 17 to 25 were not covered.
14:18 Well, what's line 17 to 25?
14:19 Oh, it's that for loop.
14:21 Yeah, exactly.
14:22 Yeah, 94% coverage is not the same as scrolling through your code and seeing, oh, there's a red spot.
14:28 Hmm, why is that red?
14:29 Yeah, exactly.
14:30 But in order to get that capability, you don't have to swallow the whole of an IDE.
14:36 You just have to have a mechanism for displaying that isn't 80 by 25 console.
14:43 And so one of the things when I was poking around your projects that seemed to be a theme was they seem to be supported on all the major OSs, at least the desktop ones for the most part.
14:54 Yeah, so that's the intention anyway.
14:55 So originally I use a Mac as my daily developer box.
15:00 I do also do work on Linux mostly as a server capacity.
15:04 I know I have many, many friends who are using Linux as a desktop.
15:08 And, you know, if I write a tool that is useful, I don't want to lock them out.
15:11 You know, I don't – my passion for Mac is not because I particularly like Macs.
15:16 It's because I like the hardware.
15:17 I think it is a usable operating system.
15:20 It is a usable platform where I don't have to mess around.
15:23 If someone wants to use a different platform, they should be able to.
15:26 And my choice of tools shouldn't be affecting their productivity.
15:29 I've been from the beginning very actively trying to do this as a cross-platform thing.
15:34 Plus also from my perspective, you know, one of these days I'm anticipating that I probably will end up leaving Mac and going somewhere else.
15:40 And I want all my tools to keep working, please.
15:41 Yeah.
15:42 That would definitely lock you in if you spent five years building an amazing set of tools.
15:47 But you had to stay on your – whatever OS you happen to have been on at the time, right?
15:50 Yeah.
15:51 You couldn't possibly leave.
15:52 And the thing is, you know, at the end of the day, so much of what these platforms are doing is not platform-specific.
15:57 You know, it's show me a menu, show me a button, show me a pull-down.
16:00 You know, these are generic concepts.
16:02 Originally, it started – like, Cricket is still and was originally built using TK Inter, mostly because it is available cross-platform.
16:10 And you can install it saying pip install, you know, pip install whatever, and it just works.
16:15 And a lot of where Beware has been sort of hunting for the last sort of three and a half years has been TK Inter.
16:20 The major limitation I hit is that TK doesn't have a web widget.
16:24 You can't display a web page in TK.
16:27 And over time, TK's theming on OS X has gotten worse and worse, but that's kind of secondary to just you can't display a web page.
16:35 And trying to write a new widget in TK is just pathologically bad.
16:39 So it turned out for me the easy solution was to write a new widget toolkit, ironically.
16:43 Yeah, I think there's a lot of cross-platform tool or tool chains, but not too many of them seem to really focus on the truly native component.
16:54 And that makes a big difference to me.
16:56 I remember running some Java apps and just looking at, like, the file open dialog.
17:00 Oh, this just so does not belong here.
17:02 What is this thing?
17:03 It kind of resembles a file open dialog, but I know it's not.
17:07 Like, the hotkeys don't work.
17:08 All the various things that you would expect, right?
17:10 Yeah, exactly.
17:12 And so there are cross-platform widget toolkits that work to various degrees of work.
17:17 There are things like Swing in Java, which sometimes looks like native and sometimes doesn't quite.
17:22 And then you've got things like GTK, which, yeah, sure, works on Mac, as long as you're running an X server.
17:27 And then you get the loving user interface of an X server running on your Mac.
17:31 And then there are things like QT and WX, which are relatively mature and been used for a while and have Python bindings.
17:38 But the Python bindings are kind of a secondary thought.
17:41 In the case of QT, there's a whole licensing thing that's going on that's just a complete mess.
17:46 And they're not as simple as pip install widget set because there's compiled components and libraries.
17:52 And you've got to install this 150 meg library.
17:54 And you've got to know which one you've got to have.
17:56 And it just becomes such a nightmare that the basic thing of, I just want this damn thing to run, gets in the way of getting stuff done.
18:03 Absolutely.
18:04 The UIs in your apps look really nice.
18:06 And they're cross-platform.
18:07 What did you do?
18:08 I accidentally stumbled upon a couple of things that I didn't realize were actually possible.
18:13 So I was looking a long time ago at Pygame and realized that Pygame actually manages to do this native thing without actually having a compiled component.
18:25 And the way it does it is because Objective-C, whether you know it or not, is actually a raw C API with some pretty syntax around the outside of it.
18:35 And Python gives you this thing called C types, which lets you call any C API without having to compile something.
18:42 So with a little bit of Python class magic and Meta class and descriptors and what have you, you can write a class in Python that is a pure Python class that looks and feels and behaves in the Objective-C environment like an Objective-C class.
19:00 And then when you go, you look at the next option, you look at GTK.
19:03 GTK provides native Python bindings that are actually native Python bindings.
19:06 So there you've got two major platforms where you can write native applications using the native APIs with pure Python without having a binary component involved.
19:18 And then so from there, it was kind of a, well, okay, that means I've got Coco and GTK, which are the two that I'm sort of covering my bets on.
19:27 Can I do this on Windows?
19:28 Well, yeah, because there's a Win32 and that's a C API.
19:31 Okay, so that works.
19:31 What about, well, but why is anyone going to use this new platform?
19:36 You know, it's nice that it doesn't have this extra compiled component, but that's not sort of compelling.
19:40 What's going to be compelling?
19:42 And this is, again, sort of three years ago.
19:44 It was like, well, what if I could use these widget sets on mobile as well?
19:48 A lot of what I've been doing for the last couple of years is trying to get Python to run on mobile, both on Android and on iOS, so that you can actually then say, well, okay, yeah, I can run this, this similar API or identical API on macOS.
20:02 I can run it on GTK on Linux.
20:04 I can run it on iOS and I can run it on an Android.
20:07 And that's sort of, you know, that's what's been keeping me busy for the last couple of years at this point.
20:11 Yeah.
20:12 And that's quite the achievement, especially the mobile part.
20:16 But I think even, you kind of went through it quick, but I feel like native on the three major desktops is actually a bigger deal than, you know, maybe it sounds at first.
20:26 I think if you're going to build an app and if it can look and behave literally like a macOS app or a Windows app or a Linux app, that is a really big deal.
20:37 And if you can use Python for that, that's even better.
20:40 Now, one of the projects, and I'm sorry, I don't remember the name of the project, but one of the projects you're working on is bundling that up so you can distribute.
20:48 You can actually ship sort of a bundled up version of Python with everything it needs to run your app, right?
20:54 Correct.
20:55 Yeah, that's briefcase.
20:56 So, yeah, the idea of briefcase, yeah, is to say, well, okay, a macOS application is basically a directory with some metadata in very specific places.
21:05 And historically, giving someone a tool that is written in Python is kind of a, well, you need to install Python, but you need to install it from here and you need to give it your system password.
21:16 And then you've got to hope that someone hasn't buggered up the site packages directory and, and, and, and, and, and.
21:22 Here's the dependencies.
21:23 Install those too.
21:24 Yeah, and then you sacrifice the chicken and wave the blood this way and hopefully it works.
21:29 Unless you're on Windows, then you better find out where VCVAR is about.
21:32 Oh, exactly.
21:34 And, you know, because every Windows user knows how to set their path variable.
21:37 But at the end of the day, we're now at the point where a 100 megabyte application is absolutely nothing.
21:42 You know, okay, 10 years ago, that was a major drama, but now that's just getting up in the morning.
21:46 So why not ship the version of Python you actually need with the dependencies you actually need?
21:51 And when you run it, it runs it locally.
21:53 And so, okay, with macOS, well, yeah, I can do that.
21:57 I can template.
21:57 I can use cookie cutter, which is a fantastic project from Audrey Roy Greenfield and Danny Greenfield Roy, to like template out what this application needs to look like.
22:06 And then your Python script goes here and your dependencies go there and we can pip install into that directory, zip it up, ship it to someone, and it just runs because it's pure Python.
22:15 You're giving them the Python interpreter it has to use with the dependencies that they need and it's running natively.
22:20 And then from there, you can do similar sorts of things.
22:23 I haven't done as much work with Linux because installing apps on Linux doesn't quite work as well.
22:28 I've done some exploratory work with Windows and it should absolutely be possible on Windows, possibly to the point of like actually generating an MSI installer that looks like it's a completely native installer.
22:38 It just happens to spit out something that starts a Python interpreter, but you never know that.
22:42 I think the irony is we in the Python community will be successful on these desktop systems and mobile systems if people don't know that they're running a Python application.
22:55 Oh, absolutely.
22:56 I completely agree.
22:57 So as soon as you know or you can tell what tool someone used to build something, I think you've lost the game.
23:04 Like you need to be able to run a piece of software and just be able to give it to anybody and it will just start, it will just run, it will behave the way they expect it to and they don't get any surprises.
23:14 Anything less than that and yeah, okay, yeah, it may be very useful in various areas or demographics or whatever, but you're not going to get the mass market adoption if you've got to hold your breath and lift your leg in a funny way on a Tuesday when the moon's full in order for it to work.
23:29 Yep, it might work for developers, it might work inside your company, but it's not going to be something you can broadly distribute if that's the story, right?
23:36 Yeah, exactly.
23:37 But even beyond that, I mean, looking at the developers themselves, this is part of the great lamentation about why I got involved with Beware in the first place.
23:44 You shouldn't be in a situation where you have to be this tall to get onto this development project.
23:49 If you can't just pick up a tool and use it and pick up a tool and develop it, then you've just set a barrier to entry to anybody helping to make your project better.
23:58 So the dream of open source is that anyone can get involved, anyone can make their project better, anyone can contribute a patch.
24:04 But if I can't even get a development environment going without 10 years of a computer science experience, then what the hell chance has the random person who has no computer science background got of fixing the tool?
24:15 They don't.
24:16 It's the being able to contribute open source dream is at best a dream.
24:21 Yeah, yeah.
24:22 And then you end up with people running to things like JavaScript because, hey, we can all start a browser or something like that, right?
24:29 Yeah, exactly.
24:42 This portion of TalkPyPundemy has been brought to you by Rollbar.
24:47 One of the frustrating things about being a developer is dealing with errors, relying on users to report errors, digging through log files, trying to debug issues, or a million alerts just flooding your inbox and ruining your day.
24:59 With Rollbar's full stack error monitoring, you'll get the context, insights, and control that you need to find and fix bugs faster.
25:06 It's easy to install.
25:07 You can start tracking production errors and deployments in eight minutes or even less.
25:12 Rollbar works with all the major languages and frameworks, including the Python ones such as Django, Flask, Pyramid, as well as Ruby, JavaScript, Node, iOS, and Android.
25:21 You can integrate Rollbar into your existing workflow, send error alerts to Slack or HipChat, or even automatically create issues in Jira, Pivotal Tracker, and a whole bunch more.
25:30 Rollbar has put together a special offer for Talk Python to Me listeners.
25:34 Visit Rollbar.com slash Talk Python to Me, sign up, and get the bootstrap plan free for 90 days.
25:39 That's 300,000 errors tracked all for free.
25:42 But hey, just between you and me, I really hope you don't encounter that many errors.
25:46 Loved by developers at awesome companies like Heroku, Twilio, Kayak, Instacart, Zendesk, Twitch, and more.
25:52 Give Rollbar a try today.
25:54 Go to Rollbar.com slash Talk Python to Me.
25:56 Yeah, so you said, well, your website, which I'm presuming you had a say in what it said,
26:10 says that the end goal of the Beware project is to be able to do for mobile and desktop facing software the same thing that Django has done for web software.
26:18 I think that touches on the point you just made that like Django, the Django community, Django girls, all these different groups seem to have found a way to make it really easy to onboard into dynamic server-based web development,
26:33 which is not really a simple thing to do, to be honest.
26:36 There's a lot of moving parts and things you've got to know.
26:38 Yeah, and I suppose that's the Django girls analogy is really the one that's really is my yardstick for when this is successful,
26:46 because what the Ola Sotaska, Ola Sendecker have done and the rest of the team with Django girls as it's grown has been absolutely amazing,
26:53 because it proves that you don't need to have a computer science degree to be able to do things on the web and to do really meaningful things on the web too.
27:04 You can take people who are intelligent and engaged with no computer science background and in a day's training course,
27:11 get them to the point where they have a database-backed website that is under their control, publicly visible somewhere on the internet.
27:18 Now, there's that, yeah, at some level, that's an absolutely huge achievement, you know, because this is incredibly empowering for those people.
27:26 But it also, having APIs, part of the reason it's possible is because we've got an API, we've got Django,
27:31 we've got a language like Python that is readable and gives reasonably good error messages and enforces reasonably good practices.
27:38 But we haven't done it by taking something and dumbing it down.
27:43 We've taken the live tool and just pointed them in the direction of things they have to do.
27:48 That's powerful.
27:49 That's super powerful.
27:50 I think that's also one of the powers of Python is there are simple languages out there, Visual Basic, for example,
27:58 that is super easy to get started with, but they don't go very far.
28:01 And then there's really powerful languages like C++, Java, C#, whatever.
28:07 But there's, you know, that first step is like a really big jump.
28:11 And Python, I think, is just really well designed in that it actually spans both of those.
28:17 And so we're kind of lucky to be in this space as well.
28:20 Yeah, no, I agree.
28:21 I mean, it's Python is a language that is easy enough to teach to beginners and simple enough and conceivable enough that you can –
28:29 hello world is one line of code.
28:30 You don't have to teach a whole lot of computer science concepts to get going.
28:34 But that doesn't mean the computer science concepts aren't there.
28:37 You can do asynchronous decorators and, you know, all this kind of really, really hardcore computer science stuff without –
28:44 but you can opt into it as you need to over time.
28:47 And you can get basic stuff done.
28:49 And Django, you know, something like Django, you can provide an API that lets you get stuff done with most of the important –
28:56 sort of the difficult questions answered for you, but with an option in the future that if it ever starts to become a problem,
29:02 you can dig in and replace that decision with something that's going to scale better or perform better or whatever the problem happens to be.
29:09 Yeah, absolutely.
29:10 And we have a lot of good examples like, hey, you can build Dropbox or Instagram or whatever.
29:14 Yeah, exactly.
29:15 I mean like, okay, well, whatever you're trying to do is probably not that complicated.
29:18 So perfect.
29:19 This will work for you.
29:20 You can scale from Django Girls to Dropbox without – or to Instagram without – you know, okay, yes, you've got to level up along the way.
29:27 And there's – you know, the Django that's being used in Instagram is not the same Django that's being used in Django Girls in some regards because so many parts have been swapped out.
29:35 There was a quote from Cal Henderson at the very, very first DjangoCon where he sort of points out that the frameworks – the companies that are at the top of that performance tree,
29:45 the top 1% of websites have very, very unique requirements because they've got very specific traffic patterns and very specific queries that need to be issued.
29:53 And there are some things they have to do a lot of that other people don't have to do a lot of.
29:57 The good news is that 99% of websites are not in the top 1% of websites.
30:02 So for most of those websites, you can just take a common entry point, give them something generic, and as long as they've got the power to move over time,
30:09 then it doesn't matter that you're hiding the detail from them initially.
30:12 Yeah.
30:12 Yeah, that's really great.
30:13 One of the things that I thought would be fun to do for the audience would be to look at all the different projects that you have going on
30:20 because I looked at it here and I was just blown away at how many different things, you know, following the Unix philosophy that you pointed out,
30:27 cool little tools that fit together that you guys have here.
30:31 So maybe we could do like a quick survey of those.
30:33 Sure.
30:34 Okay.
30:34 And it's interesting that this is actually, no, reactions are probably the wrong way to putting it.
30:39 It's sort of, it's lessons learned from being involved in Django.
30:43 The Unix philosophy here is not just about a single tool that does something well and therefore makes it easy to use and powerful to plug into something else.
30:50 It's also a contribution aid because if you've got a tool that you know only does one thing and only does one thing well,
30:57 the code base is inherently smaller.
30:59 Now, overall, the amount of lines of code that are ultimately going to end up in everything that's Bware is probably going to be as big, if not bigger than Django, I imagine.
31:06 But if you want to just contribute to the coverage tool, you can look at just the code for the coverage tool.
31:13 You don't have to carry the entire baggage of all of Bware to be able to understand that one piece.
31:18 Yeah, that's a great point.
31:19 It makes it easier to consume piece and which makes it easier to get involved.
31:23 But yes, so a survey of what we have.
31:26 Sure.
31:27 Well, also, I think that also is helpful from a project management and scope perspective.
31:32 Like somebody proposes a feature for Cricket, the test runner.
31:36 Well, like it really had better be about running tests, right?
31:39 And not like an editor feature or something, right?
31:41 Like if this was some giant project that did all these things, well, maybe it makes sense to add this funky drag and drop editor thing that somebody's proposing or whatever their idea was, right?
31:50 Yeah, yeah, exactly.
31:51 And, you know, you can say, well, okay, yes, this should absolutely be a tool.
31:54 It's just not Cricket because Cricket is a test runner.
31:56 Yeah.
31:57 Excellent.
31:57 Perfect.
31:58 So just for people listening, you can find all this stuff at pybee.org.
32:02 So P-Y-B-E-E dot O-R-G.
32:04 And so let's talk about some of the tools.
32:07 Like you had built some tools for actually performing checks when people do pull requests.
32:12 And you call that B4 with two E's.
32:14 Nice.
32:15 Yes.
32:15 We're big on puns as well.
32:17 So there's almost always an inside story or a background gag.
32:23 The person who suggested B4 to me suggested at the same time a different name that I really am kicking myself I didn't pick, which was Apis Praiore, which, yeah, sort of is the Latin for B.
32:34 But, you know, Apriori, Apis Praiore.
32:36 But, yeah, so B4 is – we haven't actually got that one live yet.
32:39 It's basically we're looking for a way to actually run that and integrate.
32:43 But it's essentially – all it does is listens for a pull request trigger, runs in the same way that you don't – you know, pysetup.py –
32:49 pysetup.py test runs your test suite.
32:52 Pythonsetup.py B4 will go through and run linters.
32:56 It'll go through and run spell checkers.
32:57 It'll go through and run any of the pre-commit checks that you might have, which is also not something that's particularly uncommon.
33:03 But the thing that's different is that it integrates with GitHub so that when you – if you look at, like, your GitHub pull request, if anyone's integrated with something like Travis, it will run your pull requests – sorry, run your pull requests through Travis, run the test suite, and then if it passes the tests, give it a little green tick.
33:18 B4 will also put a little green tick to say, and the linting is fine, and the spell checking is fine, and this, and this, and this.
33:25 So just as a sanity checker, before anyone even reviews a pull request, we can go through 15 different checks if we need to about what this code needs to look like and provide the automated feedback to say, oh, yeah, no, hang on.
33:38 You've got an indentation problem here on line 17 and a spell check – a spelling problem in your documentation over here and so on and so on.
33:46 That's actually taking a suggestion from the Rust community that they've sort of discovered – I don't know if it was accidentally or intentional or if there's something behind it – but that if you've got feedback that needs to be given, it's – that is sort of mechanical in nature.
34:01 It is better for that feedback to come from a robot because people understand that robots don't have emotions and aren't being – they're not picking on this because you're a human.
34:09 They're picking on this because it's not fitting a rule, and so they will work with it.
34:13 It also means it can be automated, which is one more thing that you don't have to do as a developer who is reviewing this code.
34:21 If I look at a B4 approved patch, I know that it passes all the tests, and it has been linted, and it doesn't have any spelling mistakes, and so on and so on.
34:29 Yeah, it's great, and so you save your energy for reviewing things like algorithms and the checks that should be there and whatnot, right?
34:36 Yeah.
34:37 Cool.
34:37 So the next one that's on the list is Duvet, which is your coverage visualization tool.
34:42 We talked about that.
34:43 And then there's Briefcase.
34:45 That's the one that lets you package your Python app into a standalone application, and I just can't get over the possibility of how cool that is.
34:53 I know there's been like Py2exe and CX Freeze and Py2app, and they all seem to like almost work, and they just drive me crazy.
35:02 Yeah, and that was kind of my – like I'm aware these projects exist, and a lot of them work really well for Windows but don't work on any other platform.
35:11 So in some cases, I will admit I haven't actually done a whole lot of packaging work here on Windows, and I haven't done any on Linux at this point.
35:18 But the approach that I'm sort of taking there with the way Briefcase is working is basically, well, here is a template for what an app needs to look like if only I knew the one script I need to run.
35:28 Put my one script here, and the rest goes.
35:30 It's also a helper sort of thing for iOS and Android because in order to get an iOS project running, you can't just drop a Python script somewhere.
35:39 You actually need to have this great big iOS Xcode project, and most of that can be automated.
35:45 Yeah, and it actually creates an Xcode project file, right?
35:49 Yes, exactly, and the intention is in the not-too-distant future, hopefully, that it will create the Xcode project, compile the Xcode project, push the Xcode project to the device, and start it.
35:59 Yeah, that's fantastic.
36:01 Yeah.
36:01 Like I said, I'm very thrilled about this, and this is going to require lots of attention because that looks cool.
36:07 The other one that we talked about that's next in the list is Cricket, so that's your GUI test runner.
36:12 That was your first foyer in this whole beware plan, right?
36:16 Correct, yeah.
36:17 Yeah, that's where I started as a proof of concept that, yes, you could build a cross-platform GUI tool that was useful for development purposes that you could pip install into your development environment and just use.
36:29 I mean, the thing that's interesting there, that sort of pip install thing, if you've got – like test runners aren't unusual in IDEs, but in order to get them to work, like you need to know where PyCharm puts its path setting.
36:39 You need to know where the environment variables go for the test environment to start up.
36:45 So like in Django's context, it's, you know, you need to set Django settings.
36:48 You need to know where the Django settings file is so that the application can start.
36:53 Working out where to put that in your IDE is a complex thing.
36:57 Whereas with – one of the interesting side effects of Cricket is because you pip install it into your environment, when it starts, it forks from inside your running Python environment.
37:05 So you inherit all the environment that it needs to run in.
37:09 So as long as you can run a test suite, as long as your environment is set up the way that, you know, your command line environment should be set up, Cricket just works.
37:18 You don't have to – there is no configuration dialogue for Cricket.
37:20 Yeah, that's awesome.
37:21 I really like it.
37:23 And, you know, the playful icons and the fun names really make it, like, enticing to go explore these.
37:30 So the next one, speaking of that, is called Bug Jar.
37:33 Yeah, and I'm actually mildly surprised that that name hadn't been taken anywhere because it seems like an absolute gimme for a debugger.
37:39 That's actually, like, if you dig back into the archives behind – before Cricket, Bug Jar is actually where I really started because what I really wanted – PDB is an incredibly powerful tool.
37:50 PDB is – the API, the way it all works is fantastic.
37:54 The PDB interface, to my mind, is toxic.
37:58 And I know that there is IPDB and there's PDB++ and there's a bunch of other tools out there, but they're all console-driven.
38:04 And I know there is WinPDB, but I've never been able to get it to actually, you know, work.
38:09 What I really, really wanted was the debugger that was like the one that I had in 1988 when I first got my copy of Ball and C, but for Python.
38:19 And I got a little distracted along the way.
38:22 Eventually, I'm going to get back there, I swear.
38:23 That's a great idea, and I really appreciate a visual interactive debugger myself as well.
38:29 I know you can do it with – in the command line, but it's not the same when you're working on a large project, in my opinion.
38:36 Yeah, I mean, the visual scope and context you get by having an arrow pointing at a line of code with a window on the side that says the value of X is 3 versus a command line interface where you have to type 15 commands to get the same amount of information.
38:50 It just – it seems like a no-brainer to me.
38:52 Yeah, absolutely.
38:53 So the last one is kind of a quick documentation one called Galley.
38:57 Yeah, the name on that may actually need to change because we've lost the namespace on PyPI.
39:02 That's the one that finally pushed me over the edge with TK because TK doesn't have a web widget.
39:08 I write documentation.
39:10 I like – I don't like writing documentation, but I appreciate the documentation is important and I need to write it.
39:15 But Sphinx, as much as markdown and restructured text try to look like markup, they don't.
39:25 So you end up writing a bunch of code, compiling it.
39:28 Oh, I missed – I didn't put – there's one less underscore that I needed on that particular thing or I forgot the colon after this bit.
39:37 So the idea behind Galley was to provide you a text window on one side where you edit your text and then actually render it so you can see what it looks like as you modify it.
39:45 But in order to do that, you need to have a web browser to actually display the content of the code or the content of what has been generated and you can't do that in TK.
39:54 Actually, the other interesting thing about Galley is that it actually takes me a little bit closer to the thing that got me involved in Django in the first place, which is an editing tool.
40:02 There's a whole other podcast in the tool that in my dream of dreams I'm eventually one day going to write.
40:08 That's sort of an editor that is context-sensitive or syntax-sensitive.
40:12 But, yeah, that's a talk for another time.
40:14 All right.
40:15 Awesome.
40:15 Sounds great.
40:17 All right.
40:18 So that wraps it up for the tools.
40:21 Let's talk about some of the libraries.
40:22 And these libraries are – each one of them is really ambitious.
40:25 And it's just one more library.
40:27 So that's pretty cool.
40:28 So the first one is Coliseum.
40:31 This has to do with the layout and putting stuff basically on a screen.
40:36 Is this for the web or is this for your Python desktop app?
40:40 No.
40:41 So this is actually targeting – like the reason I started that project is specifically because of Toga.
40:45 When I started Toga, the original plan was to use something called Cassowary, which is if you've ever programmed for iOS,
40:52 it's the constraints algorithm that underpins Cassowary.
40:56 So that underpins iOS.
40:57 So effectively, it's a linear algebra approach to describing how widgets appear on a page.
41:03 If you've ever written any GUI code for a native application, you effectively have to say,
41:09 I've got a button and a button, and there's a split pane, and the split pane is this, and so on and so on.
41:14 And there's usually some box model that's involved, which here is a stack of vertical boxes,
41:18 or here is a grid of some description.
41:20 The Cassowary is trying to do an algorithmic approach, which says, I'm going to specify how my desktop lays out as a series of linear programming constraints.
41:30 So the left side of this button must be 10 pixels from the left side of the screen,
41:35 but the right side of the button must be no more than 10 pixels from the right side of the screen, and so on.
41:41 And then you run Cassowary to solve the linear programming constraints, and then your widgets appear on the screen.
41:47 Now, that's incredibly powerful, but it's also an absolute pain in the butt if when it goes wrong,
41:54 because all of a sudden you're trying to solve-
41:55 Yeah, it's super hard to debug that iOS stuff, and you're just like, what is going wrong with this?
41:59 Why does this not work?
41:59 When it works, it's great.
42:01 When it doesn't, you are screwed.
42:03 So prompted mostly by React, they sort of, or React Native rather, they sort of pointed out that you could lay out,
42:11 like the CSS box model, yes, it's intended for the web, but there's actually nothing web-specific about it per se.
42:18 It's basically just a set of algorithms for how you put boxes of content and relate boxes of content in a tree-like structure.
42:25 So what I said originally ported just the version of Flexbox that React has developed,
42:31 and the intention is to connect that into a full CSS2 plus Flexbox plus any of the other interesting pieces of the CSS spec
42:40 that you can use for any boxes.
42:42 Now, obviously, that immediately translates to buttons, widgets on a page,
42:46 but you could also do things like, okay, I need a HTML to PDF translator.
42:52 Well, okay, I can take the DOM tree that I've got and use that to turn out a set of drawing instructions.
42:57 So the intention is that ultimately Colosseum is going to be powerful, or it will be powerful enough
43:03 that you can throw an arbitrary piece of CSS and some tree of content and be able to render it.
43:10 The interesting side effect of that, of course, is that when you actually want to take Toga and deploy it to the web,
43:15 which is something I've spoken about at DjangoCon Europe this year, it means that you've actually got CSS.
43:21 So you've got the same layout mechanism on the web that you're using in your native GUI toolkits.
43:27 So you don't actually have to have a separate layout scheme working out there.
43:30 Yeah, that's cool.
43:31 I really like it.
43:32 That's quite ambitious.
43:34 I definitely think CSS is a fabulous way to layout things.
43:39 I've used a lot of Windows, rich GUI type of layouts, and I've always gone, gee, if I just had CSS, this thing would be maintainable, you know?
43:48 I will admit I do have a bit of a love-hate relationship with CSS more generally, but it's sort of – in terms of a general – it is something that is well-known.
43:56 It is something that is well-understood.
43:57 It is something that is well-documented.
43:58 It is something that is open.
44:00 And that sort of combination of stuff, but the only – it makes it really powerful, but the only thing we don't have is an open implementation that isn't tied to a browser.
44:09 Yeah.
44:10 So, yeah, at some point I'd need to sit down and spend a whole lot of time just working on Coliseum.
44:15 At the moment it's fairly limited in what it can do.
44:17 It's useful enough but not completely CSS or the complete CSS.
44:20 Sure, sure.
44:21 Yeah.
44:22 Cool.
44:22 And, you know, I think part of that frustration, at least projected my own frustrations I've had with CSS and things like that and the design is,
44:30 more about when the implementation varies.
44:33 It's like, why does IE have a line here, a border, and why does Firefox have a space and Chrome has neither of these, like – that's not really a frustration with CSS.
44:41 That's just, like, with the browsers.
44:43 Yeah.
44:44 Yeah, for sure.
45:00 IE platform for top Python developer jobs.
45:02 Create your profile and instantly get access to 3,500 companies who will work to compete with you.
45:07 Take it from one of Hired's users who recently got a job and said, I had my first offer on Thursday after going live on Monday and I ended up getting eight offers in total.
45:15 I've worked with recruiters in the past, but they've always been pretty hit and miss.
45:18 I tried LinkedIn, but I found Hired to be the best.
45:21 I really like knowing the salary up front.
45:23 Privacy was also a huge seller for me.
45:26 Sounds awesome, doesn't it?
45:28 Well, wait until you hear about the sign-in bonus.
45:29 Everyone who accepts a job from Hired gets $1,000 sign-in bonus.
45:33 And as Talk Python listeners, it gets way sweeter.
45:35 Use the link Hired.com slash Talk Python to me and Hired will double the sign-in bonus to $2,000.
45:41 Opportunity's knocking.
45:42 Visit Hired.com slash Talk Python to me and answer the door.
45:48 Yeah, so you mentioned Toga a couple times and Toga is a Python native, OS native GUI toolkit.
45:59 Yes.
46:00 Tell us about that.
46:02 Okay.
46:02 So this is essentially the bit that comes before the actual application.
46:06 So the philosophy we've kind of taken is that native is good.
46:10 Native is what you're looking for.
46:11 You want something that looks native, feels native.
46:13 It's not pretending to be agnostic.
46:16 It's not pretending to be the platform that it's not.
46:18 It gives you – if you want a button, it's a button the way that a button looks on that platform.
46:23 And it sort of does that by being Python first, Python native, which means that you're not looking at an API that is very obviously C wrapped in Python.
46:32 It enables you to do things like – the classic example is whenever you've got a long-running task in most widget toolkits, they are C or some variant thereof.
46:43 And so you come up with some small quantum of work that can be evaluated and you push that quantum of work into some form of timer in a separate thread that gets evaluated at some regular interval.
46:56 In Toga, you use the same – just a function that's a callback except you make it a generator.
47:01 You make it yield regularly.
47:03 And when it yields, what it does is it yields to the event loop and then it resumes inside where it was previously.
47:09 So you can exploit the fact that Toga gives you – or so Python gives you this mechanism to resume where you were inside a method, which isn't a capability you have inside Java and C and C++ and so on, to produce an API that is rich and flexible.
47:24 You know, when you want to specify a list of something, you just give it a list of something.
47:28 When you want it in a string, you just give it a string.
47:30 And it works out how to make that render in a native fashion, in a native appropriate fashion.
47:35 Yeah, that's really amazing.
47:37 And if you want to try it out, anyone listening can just pip it, soltoga, T-O-G-A, and then toga-demo, right?
47:44 And then boom, you have a running GUI right there.
47:47 It looks totally native to me.
47:49 Yeah.
47:49 And it is completely native because it is – you know, when Toga demo runs, it is firing up on Mac.
47:54 It's an NS window with an NS split pane with an NS list or NS table and so on and so on.
48:01 And when you click on the button that's a dialog, it's an NS alert box or whatever it happens to be.
48:05 And then if you do exactly the same on the GTK, it's a GTK window with a GTK split pane with a GTK button in it and so on and so on.
48:12 So if you look behind this, it sounds like it's incredibly complicated, but the actual code behind Toga is relatively simple once you've got the bridging to the native layer done.
48:20 On GTK, you get that for free because there is a native Python API.
48:24 And Rubicon, which is the library that lets us get to Objective-C, is complex but almost completely transparent because you just sort of name the classes and name the methods in a slightly funny way and you can access them.
48:35 So the native Toga implementation of a button on macOS, for example, is about 30 lines of code and it's 30 fairly straightforward lines of code at that.
48:46 So adding new widgets is relatively simple.
48:48 And at the end of the day, if you do actually want to get into a widget that is very macOS specific, you can just drop into that level.
48:54 Okay.
48:55 Yeah, that's really great.
48:56 Toga looks really amazing.
48:58 And like I said, I think building out these truly OS native things in Python, mix that with a briefcase.
49:06 Very lovely, right?
49:07 So the next one, I'm sure I'm going to mispronounce.
49:10 So can you hit it for me?
49:12 Okay.
49:12 So that's Oroboros.
49:13 Oroboros.
49:14 Okay.
49:14 Yeah.
49:15 Yeah.
49:15 So Oroboros, for those who don't know the Greek mythology or the old Latin mythology, it's the image of a snake eating its own tail.
49:24 So the idea here is that if we're going to – part of being – of Toga is trying to be cross-platform.
49:30 So we've got it on macOS.
49:31 We've got it on GTK.
49:32 We've got it on – we've got some parts of it on Windows.
49:35 But they're all just sort of standard Python running in standard Python-y kind of ways.
49:39 We've got Python running on iOS, and that's actually just CPython compiled for iOS because iOS is, as much as they try to hide it, C under the hood and Clang under the hood.
49:49 But on Android, they really, really, really want you to be using Java.
49:53 So I've kind of had to do a bit of an interesting shim to get there, which I'm sure we'll come to.
49:56 And for deploying to the web, if you want Python on the web, well, you've got to have it written in JavaScript.
50:03 In order to do that, you need an implementation of the Python standard library written in – written so it works on that platform.
50:10 Now, a lot of the Python standard library is written in Python, but there are some parts that aren't.
50:13 So things like the underlying core of date time, mk time, and time structure T and things like that are native concepts.
50:21 So you've got to have a native implementation of those concepts that the rest of the standard library can then build on.
50:26 And so Oroboros is attempting to build as much of the standard library in Python as we can possibly build, cribbing from CPython when we can, and then filling out the rest with the interface, the API that you need to implement in order to have date time working inside a web browser or working on an Android phone.
50:48 That's really amazing.
50:49 Have you combined that with PyPy?
50:52 I think we have actually taken some pieces with PyPy, and I think there probably is some crossover there in terms of what we're doing and what they're doing in that PyPy benefits from having a pure Python version of any module because they can then optimize the entire VM rather than just optimizing parts of it.
51:07 So at some point, I don't know if we'll merge with PyPy, PyPy merges with Oroboros or whatever, but there is a piece there that I think that can be shared at the very least.
51:16 Yeah, absolutely.
51:17 That definitely seems like that would be great because if you have it in pure Python and you feed it to PyPy, it should go nice and fast.
51:23 Theoretically.
51:24 That's the intention, yeah.
51:25 And that is ultimately what PyPy is doing a lot of the time.
51:28 It is just they have re-implemented parts of what is written in C in Python so that it will run fast because they can pass the full bytecode optimizer over everything it's doing rather than just parts of what it's doing.
51:40 Right, absolutely.
51:41 So that brings us pretty naturally to the next major category, which you call bridges.
51:46 Yes.
51:48 I love the subtitle, boldly going where new Python has gone before.
51:51 Sorry, the question from before might be like, well, all right, great.
51:55 It's a pure Python standard library.
51:57 Like, what can you do that?
51:58 But then you have Batavia, which would work really well with that, right?
52:03 Yeah, so the idea here is that Batavia specifically started as a bit of a joke at PyCon Australia Sprints last year.
52:10 I don't particularly like JavaScript.
52:12 I accept it that it exists and it is the lingua franca that is on the web and it's not going anywhere.
52:16 And I don't want to language shame anybody for having knowing JavaScript.
52:19 It is an important language to learn, to know, and there are some very valuable things in there.
52:23 But I would be a very happy man if I never had to write another line of JavaScript in my life.
52:27 So part of that is that if I'm going to write web software and I want responsive front-end web software, I need to have Python running in the browser.
52:36 Or alternatively, I need to rewrite everything I'm doing on the server in JavaScript, which given that I don't want to do that, I need to get Python into the browser somehow.
52:45 So what Batavia does is take a look at the fact that when you compile CPython, now Python as a whole is a, you know, if you wanted to have a complete Python compiler and interpreter and everything, yeah, that's a big thing to build.
52:59 And there are people who are doing that.
53:01 You know, Brython and Sculpt both do that.
53:03 PyPy.js takes a slightly different approach.
53:05 I had Ryan from PyPy.js on and there's a bunch of cool stuff that's happening to him.
53:09 But a lot of those projects are really large or they make big trade-offs in terms of support.
53:13 Yeah, so like, you know, PyPy.js, I don't know exactly where it's at in terms of size now.
53:17 But like the first time I looked at it, it was like 20 megabytes as a compressed download.
53:21 And that's fine if you've got that already cached.
53:24 But if you want to build your next Instagram, downloading a 20 meg bootstrap is just not a candidate.
53:30 So Batavia treats it at a slightly different angle.
53:33 So in saying instead of we don't actually need the full Python interpreter or the full Python compiling tool chain with a REPL and everything else,
53:40 what we need is the ability to run Python code.
53:43 CPython compiles to bytecode.
53:46 Bytecode is a simple virtual machine with 150 odd instructions, most of which are push, pop, add value, subtract value, this kind of thing.
53:54 Can we implement that virtual machine in JavaScript and then just give it Python bytecode?
54:00 And the answer is yes.
54:01 And it turns out to be a relatively small amount of bytecode as well.
54:04 You can get Batavia, like a fully functioning Batavia instance running in something like 10 kilobyte of compressed JavaScript.
54:11 And I'm sure there's all sorts of opportunities to optimize there as well.
54:15 That's amazing.
54:16 And that's totally acceptable for downloading 10, 15K in JavaScript.
54:19 Yeah, yeah, yeah.
54:20 So that's less than your logo image in most cases.
54:23 You know, it's easily an achievable goal.
54:25 And all you're really losing is really performance at that point because it is CPython that is running.
54:32 It's just running in the browser using JavaScript to emulate the pieces that can't be done natively.
54:38 Now, the other thing I have to shout out here is part of the reason that I know this or I thought this joke actually might be plausible is a blog article slash book chapter written by Ned Batchelder and Alison Captur called Architecture Open Source Volume 4, which looks at sort of a bunch of complex problems and says, okay, let's solve this problem in 500 lines or 500 lines of Python.
55:04 And Alison's chapter in that book.
55:07 Yeah, that's a cool book.
55:08 Yeah, it's a very cool book.
55:09 Yeah, it's an amazing book.
55:10 And one of the chapters in there is here is a Python interpreter written in 500 lines of Python.
55:14 And that blew my mind when I read it.
55:18 It's amazing stuff.
55:19 But it also means, hang on, 500 lines of Python, that means I should be able to do it in about 500 lines of JavaScript as well.
55:25 And that's about dead on.
55:26 It's not that far from it.
55:27 You need a little bit more bootstrapping to say like JavaScript's only got numbers.
55:31 You need a concept of integers and floats and they need to behave the right way.
55:34 There's a little bit of bootstrapping you need to do around the outside.
55:37 But it's achievable is the point.
55:39 And you can do it in sub 100k of code or some 100k of deliverable artifacts, which means that when you – if you've got like a – say you've got a Django server that has a form and the form has a validation function at some point.
55:53 That validation function is Python code.
55:56 It can be compiled as a code object.
55:58 That code object has bytecode.
56:00 That bytecode can be turned into a string.
56:02 The string can be sent to the browser.
56:03 The browser can then run that JavaScript – or say run that bytecode in the JavaScript version of the virtual machine.
56:10 And then you've got not just similar or transpiled or whatever, exactly the same code running on the client and the server.
56:17 And you've written it all in Python.
56:19 Yeah, that's great.
56:21 So it takes the load off your server because most of the stuff would happen client-side.
56:26 And it means you write it once.
56:27 Yeah, it's not just the load.
56:28 I mean the load is obviously a benefit.
56:29 But it's also – if you want a rich user interface, you want to say you want to validate credit card numbers as they're being typed in.
56:35 You can't do that server-side because this is something I get acutely aware of because I'm in Australia.
56:39 You can't change the laws of physics.
56:41 Ping time from me to the east coast of the U.S. is 300 milliseconds.
56:45 You cannot change that unless you are willing to accept a 300 millisecond or longer delay in every user interface action.
56:54 It has to be running locally.
56:55 And if you can run it in Python, then all the better.
56:58 Yeah, very cool.
57:00 Those two go together.
57:01 Great.
57:01 That's awesome.
57:02 So that's Python in JavaScript.
57:06 Yes.
57:07 What if I want to run Python bytecode on, say, the JPM?
57:11 Well, I'm glad you asked.
57:13 So, yeah, the next project on the list is VOC, VOC.
57:17 That is a – takes a very similar approach to what Batavia has done.
57:21 But instead of saying let's target JavaScript, let's rewrite a CPython interpreter in JavaScript, it says, okay, CPython, when it runs, is a stack-based virtual machine.
57:32 Java, when it runs, is a stack-based virtual machine.
57:37 Now, okay, to be sure, they are different stack-based virtual machines.
57:40 They have different requirements.
57:41 They have different needs.
57:42 They have different operational characteristics.
57:44 But they're close enough that if you squint, you can turn one into the other.
57:49 And so that's what VOC does.
57:51 VOC says, okay, let's take this Python code, CPython code, and compile it into directly the equivalent Java class files.
58:00 Not turning it into Java code that gets compiled.
58:03 Turning it into the class file directly.
58:05 So the output isn't a PYC file.
58:07 The output is a .class file.
58:09 That then runs as if it was Java because it is Java.
58:14 So, and the sort of interesting little side effects of things like that is that when, you know, you write your Python code and it throws an exception, for example, the exception can point at the line of Python code that generated it.
58:26 Now, this sort of general approach isn't that unusual.
58:28 If you look at something like Scala, Scala is just a compiler that produces Java class files.
58:33 It happens to be a different functional language.
58:35 So all we're doing here is effectively a compiler that takes Python input and spits out Java class files.
58:41 Now, that's critically different to something like Jython, which is a full implementation of a Java virtual machine and Java compiler and all the rest.
58:50 So when you run your Python code through Jython, it is Python code being interpreted in Java at runtime.
58:58 Right.
58:58 Which is also not to be, not to dis Jython.
59:01 Jython is a great project as well, but it's a different approach.
59:04 Right.
59:04 It's almost like instead of using C to implement the virtual machine, they're using Java versus actually compiling, compiling the steps.
59:13 Yeah.
59:14 And ultimately, the reason that I've kind of started VOC is that you say it's written in Java rather than written in C star, except for the parts that aren't.
59:23 Because there are parts of the compiler tool chain, Xerces and what have you, that are written using the Java native interface.
59:33 And so you can't actually, at least not at the moment anyway, you can't compile Jython for Android because there are parts that will not run on Android.
59:43 So I needed a different approach to get things working on Android.
59:45 And so, you know, VOC was born.
59:47 Cool.
59:47 And VOC works on Android.
59:48 And yeah, the intention was originally to target it for Android.
59:51 But by a side effect, because Java is actually a cross-platform runtime environment, I've, you know, I knocked out a demo swing application.
59:58 You can write a native swing application that gets native swing APIs in Python and it will run through Java.
01:00:05 And you can't tell that it's not Java.
01:00:06 That's really cool.
01:00:07 It turns out a Java API, a Java user interface that looks awful because it's not native.
01:00:12 But, you know, it is using Swing's native components.
01:00:14 You could entirely plausibly write a, you can't do it yet, but conceptually, you could take Django, compile it to Java class files, run it in a J2EE container, and satisfy your, you know, your enterprise deployment requirement that everything's written in Java.
01:00:31 Because it is.
01:00:32 It's just written in Python in Java.
01:00:34 Yeah.
01:00:34 They just care how it executes, right?
01:00:36 Interesting.
01:00:37 Yeah, exactly.
01:00:37 So I'm always, you know, I've done a lot of, like, scientific parallel computation type stuff previously.
01:00:44 And I'm always on the lookout for things that let me dodge the GIL.
01:00:48 Does this let you dodge the gill?
01:00:51 Well, effectively, yeah, because, you know, it is on, when it's compiling, it's compiling for the Java virtual machine.
01:00:56 So it is producing thing, you know, the variables are all locked the same way they would be in a piece of Java code.
01:01:02 So it is a gill-less version of Python.
01:01:05 With all the language, well, not all yet, because I'm still working on bits of it.
01:01:08 But, you know, you can do anything you can do in Python, you can do in Vox.
01:01:13 You know, you can, for example, you can do yield statements in Vox.
01:01:16 There is no equivalent of a yield statement in Java.
01:01:19 But I can, you can generate the Java bytecode that does the functionality of yield, because it's essentially just assembly language at that point.
01:01:26 It's just Java assembly language.
01:01:28 Okay, very interesting.
01:01:29 All right, final one on your bridge.
01:01:32 Is Rubicon.
01:01:32 Yeah, so Rubicon was, there was originally a Rubicon Java as well, which I was looking at using for Android, but turned out to not be quite plausible for various reasons.
01:01:41 But it's mostly there for the Objective-C portion.
01:01:43 So I touched on this earlier, that Objective-C, for all of the funny syntax, is ultimately just a series of C APIs.
01:01:51 And C types, which is part of the Python standard library, lets you call any native C function as long as you know it's prototype.
01:01:58 So you can invoke any Objective-C API directly from Python without having to compile anything.
01:02:03 And then Rubicon then sort of wraps that up in a bunch of meta classes and whatnot, using the Python 3 type annotation syntax to say, well, this argument is an integer and this one is a Boolean and it returns an object.
01:02:15 Map that to the underlying call in Objective-C.
01:02:19 You end up with, you know, you can instantiate an NS button the same way that you would in Python normally.
01:02:25 The only difference is that the message passing syntax replace colons with underscores and the method names get really long.
01:02:31 But that's kind of, you know, you don't have to pre-compile, pre-declare, pre-anything about what is in your Objective-C environment.
01:02:39 You've just got to call the things you need.
01:02:41 Wow, that's fantastic.
01:02:42 So you brought up Python 3.
01:02:45 What's the story with Python 3 across Beware in general?
01:02:48 Okay.
01:02:48 So I have taken the wonderfully controversial stance of saying Python 2 is dead.
01:02:53 I am developing a set of tools.
01:02:56 I started developing a set of tools four years ago.
01:02:58 Four years ago, I was developing stuff in Python 2 primarily.
01:03:02 I am now at the point where I'm developing new runtimes.
01:03:06 I'm developing new languages or new runtime environments, new language interpreters, new libraries for cross-platform.
01:03:12 I have made the decision that I am Python 3 and for the most part, I don't care about Python 2.
01:03:17 Now, if someone else wants to come in and care about Python 2, power to them.
01:03:20 I won't turn down the patch.
01:03:22 But I am aggressively targeting Python 3 and hoping that that will be enough of an incentive.
01:03:27 Like by the time that Toga is mature enough that you can seriously do stuff with it, that that will be enough of a reason for people to consider building new code in Python.
01:03:35 And part of that is also that it is also new projects.
01:03:38 And this is a new library.
01:03:39 No one is coming to this with existing code base.
01:03:42 So I can start with the new APIs.
01:03:44 And so I am.
01:03:45 Yeah, that's brilliant.
01:03:46 And on behalf of everyone, thank you for moving us all one step closer.
01:03:50 That's great.
01:03:51 Or how many projects do you have?
01:03:52 15?
01:03:53 Maybe move just 15 steps closer.
01:03:54 I don't know.
01:03:55 But you definitely move just closer.
01:03:56 So thanks.
01:03:56 All right.
01:03:58 So that kind of more or less rounds up beware.
01:04:00 There's a few more things on here.
01:04:01 One of them is Python Apple support, which let me just read the description because I think it really brings home some of the power of what you have here.
01:04:08 A meta package for building a version of Python that can be embedded into macOS, iOS, tvOS, or a watchOS project.
01:04:16 Of course, for Python, written in Python, right?
01:04:19 That's just so cool that all those OSes are involved in this, right?
01:04:23 Yeah.
01:04:24 So I mean this is kind of one of these accidents that happens because Apple is trying to make a consistent development environment for themselves.
01:04:31 We just happen to be able to, you know, horseshoe, crowbar into place.
01:04:35 As Apple tries to put or is pushing Swift, they have historically pushed Objective-C.
01:04:39 Both of those are built on top of Clang.
01:04:41 Clang is a GCC advanced in various ways.
01:04:46 So it is, under the hood, a C compiler.
01:04:48 The good news is that CPython is written in C.
01:04:51 And so with the application of a few patches, you can compile the default CPython sources for any of those platforms.
01:05:02 Now, the catch is that, and this is sort of a process of long negotiation with the CPython team,
01:05:07 is that it's not just a matter of a patch that says, hey, look, you can build for macOS.
01:05:12 MacOS these days only compiles for one platform.
01:05:15 It compiles for x86.
01:05:16 When you compile for iOS, you actually need to compile for, depending upon where exactly you're targeting,
01:05:23 possibly as many as five or six different platforms.
01:05:27 You need ARMv6, ARMv7, ARMv7S, i386, x86-64, ARM64.
01:05:33 And you need to have all of those compiled and turned into what's called a fat binary.
01:05:39 So it's like one library file that has all of those pieces.
01:05:42 And there's a whole bunch of tooling that you need to, like, you need to build all the libraries separately
01:05:46 and then mash them together with this thing, this tool called LiPo, to make them into one library.
01:05:52 Now, that doesn't fit well into the CPython build chain at the moment.
01:05:56 I've submitted a proposal for a patch that would enable you to manage that,
01:06:01 but I don't know if that's likely to ever get merged.
01:06:04 There's a whole bunch of sort of technical and political things that go on there.
01:06:06 So Python Apple support is essentially just an external project that says, okay,
01:06:10 take the CPython source code, download it for you, apply the patch that I know needs to be applied,
01:06:15 build it, build all the dependencies, build OpenSSL, and build libbz2 and all the other pieces that need to be built.
01:06:22 And spit out a Python.framework that works on iOS.
01:06:26 That's great.
01:06:27 And then the interesting thing is then, okay, well, doing that for iOS, well, you can do it for macOS as well,
01:06:32 because that's basically just, you know, you only have to compile it for x86.
01:06:34 tvOS is exactly the same thing, except you've only got to compile it for ARM64.
01:06:39 And watchOS is exactly the same thing, except you've got to compile it for ARM7K.
01:06:43 So it's the same basic infrastructure.
01:06:45 You've just got to change the key that you're calling into.
01:06:47 I see.
01:06:48 Just make it a little more Apple-friendly, bundle that all together.
01:06:50 Yeah.
01:06:50 Yeah.
01:06:51 Yeah, exactly.
01:06:52 Awesome.
01:06:52 And so one of your main goals was to build a Python toolchain that lets you write these UI apps in Android
01:07:00 and the various Apple OSes as well as Windows.
01:07:03 And so you have a bunch of templates as well to help people get started, right?
01:07:07 These are cookie-cutter templates, which I haven't talked a lot about cookie-cutter, but it's a really great project.
01:07:11 And I'm sure we'll have Audrey on the show sometime to talk about it.
01:07:14 Yeah.
01:07:15 Yeah, so tell us really quickly about your templates before we're out of time.
01:07:18 Sure.
01:07:19 So the templates are effectively saying, well, you know, okay, a Python project is, at the end of the day,
01:07:24 a entry.py that contains print hello world.
01:07:27 You know, it can be more than that, but that's all you have to have.
01:07:30 But in order for them to run on iOS, you have to have a whole lot more.
01:07:35 You have to have your Xcode project and your dependencies and your icons and your configurations and all this other stuff.
01:07:39 But most of that information is relatively constrained.
01:07:43 Like we know we need the name of the package, and the name of the package needs to appear here, here, here, here, and here.
01:07:47 So the templates are basically just saying, okay, well, I know what format it needs to come out as.
01:07:52 All I don't know is the name of the package I want to generate.
01:07:55 So let's just leave that as a blank, generate it from template, and then you've got something you can use.
01:08:00 And then Briefcase takes those templates and takes the support libraries and things like that, pre-compiled versions of the support libraries, and spits them out.
01:08:08 You run Briefcase over your project.
01:08:10 If you've got a project that has your hello world.py file, and it has a setup.py that says that's where the file is and these are the dependencies,
01:08:19 it takes all that information, uses that to generate the template so that you can then just say, run this Xcode project, and off goes your iOS project.
01:08:27 Or run this, generate the GTK application or generate the watchOS application.
01:08:31 Yeah.
01:08:32 That's excellent.
01:08:33 Yeah.
01:08:34 So I think your project is great.
01:08:36 I definitely want to encourage people to check it out.
01:08:38 We'll probably have to kind of leave it there for that one.
01:08:41 So one thing I did notice is that you have a couple of upcoming events that you're going to be at.
01:08:46 Were you just in Portland?
01:08:46 I was not in Portland for PyDX, no.
01:08:49 I was in Portland for PyCon this year, and I'll probably be back there next year at this point.
01:08:54 All right.
01:08:54 Yeah.
01:08:54 I was thinking, maybe I just missed you like three days ago in PyDX.
01:08:57 Anyway.
01:08:57 No, no.
01:08:58 Unfortunately not.
01:08:59 Yeah.
01:08:59 Okay.
01:09:00 But so, yeah, maybe tell people about some of the upcoming events that you have that you're going to be at in case they want to meet you or some of the team members or something like that.
01:09:07 Sure.
01:09:07 Absolutely.
01:09:08 So I myself will be – I'm keynoting Python Brazil on the 15th of October this year, and I'll be around for the sprints there as well.
01:09:16 So if you're in Florianopolis, please come and see me.
01:09:19 We're very keen to have new people involved.
01:09:21 About two weeks after that, I'll be in Amsterdam for Django Under the Hood.
01:09:25 So that's the Django deep dive conference that happens once a year in Amsterdam, and I'll be there for the full sprints of that as well.
01:09:33 Probably working on Batavia and some of the more webby parts of the framework at that point.
01:09:38 I'm also speaking at LinuxConf Australia 2016 in January next year down in Hobart.
01:09:45 If you haven't ever been to Australia, I can highly recommend Hobart as a venue to go to and LCA as a conference.
01:09:52 It's a great little community.
01:09:54 It's sort of the Australian equivalent.
01:09:56 It's like the peak open source conference.
01:09:58 Despite the name LinuxConf AU, it is a multi-language – there are people there talking about FreeBSD.
01:10:03 It's kind of an odd name that's kind of stuck around for historical reasons rather than being actually just about Linux.
01:10:08 So they're the ones immediately.
01:10:10 There are a couple of other conferences that I'm speaking at in the future, some of which I can't talk about.
01:10:15 But what's your directories?
01:10:18 I'm coming to a city near you.
01:10:21 Awesome.
01:10:21 Yeah, spreading the good word.
01:10:23 Excellent.
01:10:24 Indeed.
01:10:25 I also noticed that if people need help, they want to set this up and they've got a big team and they really want to get going, that you also offer training.
01:10:32 So people want to get a jump start, they can contact you, right?
01:10:35 Yes.
01:10:35 Then just maybe give a quick shout out to all the people on it if you want to just pull up the list.
01:10:39 Yeah.
01:10:40 So I haven't specifically got – it's not like you can come to me and say, here's my rate card for Python training or Choga training.
01:10:45 It's more an aspirational thing about being able to fund the development of Beware and Python development on a more sustainable basis.
01:10:55 I have been working on this as sort of a part-time volunteer capacity for the last couple of years.
01:11:00 I've had some amazing help from Katie McLaughlin and Philip James and Chris Swenson who have done amazing work as well.
01:11:07 But they definitely have volunteer capacity.
01:11:09 I have recently been – started to be paid on a part-time capacity from a company called Jambon Software to do bits of Beware development.
01:11:18 But I would like to ultimately turn this into a full-time gig for myself and a small team of crack Python developers.
01:11:25 And also to use that as an opportunity to reach out, to get new people involved, to reach out, do diversity, to do diversity and outreach, to bring interns in, pay them for their time and actually introduce them to open source development.
01:11:39 And once you get to give them an internship with a crack team of people at the top of their open source contribution game, let them loose on the world and see what else they can do.
01:11:48 So, yes, training is one axis where I'm definitely – I am notionally available for hire if someone wants to do that.
01:11:56 But I'm also open to all sorts of other options, including if you go to pyb.org, there are some options there for corporate sponsorship if you want to become a member of the project and drop some money in the tin regularly so that we can continue to do what we're doing.
01:12:08 Because ultimately, the reason I'm doing this is because I like Python.
01:12:12 I want to keep using Python.
01:12:13 But I don't think we can continue to sustain large-scale Python development the way that it sort of has been on a wish and a prayer for the last 10, 15 years.
01:12:24 Django development has not been anywhere near as fast or as motivated as it could have been if we only had a little bit more money or if the Django project had a little bit more money.
01:12:35 And given the amount of money that is available in the Django community, the number of people who are making millions of dollars with Django, I think it's telling that we haven't been able to find a way to pay the bills a little bit more effectively.
01:12:45 Yeah.
01:12:46 I just want to sort of second that thought and say there are so many companies that are many, many million dollars of revenue or billions of dollars that take open source and just go, okay, great.
01:12:57 This is free.
01:12:57 This saves us money.
01:12:58 There's not a lot of giving back, right?
01:13:01 Like if they just put a small portion, a very small portion back into these projects, it would make such a difference.
01:13:06 So, yeah.
01:13:07 Yeah.
01:13:07 I mean, it's like I've made the gag on Twitter a couple of times where, you know, I'm offering corporate sponsorships in Beware.
01:13:13 And, you know, $1,000 a month, it sounds like it's a lot of money to you and me as individual developers.
01:13:18 To a company, it's like not even – it's a rounding error on their soda budget.
01:13:23 But that's effectively a Desi Russell.
01:13:26 $1,000 is a Desi Russell.
01:13:28 You can get one-tenth of me for $1,000.
01:13:30 Yeah.
01:13:31 The problem is I need 10 of you to agree to buy a Teddy Desi Russell and then I'm working full time.
01:13:35 Now, there are more than 10 companies in the world who have a very vested interest in Python.
01:13:40 I just need to work out who they are.
01:13:42 Yeah, absolutely.
01:13:44 Before we move on, before we sort of round up the show, there's always two questions I ask at the end.
01:13:49 So, I'll send them to you now.
01:13:51 So, first of all, I think you may be able to pull a few from your own project.
01:13:56 And that's totally legit if you want to do that.
01:13:57 But there's over 80,000 packages in PyPI.
01:14:01 What one do you think maybe people don't know about, you want to recommend, you say, this thing's amazing, you should check it out?
01:14:07 If I may indulge, I actually have two.
01:14:09 Oh, you may.
01:14:09 They are both at the – they're not my project, so I will completely be above board there.
01:14:14 There's no nepotism at all going on here.
01:14:15 They're both in the sort of the developer space and they're tools that I have found incredibly useful, particularly since one of the downsides to Beware being lots of little projects is that you have – the process of releasing Toga is not trivial.
01:14:29 There's a lot of things that need to happen because there are a lot of pieces that need to be released.
01:14:33 And each one of them has a release process, each one of which needs to be tested and all the rest.
01:14:36 So the two tools – one is called – a tool called Check Manifest, Check-Manifest.
01:14:41 It is a really, really boring thing.
01:14:44 All it does is you pip install it into your project, you run Check Manifest, and it checks that your manifest.in file matches what is checked into your version control so that you don't accidentally release a package that doesn't have three files that have to be there for the source code to actually run and compile.
01:15:01 Okay.
01:15:01 Excellent.
01:15:02 It is mind-numbingly simple, but the number of times I have made that mistake, it is paid for itself – it's paid for its free cost on PyPI many, many times over.
01:15:13 Nice.
01:15:13 All right.
01:15:15 So that's number one.
01:15:15 Cool.
01:15:16 That's number one.
01:15:16 The second one is DevPI, which is a version of the Python package index that you can run locally.
01:15:24 So it is a fully – it follows the full PyPI protocol and all that sort of stuff.
01:15:30 And effectively, it just lets you run a local PyPI server that you can talk to.
01:15:34 So you can upload a package to PyPI and see if it works without actually loading it up to PyPI to see what you've broken.
01:15:42 So you can sit there and upload the half a dozen packages that are part of Beware, realize that, oh, crap, I've forgotten the dependency here between this one and this one.
01:15:50 And as a result, repackage Toga version 0.2.1 so that it gets the dependency right or misses the file that you forgot to run check manifest this time.
01:16:02 And test it out in a sandbox environment rather than pushing it to PyPI where once you have uploaded Toga 0.2.1, you can't upload it again.
01:16:11 You have to release Toga 0.2.2.
01:16:13 So, yeah, that one has also saved my bacon on more times than I care to count.
01:16:17 Yeah, that's a great recommendation.
01:16:19 All right.
01:16:20 And favorite editor?
01:16:21 So I am a sublime text person.
01:16:23 I like it, but I don't love it.
01:16:24 And this is one of these areas where one of these days, Toga is going to solve this problem for me.
01:16:29 I have an intellectual love of Emacs, but I can't bring myself to actually use it.
01:16:34 Partially because the Lisp syntax does my head in.
01:16:37 And secondly, because the people who developed Emacs seem to be scientifically opposed to user interfaces that make any damn sense whatsoever.
01:16:46 Every application on the planet has decided that command save saves on a Mac box, but not on Emacs.
01:16:53 Now, OK, yes, before the Emacs people come out of the woodwork.
01:16:56 Yes, I know you can configure it, but it does not come out of the box usable for development.
01:17:01 And that for me is if your tool ships in a form where it is unusable, then you have a problem.
01:17:09 My classic one that I absolutely hate about Emacs is that, yes, you can.
01:17:14 Emacs ships with a tutorial.
01:17:15 That's fantastic.
01:17:16 Let's do the tutorial.
01:17:17 If there's something I need to know, let's do the tutorial.
01:17:18 The first couple of pages of the tutorial teach you about the key combinations for page up and page down.
01:17:24 I have a button on my keyboard to do that.
01:17:26 It says page up and page down right on it, doesn't it?
01:17:28 It says page up and page down.
01:17:29 And they work really well.
01:17:30 So stop trying to teach me how to use my keyboard.
01:17:32 Actually teach me how to do the things in Emacs that are interesting.
01:17:35 And I know there are many things in Emacs that are interesting, but I can't get there because the onboarding process is toxic.
01:17:41 Oh, boy.
01:17:42 You also might have a home and an end button as well.
01:17:45 Yes, yes, exactly.
01:17:46 And one of these days, the end goal for me, I'll be a very happy person when I've been able to build a Toga.
01:17:52 Sublime Text is great because it's cross-platform.
01:17:54 It's bad because there's no source code.
01:17:57 It's not open sourced.
01:17:58 So I want to write an open sourced programmable editor that is the analog of Emacs but programmed in Python but open source and native user interface everywhere.
01:18:08 That also just happens to plug into all the other really useful Bware tools because I just need it to be an editor.
01:18:13 I don't need it to be a debugger.
01:18:14 I don't need it to be a coverage tool.
01:18:16 I need it to edit things really well and talk out to APIs of other tools when it needs to talk to other tools.
01:18:21 I think that's a great vision and probably a great place to leave it.
01:18:25 So it's been really great.
01:18:28 Is there any final call to action?
01:18:29 Are you guys accepting contributors or anything like that?
01:18:32 We are always actively seeking out contributors.
01:18:35 So this is one of the things I'm moderately proud of in the way that Bware is operated.
01:18:39 We've got an open offer to anyone of any level of experience to contribute, to be mentored through the process of contributing to Bware.
01:18:47 And that's not just sort of idle words either.
01:18:49 This is something that has actually been fleshed out in reality.
01:18:52 So at PyCon US this year, we ended up filling, I think at the peak, there was something like six or seven tables full of people who were contributing to Bware.
01:19:01 When anyone contributes to Bware, there's actually a little coin.
01:19:05 There's a challenge coin that we've had struck thanks to originally from MaxCDN for funding but now RevSys have funded the second pressing of these coins.
01:19:14 And essentially, as soon as you get a contribution into Bware, you get one of these coins.
01:19:17 And you can only get it if you contribute to Bware.
01:19:19 But we had people who literally learned to use GitHub two hours earlier who have now got commits in Bware.
01:19:26 That's great.
01:19:26 We have been able to mentor people with very, very little programming experience to be contributors of non-trivial features in Bware.
01:19:33 So if you go to the Bware website, there is a link in there for how to get involved with contributing.
01:19:38 One of the big things it shakes off is, yes, okay, this whole imposter syndrome thing, it's real.
01:19:43 And by the way, the members of the core team have imposter syndrome as well.
01:19:47 So, yeah, don't worry about the imposter syndrome.
01:19:49 We will walk you through this.
01:19:50 We want to help you become the best developer you can.
01:19:53 And we'll mentor you through that whole process.
01:19:55 So get in touch.
01:19:57 And we'll be more than happy to help you get involved.
01:20:00 All right.
01:20:01 That's great.
01:20:01 Russell, thanks so much for being on the show.
01:20:03 It's been fun to talk about your project.
01:20:04 Yeah, it's been an absolute pleasure.
01:20:05 Thank you very much for your time.
01:20:06 You bet.
01:20:07 Talk to you later.
01:20:09 This has been another episode of Talk Python to Me.
01:20:11 Today's guest has been Russell Keith McGee.
01:20:15 And this episode has been sponsored by Rollbar and Hired.
01:20:18 Thank you both for supporting the show.
01:20:20 Rollbar takes the pain out of errors.
01:20:22 They give you the context and insight you need to quickly locate and fix errors that might have gone unnoticed until your users complain, of course.
01:20:30 As Talk Python to Me listeners, track a ridiculous number of errors for free at rollbar.com slash Talk Python to Me.
01:20:38 Hired wants to help you find your next big thing.
01:20:40 Visit Hired.com slash Talk Python to Me to get five or more offers with salary and equity presented right up front and a special listener signing bonus of $2,000.
01:20:48 Are you or a colleague trying to learn Python?
01:20:51 Have you tried books and videos that just left you bored by covering topics point by point?
01:20:56 Well, check out my online course, Python Jumpstart, by building 10 apps at talkpython.fm/course to experience a more engaging way to learn Python.
01:21:05 And if you're looking for something a little more advanced, try my WritePythonic code course at talkpython.fm/Pythonic.
01:21:12 Be sure to subscribe to the show.
01:21:14 Open your favorite podcatcher and search for Python.
01:21:17 We should be right at the top.
01:21:18 You can also find the iTunes feed at /itunes, Google Play feed at /play, and direct RSS feed at /rss on talkpython.fm.
01:21:27 Our theme music is Developers, Developers, Developers by Corey Smith, who goes by Smix.
01:21:32 Corey just recently started selling his tracks on iTunes, so I recommend you check it out at talkpython.fm/music.
01:21:39 You can browse his tracks he has for sale on iTunes and listen to the full-length version of the theme song.
01:21:44 This is your host, Michael Kennedy.
01:21:46 Thanks so much for listening.
01:21:48 I really appreciate it.
01:21:49 Smix, let's get out of here.
01:21:51 Outro Music.