Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book


Transcript #97: Java goes paid

Return to episode page view on github
Recorded on Wednesday, Sep 26, 2018.

00:00 Hello and welcome to Python bites where we deliver Python news and headlines directly to your earbuds. This is episode 97 recorded September 26 2018. I'm Michael Kennedy. I'm Brian. Okay. Hey Brian. How you doing today? Hey, I'm doing great Awesome. Awesome me too. Lots of big news so much news that I can't even keep up with it Yeah, it's good thing that there's like this weekly podcast that keeps us up on Python news I know where's the one that we get a listen to?

00:27 Yeah, that's what we need. We need a meta podcast. Okay. No, that's okay. Other people don't don't do that. Yeah, that's right It's also want to say thank you to data dog for sponsoring this episode Really happy to have them on board check them out at Python by set of them slash data dog Cool t-shirt lives at that URL more to more to say about that later Pipe I just keeps getting better and better doesn't it? Yeah, I PI keeps getting better and the tools around it and a recent recent release just a couple days ago of Twine.

00:57 So Twine has been updated.

00:59 And for people that don't know, Twine is the thing that pushes your code from your laptop or your computer or your server or wherever to PyPI.

01:11 And Twine has a check function now.

01:14 Actually, there's quite a few things in the new Twine upgrade.

01:18 But this one's neat because once you've packaged your distribution up and everything in your wheels and whatever, it usually shows up in a dist folder.

01:28 And then you say twine check dist and then everything in it.

01:32 And it checks to make sure that one of the things it does, I think it does a lot of things, but at the very least, one of the things it does is make sure your README is rendering properly, supposedly.

01:42 - Yeah, that's really cool that it even checks that, right?

01:45 'Cause that's hard to test, right?

01:47 How do you know if your README is not rendering properly?

01:50 >> Yeah, we're linking to an article that's from on the PyPA that is how to make a PyPI-friendly readme.

02:00 So there's actually, it's not really difficult, but it's one of those things that, it's one of the last things you do before you, well, it shouldn't be the last thing, but when you're getting a package together, you're like, "Hey, I have this really cool idea.

02:12 "I want to push it up on PyPI." You got to make sure the readme works.

02:17 And this is one of those steps, and there's just a little short article on how to do that right.

02:22 Although like magic, it's not difficult, but the stuff you have to put in your setup.py and everything.

02:28 - Yeah, that's a good find.

02:29 Anyone who is either maintaining or thinking of creating a PyPI package should definitely check it out.

02:34 - Yeah, and I think in your build toolchain or your talks toolchain to add a check step to make sure, go ahead and check before pushing it up is, that would be a good thing to do.

02:44 - That can be like a pre-commit hook or something.

02:46 - Wow. - I don't know.

02:48 - Yeah, definitely is a part of your continuous integration, anyway.

02:50 - Yeah, definitely part of your CI.

02:52 - The first item I have is pretty interesting.

02:55 And when you think of the languages and technologies that you can use, most of the time we think of programming languages and their subsequent runtimes basically being free, right?

03:08 I mean, obviously Python, like you don't think, well, what does CPython cost?

03:12 But even from places where you might not necessarily expect it, right?

03:16 like C++, it's free.

03:19 Go is free.

03:20 Microsoft.net is free.

03:22 Right, all these things.

03:23 You know what's not free these days?

03:25 Java.

03:26 - Really?

03:27 - So apparently, Sun has made the Java runtime for, you're gonna have to just check out the article on the register to make sure I get this exactly right.

03:38 But roughly, Java is making the runtime a subscription and the subscription costs $25 per processor per month for commercial entities.

03:50 - Wow.

03:51 - Is that crazy?

03:52 - Yeah.

03:52 - There's definitely some cases, like as students and whatnot, where you can just use Java for free, but a lot of commercial organizations that depend upon Java need to read this article and the subsequently linked 330 page document that describes this process over at Oracle.

04:10 So that's pretty interesting, right?

04:12 - Yeah, it's the run times even, So you have to, like if somebody else makes a Java application, it's not the person making it, it's the person running it?

04:20 Yeah.

04:20 So it says, Oracle's put a price on the Java SE and its subsequent support.

04:26 So $25 per processor per month plus a $2.50 per user per month on the desktop, unless you buy a whole bunch.

04:34 Yeah, so it looks like maybe $250.

04:37 Wow.

04:37 Yeah, it's kind of all convoluted, but it's quite interesting.

04:42 They say the older runtimes, you can still use them for free, but like, who wants to use a runtime that has no bug fixes, no security patches, or things like that, right?

04:53 - Yeah, I guess maybe they're trying to make everybody move to Python?

04:58 - Yeah, that was my first thought.

05:00 It's like, yeah, Java's been pretty high in the language rankings, maybe it's gonna plummet now.

05:04 I mean, seriously, this is pretty crazy.

05:07 So yeah, it says also there's a little bit of a stick to go with the carrot.

05:11 Yeah, come January 2019, Java SE8 on the desktop won't be updated anymore unless you buy a subscription.

05:19 And yeah, the short version is every commercial enterprise needs to look at their Java standard edition usage to see if they have something to do with licensing now.

05:28 So this was sent in by one of our listeners, and I'm super sorry I didn't write down the name in the show notes, but thank you for sending it in.

05:34 This is interesting.

05:36 I know it's not directly a Python thing, but it's just, you know, here's the thing.

05:39 I kind of always sort of thought of Java is more or less open source.

05:42 And I guess it's just, you know, that Oracle oversaw, but I guess that's not the case.

05:47 >> Yeah, weird.

05:48 Okay. >> Yeah.

05:49 Anyway, there's that.

05:51 >> Yeah, well, this next topic is really, really important.

05:54 >> For importing.

05:56 >> Importing, yes.

05:57 >> It's very, very important.

05:58 (laughing)

06:00 Tell us about it.

06:01 >> Important, yeah.

06:02 Absolute versus relative imports in Python.

06:05 This is an article on the real Python.

06:07 I think it's on real Python, realpython.com.

06:10 There's a lot of great articles there.

06:12 - Yeah, I like what they're doing.

06:14 Me too.

06:15 - The relative, and I lost my tab, but most of your imports are gonna be, the first part of the article is talking about normal kinds of imports, like just you import a package, like the import statement, or you do from package import something, or from package dot some sub-package.

06:34 There's a lot of versions of that, so it's covering that.

06:37 But for instance, there's relative imports, which includes dots.

06:43 So like from dot import something or import dot something.

06:50 I never remember how all that works.

06:53 So I'm glad that somebody wrote it up.

06:55 I know it could probably find this other places, but this is a nice write-up of what all this means.

07:00 So in general, people say, the recommendation is don't do this, don't do relative imports.

07:06 But sometimes you have to, and there's a lot of good times.

07:09 So for instance, if you were a package maintainer or you're developing a package, the modules within the package should be able to use functions from other modules, that's why you have them.

07:20 But how do you import that?

07:21 You don't just, and one of the ways is you, you know, from .neighbor module, import something.

07:28 And that's what the single dot is, is import a module from the same package you're already at, relatively.

07:34 >>Yeah, that's cool.

07:35 The other thing that bugs me about when you have a package and sub-packages that all interact and you use the full or external import style, if you want to rename that package, you're like, "Oh, I kind of like would rather call it this." All of a sudden, there's like lots of pain and suffering that happens.

07:51 Yeah. Well, even within it, if you import it from the top, yeah, you have to go through and change it. I don't know.

07:58 Yeah, exactly. It's not something I see very much, but I think it's a great article to have it all written up.

08:03 Yeah, well I use the dot dot, I guess it's a parent package thing, I don't really use that.

08:08 But the single dot I use all the time to just say, import something from the same package I'm in.

08:14 That way, like you said, if you decide on a different name for your package, you don't need to change that.

08:21 Yeah, absolutely. Very nice.

08:22 So this is a good write-up.

08:23 Yeah. So before we get to the next one, which is kind of retro and fun, let me tell you quickly about Datadog.

08:28 If you're not familiar with them, you should check them out.

08:30 They're especially good for distributed systems, microservices, things like that.

08:34 So they're a monitoring platform that brings together metrics, logs, request traces, all in one place.

08:39 Datadog has a trace as search and analytics feature that lets you break down your Python app performance by user, by URL, all sorts of cool stuff like that.

08:52 So you can quickly, easily troubleshoot and optimize your Python app.

08:56 Python app. So try that out today for with a free trial and DataDog will send you a free cool dog t-shirt. It's very nice.

09:04 Check them out at pythonbytes.fm/datadog to get started.

09:07 The user ID thing, searching on users is kind of cool. You could maybe line that up if like a particular user had a complaint or something you could maybe use that. Exactly. I get this all the time like, "Oh, this thing is not working super well on your platform." I'm like, seems to be working pretty well, I just don't understand.

09:26 But if I could actually dig into it by user ID, that'd be awesome.

09:29 - Yeah, that's cool.

09:30 - Yeah.

09:31 So I promised you something retro, right?

09:33 - Yeah, I love retro.

09:34 - Quite retro.

09:35 - Being that I'm retro.

09:37 - So you should check out, if you feel like making a game, a lot of people get into programming 'cause they were interested in making games and that's why they got into programming.

09:45 That was not me, actually.

09:46 Like, I enjoyed playing games when I was younger.

09:49 Sometimes still do, but I wasn't like, I have to go into computers so I can make a game.

09:53 I know a lot of people did.

09:55 But the reality of make a game now is get 100 of your highly skilled developers and artists friends together and work for a year, which doesn't make a lot of sense, right?

10:04 Yeah.

10:04 So you might make a cool 2D scroller retro thing.

10:07 And this thing called Pyxel, P-Y-X-E-L, like pixel, Python pixel sort of thing, is a retro game engine for Python.

10:15 How fun.

10:16 So the idea is you only get 16 colors.

10:18 you get four sounds that can be played at the same time.

10:22 It's a Python 3 game platform.

10:25 It runs on all the major platforms, Windows, macOS, and Linux.

10:30 It even comes with a bunch of cool examples.

10:31 So if you pip install it, then you can just run install PyXL examples and then you can go and explore them.

10:37 But what do you think?

10:38 Looking at some of the screenshots there.

10:40 - It looks kind of fun.

10:41 I gotta try to check this out.

10:43 - Yeah, you don't have to be like massively skilled to create the graphics is you only get like a few colors, you only get like a certain size.

10:50 It's not, you know, you don't have to be crazy artistic game studio type place to make this.

10:56 Yeah, these are the types of video games that I grew up on.

10:58 So yeah, yeah, I think people might enjoy this.

11:01 And like I said, I think it makes it pretty accessible.

11:04 It's an interesting way to bring UI capabilities to Python for people who might want to like if you are doing some sort of programming class, or you're doing a school club or an hour of code type of thing.

11:19 An hour of code is probably too short.

11:21 But those types of projects where you want to let-- especially kids who are impatient and don't care that much for terminal apps and are not ready for web apps, they could build a fun little thing if you gave them this as a foundation.

11:31 Yeah.

11:32 Neat.

11:33 So cool.

11:33 Yeah, if people are into retro games, check this out.

11:36 You can create your own with Python.

11:37 What if I don't want to create a game?

11:39 I just want to create a command line interface?

11:42 You mean like most apps?

11:43 Yeah.

11:43 You can even make your game have command line interfaces.

11:48 Yeah, so there's a couple of options, right?

11:50 You could use sys.argv.

11:52 That'd be pretty awesome.

11:53 That's pretty extensible.

11:55 You could also use higher level things like argpars or click.

11:59 Click, yeah.

12:00 Yeah, what's up with click?

12:01 I know there's a lot of great options, and sometimes you just reach for what you know.

12:05 And since I've written a few command line interfaces from the sys.args and not enjoyed it, I have enjoyed working with Click, and so Click's been around for a while, but the news, really I wanted to highlight it because it's cool that the Click version 7 was released recently, and there's a huge list in their changelog of all the stuff they fixed.

12:29 And normally, I mean, normally we don't just cover a version update of something just for the heck of it, because things update all the time, except for Click doesn't update all the time.

12:39 version of Click was released January of 2017. So that's neat that we have a new one. So there's all sorts of fun stuff in here. I don't know what I'm really excited about. There's Zshell auto-completion support that was added. That's kind of neat. That is quite cool. I use OhMyZSH, which I love, and this is really exciting for me because it's based on Zshell. One of the other things is click interfaces have they include a help option you can do --help and it tells you what the options are for your command line interface and how to call it you have to build that sort of stuff in but it's pretty easy to write up but one of the things they've added is that if you do it wrong it doesn't tell you it just says this is wrong or something it doesn't tell you it doesn't point to the help but now it does so in this version any usage errors will now I'll hint it using the help option, which is cool.

13:32 - Yeah, yeah, I like it.

13:33 - And actually there's pages and pages and pages of updates.

13:36 There's a lot of stuff that changed, so good job folks.

13:39 And I didn't realize it was part of the Pallets project, which is also Flask, the people that work on Flask.

13:46 - Yeah, yeah, it's part of Pallets.

13:47 And you talked about how it hasn't been updated in a while and this is a major release.

13:51 Like Flask just went 1.0, and we talked about that a little while ago as well.

13:54 That's pretty awesome.

13:55 - Yeah, and I know that the Pallets people, They take donations for if you want to, if you're utilizing this and want to help out, they would love to have your money.

14:04 They would, they would. They have a special arrangement with the PSF, so it's sort of a nonprofit thing as well somehow, I think.

14:11 Yeah, and nice people too.

14:13 Yep, absolutely. So this is cool. I'm glad you highlighted it. I want to understand the ZSH autocomplete a little bit more. That's sweet.

14:19 So, Brian, do you use the cloud much?

14:21 I think so. Well, we live in Oregon, so we get lots of clouds.

14:24 - Oh yeah, we definitely use the cloud at least half the year.

14:27 - Yeah.

14:28 - Yeah, so...

14:29 - That was a really bad joke.

14:30 They don't get much better than that.

14:31 - It's a pretty good one.

14:32 Yeah, I like it.

14:33 - So, one of the challenges of, especially like platform as a service and things that are not infrastructure, but other stuff, database as a service and other higher order things, is that you often pay as you use them, right?

14:51 Like if I use a virtual machine, I turn on the virtual machine, I know what it costs, right?

14:56 Like I go to DigitalOcean, fire that thing up, I know like the server that runs Python bytes plus the database server, they cost $15 a month together, right?

15:05 I know it's $15 pretty much other than bandwidth, which is mostly covered.

15:09 If you use something like say Firebase or AWS Lambda or other things, like you pay as you use it.

15:16 And generally that's to your advantage.

15:18 - Right, but the you isn't really you, the you is your users are using it.

15:22 - Right, and you don't necessarily know how much your users are gonna use it.

15:26 I mean, it's a good problem to have.

15:27 Like, I have lots of users, they're using my app a lot, so I'm using my cloud service a lot.

15:31 But it's super, super scaling.

15:34 And it turns out that if you program badly, you may have a higher bill than you otherwise expected.

15:42 So here's an example, which I think is just maybe a cautionary tale for everyone using clouds.

15:48 And it doesn't really too much depend on like what cloud you're using.

15:52 Anything that where the price depends upon user consumption.

15:56 I have a real world example for myself.

15:58 I'll tell you about it at the end.

15:59 But the article I wanna cover here is, the title is, "How We Spent $30,000 in Firebase in Less Than Three Days." - Wow.

16:08 - And Firebase is like a database as a service exposed over like a HTTP endpoint for JavaScript type of thing.

16:15 Like that's pretty much my understanding of it.

16:18 I don't really use it, but it's like if I'm doing, say, an AngularJS or some kind of front-end JavaScript app, I can just connect to Firebase straight from my client-side code, and then we're good.

16:29 It can do the various things that it needs to do, right?

16:32 So there's this place called Vaki, something like that, in Columbia, and it's kind of like Kickstarter, but Colombian, and they had just launched, and it turned out that they had this project on there that became the largest crowdfunding campaign in Columbia by collecting three times as much money as anyone ever had in the first two days.

16:53 So they collected tons and tons of money.

16:56 They had like two million sessions, like 20 million page views, 15,000 backings or whatever you call that.

17:02 Sounds good, right?

17:03 - Yeah.

17:04 - Well, it turns out the site was running really slow and the folks who built it, they were somewhat new developers.

17:09 They were like, I don't know what to do to make this work.

17:11 I know what, let's just upgrade all the frameworks.

17:13 We're using Angular 4, let's upgrade to Angular 6 or something to this effect.

17:16 It wasn't Angular, maybe it was React.

17:17 I don't know, whatever framework they have, they're just like, we're gonna upgrade these things.

17:20 Nope, that didn't fix it, right?

17:22 So they spent like a day like poking around and it was still running slow and it kept slowing down more and more and they couldn't figure out what's going on and they logged into their Firebase account and they saw their bill was like $30,000.

17:33 It was costing $600 an hour more every hour.

17:36 - Oh wow, yikes.

17:37 - And they're like, what is going on?

17:38 So it was like, you know, like Firebase, you pay on like the number of calls and that thing.

17:42 So it turned out that they have this little part of the site, just like in Kickstarter, in the right, It says there's this many contributions and currently this much money has been pledged towards this account.

17:52 And I think what happened was their implementation of showing that number, it didn't sum it in the database.

17:58 It sucked down all the payments table and then added it in JavaScript.

18:05 And it kept doing that to keep it live or something.

18:07 - Yeah, every time somebody goes and looks, yeah.

18:10 - Yeah, exactly.

18:10 They made like 40 billion requests, billion with a B, to their database.

18:15 - And that got them like a $30,000 bill.

18:18 (laughing)

18:20 So it's pretty interesting, worth checking out, this article, the comments are super interesting.

18:25 Some of them are super supportive and others are kind of mean.

18:29 You probably wouldn't imagine this, but there's a theme of testing, they should have tested better before they rolled out the site.

18:34 - Well, yeah, but you can't test everything and foresee.

18:37 - Yeah, you can't foresee everything, that's true.

18:40 And I'm sure it seemed fine when you tested it with like the 10 purchases they had in their little test project, but you put 15,000, all of a sudden, it starts to behave badly.

18:49 - Yeah, and I heard about somebody doing some things, similar, not a success story, really, just somebody saying that they would run kind of some abuse testing against a local database, or local mock service, and then set it all up, and they were gonna just see how it did for abuse testing over the weekend, got back and realized that they were not testing abuse testing in the lab, they were abuse testing a live service, and yeah, similar issue.

19:18 A big huge AWS bill because of the test running all the time, so.

19:23 - AutoSkill's amazing, it just takes care of all the traffic you have.

19:26 (laughing)

19:27 - Yeah.

19:28 - Wait, what?

19:30 How much does this cost?

19:31 So I was thinking about this article a few weeks ago and thinking we might cover it on this episode, and I thought, ah, good thing this doesn't happen to me.

19:38 Never do this.

19:40 Today, today, today.

19:43 Remember, I don't know if I told the audiences, but I know I told you this when we were hanging out at PyCon last year.

19:49 For my courses, I set up a whole bunch of different video servers throughout the world.

19:53 So I've got one in Mumbai, one in Tokyo, one in Sydney, one in Frankfurt, and so on.

19:57 And I got tired of synchronizing the files, so I wrote this system that would automatically sync them across the world to these different locations.

20:06 Well, it turned out there's a small, finer place that has to be done to adjust the location from the source to the destination servers.

20:13 And I logged into that thing today and it was still synchronizing just continuously.

20:17 I'm like, oh no, this server has been continuously downloading and uploading to S3 as fast as it can for two weeks.

20:26 - Oh no!

20:26 - I'm like, what is my AWS bill?

20:29 And I logged in and it wasn't so bad.

20:31 It was like $300 more than normal, which is okay, but I'm just like, yeah, that pretty much is exactly just a less bad version of what happened to these guys.

20:41 And it was 'cause of bad, it was a bad file replacement.

20:43 Basically, sync, the word sync was being replaced in some circumstances, and I have a new course called Async, and it was taking out the sync part, and so it just, it kept going, oh, the file's not there, we gotta upload it, file's not there, we gotta upload it, you know, 'cause they just, they mismatched.

20:58 Yeah, that was bad news.

21:00 - Oh, yeah.

21:01 - Anyway, so it can happen to anyone.

21:04 It happened to me this morning.

21:06 I fixed it, by the way.

21:08 - Well, yeah, if you're paying for any of those services, check once in a while to make sure that--

21:12 - Yeah, and you know what, I actually, I have, that's kind of one of the takeaways, both from the article and from why I wanted to say that, is I have an alarm set at AWS, and it says if my bill goes over this amount, send me an email.

21:23 If my bill goes over this amount, send me an email.

21:25 And I woke up and I saw that alarm as well, and I'm like, oh, that's not good.

21:30 - Yeah.

21:31 - So anyway, it's all fine.

21:32 But check it out, it's definitely worth thinking about if you do anything that is in the cloud that is based on consumption by users.

21:39 Yeah, definitely.

21:40 All right, well that's our main items.

21:42 I have a really exciting one I wanted to get in, but actually I just learned about it 15 minutes before we started recording, so I didn't have time to dig into it.

21:51 So news is Dropbox, Dropbox is one of the biggest users of Python as we know, and they have been stuck on Python 2 for what seems like eternity, which is so ironic because Guido van Rossum works there, and some of the other core developers that work there is like, "Yeah, Python 2 all day, you know, got to love it, right?" So the big news is, as of yesterday, Dropbox has now upgraded to Python 3, and they have a nice article right up on it.

22:15 We'll cover it in more depth next week, but I'm gonna link to it now since it's timely and important.

22:19 - That's so cool, though.

22:20 Yeah, very neat.

22:21 - Yeah, yeah.

22:22 What about conferences?

22:23 - Well, we just got an announcement, I think I just saw this today, that the call for proposals for the 2019 PyCon is now open.

22:30 - Oh, really?

22:31 - Yeah.

22:32 - That's pretty awesome.

22:33 - So you can get started on your proposals for next year.

22:37 - Yeah, I'm thinking about those for sure.

22:38 I definitely have some stuff I wanna propose, so thanks.

22:42 See, I learn about stuff right here on the show.

22:43 All I gotta do is just sit here.

22:44 - Yeah, and the Pi Cascades is still open too.

22:47 - Yeah, 'til October.

22:48 - Yeah, so it's proposal time, I guess.

22:51 - It's definitely proposal time.

22:52 Also, Pi Tennessee, I can't go, but I know that they have their call for proposals open as well.

22:57 So there's lots of conferences.

22:59 Conferences are a spring/summer type thing a lot of times, and so the call for proposals are sort of now.

23:04 - Yeah, I mean, why not spend your holiday season coming up with things to.

23:09 - Yeah, that's what I'm doing on Thanksgiving for sure.

23:12 Maybe Halloween as well, my kids will love it.

23:14 You know what's scary?

23:15 This talk's gonna be scary.

23:16 No, dad, I wanna get candy.

23:18 This is even better than candy.

23:19 - No, if you wait 'til Halloween, you'll miss the Pike Escapes.

23:22 You gotta do that before.

23:23 - That's true, yeah, that's true.

23:24 I can't do that, all right.

23:25 - Anyway.

23:26 - No, I won't wait.

23:27 - You've got one more, Wors?

23:28 - I got one more.

23:29 So I just released, like literally an hour 15 minutes ago or so, released a new course called Async Techniques and Examples in Python. And this one is something I'm super excited about. I've been wanting this course to exist ever since I started in Python and I've decided that I'm going to put in the time to create it. And so I just launched a five-hour course on all the async things in Python. Oh, that's very exciting because I want to learn all the async things in Python. So I have a resource to recommend. Yeah, so I put the link in the show notes. People can check Check it out at training.talkpython.fm.

24:03 Should be in the course list.

24:04 Nice.

24:05 Cool.

24:06 Yep, definitely.

24:07 All right, Brian, thanks for being here and sharing this with everyone.

24:09 Yeah, thank you.

24:10 You bet.

24:11 Bye.

24:12 Bye.

24:13 Thank you for listening to Python Bytes.

24:14 Follow the show on Twitter via @pythonbytes.

24:16 That's Python Bytes as in B-Y-T-E-S.

24:19 And get the full show notes at pythonbytes.fm.

24:23 If you have a news item you want featured, just visit pythonbytes.fm and send it our way.

24:27 We're always on the lookout for sharing something cool.

24:30 On behalf of myself and Brian Okken, this is Michael Kennedy.

24:33 Thank you for listening and sharing this podcast with your friends and colleagues.

Back to show page