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


Transcript #244: vendorizing your Python podcast

Return to episode page view on github
Recorded on Friday, Jul 30, 2021.

00:00 - Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.

00:04 This is episode 244, recorded July 30th, 2021.

00:09 I'm Michael Kennedy.

00:10 - And I'm Brian Okken.

00:11 - And I'm Brandon Brainer.

00:12 - Hey, Brandon, welcome to the podcast.

00:14 Thanks for being here.

00:15 - Yeah, thank you for having me.

00:16 - It's really good to have you here.

00:18 You're one of the first volunteers, I'll put it as, when I said, "Hey, we're looking for some folks "to come be with Brian and me on the show," and throw your name in the hat, and here you are.

00:29 - Happy to have you. - Yeah.

00:30 It's very exciting.

00:31 Very, very exciting.

00:32 - Yeah, absolutely.

00:33 So before we jump into the topics, just tell us a quick bit about yourself.

00:37 - Yeah, so I've been in software development for 10 years.

00:42 Half of it in management, and half of it as an individual contributor.

00:45 About seven years of it with Python.

00:47 You know, it's funny, when I first started programming, I lived at a Raspberry Pi.

00:50 I thought Python is so confusing with not having brackets and all these spaces, and I don't understand it.

00:55 And now I can't go back.

00:56 It's so much easier.

00:57 >> Yeah, I had a similar experience coming from C# and C++ and stuff, with all the symbols.

01:04 And I thought, in my mind, I thought those are necessary for programming.

01:08 Like you have to have the semicolons, you have to have the curly braces and the extra parentheses.

01:12 Because how else would the parser and everything, like that's how you express stuff in programming.

01:16 And then when I got into Python, I felt a little bit weird with it missing.

01:20 But then when I went back, I felt even weirder, like why are all these symbols here?

01:23 >> Yeah. >> I just learned that they're not necessary.

01:25 Why have I been doing this the last ten years of my life?

01:27 What is wrong with me?

01:28 Exactly.

01:29 It was a real interesting experience.

01:31 Yeah.

01:31 Speaking of interesting, Brian, all the stuff on pip quite interesting.

01:35 Yeah.

01:37 so I, I, I don't know, we were doing this on Friday because, because I was, well, I wasn't here on Wednesday.

01:43 I was, in Florida.

01:44 and so you're a jet setter, basically you just, yeah, no, I've traveled in like two years, for business.

01:52 Was it weird?

01:53 Yeah.

01:53 Was it weird?

01:53 no, it was like wearing a mask all the way there.

01:57 I got used to no masks here in Oregon, but then now I guess they're changing all that again, we're bringing them back, but what's old is new again.

02:04 But one of the things I tried to do is I tried to work on the plane.

02:08 In Python, of course, the problem with snakes on a plane is there's no Internet.

02:15 I had this issue, and I've already put it up on the screen, the solution.

02:22 My issue was I had a project I wanted to work on.

02:27 It's got talks set up.

02:29 When you run talks, talks creates virtual environments and then fills those up with all your dependencies and your code using PIP.

02:38 pip goes out to PyPI to get that stuff.

02:40 I mean, you can cache it and that does help and you do that locally on your machine but it still looks out at the Internet, and this won't work on a plane.

02:49 I reached out to the Twitterverse, and I thought I found a solution, but I'm not even going to say the wrong solution.

02:58 Paul Gansel pointed me in the direction of environmental variables in PIP.

03:03 You can just set find links to a local directory, and then set with pip find links, and then pip noindex, so that the pip doesn't even look out there, it looks at a local directory.

03:15 So what I did is I'm gonna, and I'm gonna, guess we'll look at, I was surprised--

03:19 - Hey, wait, wait, go back.

03:20 I got a quick question before we go on.

03:22 - Okay.

03:23 - So it'll look in that local directory for the packages, the wheels and whatnot.

03:27 - Yeah.

03:28 - How do you get them there in the first place?

03:29 - Okay, so I got some pre-work that I did.

03:31 So I'm like, okay, how do I get those?

03:33 And normally when I wanna put something in a local directory or something, I'll just use, what is it, pip download?

03:40 You can do that, but that's a lot of work to try to figure out what you did.

03:44 So what I did is I just, before I got on the plane, I'm using the airport internet.

03:50 I, which everybody can harass me later about how that's not secure, it's fine.

03:55 But I ran talks, you do it at home then if you want, run talks with an internet connection.

04:01 And what it's gonna do is you're gonna have a whole bunch of your environments within talks.

04:05 You're gonna have all your, all Python 7, Python 8, whatever you got in there, or not 8, 3.8, 3.7, 3.10, whatever.

04:13 - You're living in the future.

04:13 >> Just go through all of them.

04:15 Just do a search and grab all of the, what do we got, the site packages directories.

04:20 Grab everything out of all of those and copy them to a local wheels directory or something.

04:26 Something outside of your work environment.

04:29 I just stuck it at the top level, you like users or something, I stuck it up there.

04:33 Then that's everything because you know you ran it.

04:37 Then go ahead and set up these environmental variables.

04:40 I actually just stuck the environmental variables in my, just in a little script to set them while I'm developing.

04:49 - Yeah, you know what I learned that was pretty interesting that the activate script for a virtual environment, you can put environment variables in there.

04:57 So you could have like a offline virtual environment and an online virtual environment and those could toggle different environment and just which one you activate will just make this happen.

05:05 That'd be awesome.

05:06 - Yeah, so this, and that's one of those, it's all virtual environments all the way down.

05:12 These environmental variables have to be set in the environment that you're running it in.

05:18 They can be set in the virtual environment that you were using to run talks even though talks will generate others.

05:24 It works right.

05:26 I don't know how it works, but it works.

05:27 Anyway, this super helped me out.

05:30 Yeah, so then grab all those, throw them in there, and then use the find links and noindex and it'll just work great.

05:37 The reason why I think I didn't find it at first is the note within the pip documentation just says, everything that's a flag within pip is also an environmental variable.

05:51 If you search for it, you probably won't find it.

05:54 It just has this comment that says, all command line options can be set as environmental variables using all uppercase and then underscores instead of dashes.

06:05 >> That's a cool tip. Yeah.

06:07 Yeah. Brandon, what do you think?

06:09 >> Yeah. At first, I was confused a little bit about why you wouldn't just pip install before you got on the plane, but I've never actually used TOX to do any testing.

06:17 It sounds like that installs in a different directory.

06:19 When you do your TOX runs that it needs to reinstall them.

06:23 >> Yeah, it creates a new virtual environment.

06:25 You can run it ahead of time and you can tell it to not install those, but I was messing with my environments, so I really wanted to make sure I could clean them out.

06:36 There's probably other cool solutions, but that's what I used.

06:40 >> That's interesting though.

06:41 >> It creates all the virtual environments.

06:43 Each different like 3.7, 3.8, 3.9, 3.10, they'll all be different virtual environments that it runs your tests in.

06:49 >> It's always one of those things that we depend so much on the Internet that you do our job that when you don't have it, what do I do? That's interesting.

06:56 >> Yeah. That's like 20 hours of work I would have lost.

07:00 Anyway.

07:03 >> Yeah. This is very cool.

07:04 Nice tip, especially in the environment variables just for PIP, like you can change the verbosity or the mirrors or all sorts of stuff, right?

07:12 - Yeah.

07:13 - All right, so this time I have an extra, extra, how many extras, let's see, I have eight extras.

07:18 Extra, extra, six times extra here all about it.

07:21 I'll be kind of quick, but they're all kind of interesting.

07:23 I just want to give a quick shout out to V Brown Bag.

07:27 I did a talk over there on Pydantic, so a 45 minute presentation on Pydantic and how you can do all sorts of cool stuff with that.

07:34 We've already talked about why Pydantic is excellent.

07:36 So very, very neat, check that out.

07:39 And also wanna give a shout out to an episode that I did, I think is on Talk Python, that I think is gonna be really useful for people.

07:45 It's about building little automation tools, like instead of trying to build big apps, like maybe a little app with rumps that runs up in your menu or a little app that you can do a bunch of stuff and it'll generate like a query for some other platform that's not like SQL, but you know, sort of think SQL like type of things and so on.

08:03 So I had a bunch of cool guests, I had Rusty Gregory, Kim VanWijk, KJ Miller, and actually Rivers Cuomo from Weezer on the show.

08:09 He's doing amazing stuff.

08:10 So people should check that out if that sounds interesting and inspiring.

08:14 - That sounds so cool.

08:15 I can't wait to watch this.

08:16 - Yeah, this is gonna be one of my favorite Talk Byline episodes in the near term, I'm pretty sure.

08:20 Okay, enough of my stuff.

08:22 On to the six other things that we haven't done.

08:25 Remember we had Sherry Eskenes on the show a while back?

08:29 - Yeah.

08:29 - That was really fun.

08:30 She talked about a bunch of great things, but she also did a day in the code, I thought, like storybook for kids.

08:36 So her storybook for kids, which I know you and I both got a copy, right, Brian?

08:40 Yeah.

08:40 And I'm, it's actually pretty cool.

08:42 Yeah.

08:42 Like it.

08:43 Yeah, it's cool.

08:44 So think like a big, large picture book that tells a story, but about programming for kids rather than, I don't know, like a day in the park or whatever.

08:51 So that book's actually out.

08:52 I just want to, that'll be a link in the show notes.

08:54 If you've heard that episode, you want to check it out.

08:56 You don't could actually get the book now.

08:57 We talked about GitHub, Copilot and some other things like that.

09:02 I want to give a shout out to another tool that's kind of like this, but way more tamed down and it plugs into all sorts of different IDEs called tab nine.

09:12 We talked about tab nine.

09:13 I don't think I, I don't think I have either, but it's actually really well developed.

09:18 It's got a ton of different platforms.

09:21 For example, if you go over here and check it out, it's like, well, what do you want?

09:24 VS Code?

09:25 You want PyCharm?

09:26 You want WebStorm?

09:27 You want Adam?

09:28 You want Emacs?

09:29 You want Ruby mind?

09:30 You want straight?

09:31 - Yeah, straight Vim, yeah.

09:33 And so this is a tool that you plug into your editor.

09:37 Well, Python, that's offensive to have JavaScript in it.

09:39 Excuse me.

09:40 (laughing)

09:41 So you can come down here and it will help basically look at your code, look at the keyword arguments, and instead of just giving you auto-complete for the symbols, like functions and fields and stuff, it tries to kind of bring it together.

09:54 It's not GitHub Copilot in the sense that it's trying to pull other people's code and inject LAR.

09:59 It's not like stack overflow copy and paste with a tab type of thing.

10:02 It's looking at what's on your screen and trying to pull it together to complete a little bit more.

10:07 So if you have like a username equals quote Brian and then you call a function that takes a username, it'll suggest you pass in that variable value.

10:14 Go on. What do you think?

10:15 Actually, I definitely want to try this.

10:17 I think this having a smarter code complete, that sounds just like about the right level that I want to try first.

10:24 Yeah. Brandon?

10:25 Yeah, yeah, I actually had this Anna GitHub code pilot on at the same time.

10:29 Oh my gosh, what happened is a disaster.

10:32 But yeah, I like this because as much as I like VS Code of I'm a huge JetBrains fan and the fact that you can't use it in no PyCharm or anything else like that is very disappointing.

10:43 So yeah, I agree with that. Yeah, well, I think I want to get like five AI coding systems together and they can just mob program by themselves.

10:53 - Exactly.

10:54 So when I look at this stuff, one of the first things I think, okay, it's using AI, it's taking, it's like I said, it's taking the stuff out of my code and then applying the AI to that.

11:05 Does that mean my code is being passed to somewhere that I don't want my code to be?

11:09 And so somewhere, yeah, here you go.

11:11 It says your code is yours and yours alone.

11:13 It runs locally without sending any source code anywhere.

11:16 You can even work on a plane, Brian.

11:18 Anyway, I ran across this.

11:20 I was talking to the folks from there and I thought this is pretty cool.

11:23 I'll give a quick shout out to that 'cause the AI coding assistants are all the rage right now.

11:28 - Is this a paid thing or a free thing?

11:29 - Yeah, it costs money, but there is a free version.

11:32 So you get like what they call basic completion.

11:35 - Bad suggestions for free.

11:37 - Yeah, exactly.

11:38 Like every 10th is a bug, but the other nine are really good.

11:40 No, I'm just joking about that, I don't know.

11:42 But yeah, there's a free one and then you can pay for more.

11:45 Brandon, did you do the paid one?

11:47 Do you know the difference?

11:48 - I just used the free one.

11:50 I assumed that there's probably, like I said, better models and I think there's like a limit to the amount you can do with the free one.

11:55 So it just stops working the extra to do the work yourself.

11:58 >> Yeah.

11:58 >> To be fair, it doesn't look expensive.

12:00 >> No, it's reasonably priced.

12:02 >> Yeah. It's 12 bucks a month for the paid version.

12:05 I always feel like when people are like, "Oh, well I'm not going to pay $10 for this thing." It's like, "This is your job all day.

12:12 How much can you actually make from this job?

12:15 If this could save you an hour, surely." Anyway, that's a different discussion.

12:19 Speaking of discussions, following up on one of our episodes with Simon Willison, who talked about Apple Photos and SQLite and using DogSheep and Datasette to analyze it, Rhett Turnbull pointed out a project that he created that will, it says, macOS photo, oh, the OSX photos Python package exposes all of your data to your Python apps, and the next release will provide the OCR stuff out of Apple's Vision Framework.

12:48 So people have been tracking that.

12:49 There's some really exciting stuff coming to the Apple photo, iOS, etc.

12:55 Where if you take a picture of something, then it'll automatically do OCR and you can actually select and copy the text out of say a sign in a picture and paste that somewhere.

13:03 That'll be stored in the database and apparently this thing will give you access to that text.

13:07 >> That'd be cool. Can I get that in my car so that I can just have somebody else reading signs for me?

13:12 >> Exactly.

13:12 >> That'd be sweet.

13:13 >> Someday perhaps. All right.

13:15 Rhett, thank you for that.

13:16 Okay, last three things.

13:19 Really quick, I released three packages to PyPI last week.

13:24 Two of them are related.

13:24 They're around taking HTML and templates, either Jinja or Chameleon, two in one package for each language, and trying to reuse them in really clean, simple ways.

13:34 So if you've got some fragment, say, like an example I have on the site is a video app, and it's got a thumbnail of a YouTube video, then the title of the author, and then the number of views.

13:43 And if you wanna show that all over the place, you could either copy that code and replicate it, or with this inside your template, you just say render template or render partial, and you point at some HTML fragment bit, and it'll apply your model to that sub thing.

13:56 It allows you to basically create functions that return HTML inside of your templates.

14:01 - That's neat.

14:02 - Yeah, so it's super, super simple.

14:03 So like for the videos, you have like literally this little render partial, you know, quote shared video square, and you pass the video over.

14:10 Really, really nice.

14:11 So there's a Jinja partials for Flask people, and there's a chameleon partials that does exactly the same thing for Pyramid.

14:18 And then last thing, adding the chameleon template language to FastAPI so you can build proper web apps.

14:23 I published that, it's been around for a little while, but I finally published it to PyPI.

14:26 So you just put a little decorator onto a FastAPI function and it becomes a HTML endpoint rather than a API endpoint.

14:34 - Have you just, have you been using chameleon longer?

14:36 Is that why you're more comfortable with it?

14:37 - I, no, I probably have been doing more chameleon than Jenja, but I do a lot.

14:43 But the thing that I really, really like about Chameleon, let's see if I can find an example, it'll probably be good enough.

14:49 But what I really like about Chameleon is that it is valid HTML as it is.

14:55 Whereas with Jinja and the Django framework and a bunch of other frameworks, Mako and you go into other areas like Razor and ASP.NET, all of these are nice, but they all have HTML, HTML, blocks of code, blocks of code, HTML, block of code, HTML, right?

15:10 This is all driven through attributes, So like here, if I want something that's a loop, I can just say, "Talcolon repeat" as an attribute.

15:18 Or if I want, yeah, things like that, right?

15:20 Or you do condition, you say, "Talcolon conditional" and you put it in there.

15:23 So this is actually 100% still validates HTML, with just attributes that don't make sense.

15:27 So to me, it just feels cleaner.

15:29 That's why I like it better.

15:30 - Yeah, okay.

15:30 - Yeah, I kind of tore through all those without giving you a lot of chance to talk about them.

15:35 But anyway, that's my extra A type.

15:37 - Yeah, I like it.

15:38 - Thanks, cool.

15:39 All right, Brandon, you're up next.

15:40 - Yeah, so this is something I came across on Twitter and I signed up to do it.

15:45 So it's Kaggle's 30 days of machine learning.

15:48 Basically what it is, I guess if you don't know what Kaggle is, it's a place for data scientists to find and publish data sets.

15:55 They have online Jupyter notebooks that allow you access to free GPUs and things like that to run your machine learning models on.

16:02 You can collaborate with other data scientists and things like that.

16:05 And machine learning is one of those things I've always kind of wanted to get into, but I've always been a little scared.

16:09 and not sure the 100% of the resources to go to.

16:11 So I saw this 30 days of machine learning and what's nice is they give you an introduction into Python, the things you need to learn from Python to know how to do machine learning.

16:21 They show you how to build models in their Jupyter notebooks.

16:25 And yeah, so you go through that, you learn some basic and intermediate machine learning concepts.

16:31 You get some certificates, so if you want to post those like you knew off your resume or something like that, you can say, hey, I did some learning with Kaggle.

16:37 And the cool--

16:38 - I'm not denying this, but I suspect that if you ranked pretty highly on Kaggle and then you put that on your LinkedIn profile, or you're trying to get a job, I mean, that speaks pretty well.

16:47 - Yeah, yeah, I would think so.

16:48 And I think the cool thing is, like, at the end of it, there's a competition that they have with, I think it's like teams up to three, and it's only people that ran through the course, so you're not competing against people who have been doing machine learning for years, and it kind of gives you a little bit of that taste into what machine learning competitions are like.

17:04 So I think it'll be interesting, it'll be fun.

17:06 - Are you gonna do it?

17:07 - Yeah.

17:08 - Yeah, nice.

17:09 What I think is valuable here is the constraints, right?

17:13 You know, you have, here's your data that you're gonna be working from.

17:15 Here's the type of problem you're solving.

17:17 And so often when you're a beginner, whether it's machine learning or web development or whatever, it's really hard to know what is the right sized problem to attack.

17:25 It's so easy to go, well, that's too small, that's not interesting, or oh, wait, all of a sudden I tried to build Instagram and I got stuck, or whatever, you know?

17:32 - Yeah, and I think it's nice, you know, if they give you the data, like, yeah, I think a lot of times the biggest part machine learning and data sciences, cleaning the data and making sure you have the right data and the right attributes to look at.

17:42 Hopefully they walk you through how to, they should walk you through how to do that and kind of give you a taste of how to do that.

17:46 So, I think it'll be a good learning experience.

17:48 - I suspect this is free, is that true?

17:50 - Yeah, yeah, yeah, that's true, it's free, yep.

17:52 All you need is a Kaggle account.

17:54 - Yeah, and it starts August 2nd, which is like four days away, so yeah, don't hesitate, get in there if you're gonna be part of this.

18:00 - This sounds neat, and actually, there's this, but even if somebody doesn't wanna do this, Kaggle has a lot of learning opportunities for people that want to learn the tools.

18:10 It's an interesting resource for learning how to do this.

18:13 Yeah, absolutely.

18:14 Cool.

18:15 That's a great pick.

18:16 Brian, you're next, right?

18:17 Oh, right.

18:18 Yeah.

18:19 So, been testing a lot.

18:20 More testing.

18:21 So, one of the things I had a project that was set up to use Docs, but I also, early on when GitHub Actions came about.

18:32 I put it up on GitHub Actions too.

18:35 But I was trying to understand the workflow a little more.

18:39 At first, there were a lot of resources.

18:41 Then I came across this recently, just this weekend, this week, last week, Building and Testing Python.

18:47 It's part of the GitHub Actions guides.

18:51 It's actually pretty great and it goes through a whole bunch of stuff.

18:56 I mean, it's around a set of docs that talks about, Python, Ruby, Java, a whole bunch of other things.

19:03 But within the Python space, it really is a full setup of how to run this yourself.

19:12 The reason why I brought this up is I wanted to, hopefully people are using Tox, I love Tox.

19:17 One of the reasons why I like it is because it's like a CI system, but locally you can run through making sure your installs work, your builds work, and all your extra tools that you've got hooked up.

19:30 - Right, one of the problems is you just got your Python, whatever, version 393, whatever, installed, and you run your test, it runs on that, but you want to kind of exhaustively go, I want to test on all the versions that I, in theory, support every time.

19:43 - Yeah, or you might have an error in your pyproject.toml file or your setup.py, and you're not seeing that because you're not completely, you're not rebuilding it, but Tox will do that.

19:54 But so will CI systems, but it's kind of nice to have it set up both.

19:57 The directions here, it starts with directions on how to run pytest and to install dependencies and build, and lint, and run pytest on your project.

20:09 But if you already have talks set up, this is a duplicate effort.

20:13 But I think you want to jump down to the talk section of this document because it shows you just how to run talks directly.

20:21 It's a smaller setup, and essentially what KM-Axis is doing is setting up a Python environment and then installing talks and running your talks environments.

20:33 So you're having that same code from your talks any file running within GitHub Actions.

20:40 >> I like it because it's going to try to do the same thing locally as it will in CI.

20:45 >> Yeah. The one change I want to mention to lag out and we'll have this in the show notes, as I've modified this example because hopefully, It didn't make sense to me at first.

20:58 The example they show is on push.

21:00 When you push to a branch, it'll run these actions.

21:03 But you also want to set up on pull requests.

21:07 Just add pull_request right next to push.

21:11 When people do pull requests to your project, it'll run your talks also.

21:17 Then also, if you want to try to run 3.10, and hopefully you are right now because 3.10 is just around the corner, add 310-dev into the Python list.

21:28 >> Dash dev, interesting. That'll run the RC?

21:31 >> Yeah. Well, I don't know if it's the RC.

21:33 I think you can do RCs also, but dev is I think close enough, and you don't have to muck with it all the time.

21:40 >> Is that like the latest build, 310 or something?

21:42 >> I think so. I think it's just the latest 310 build.

21:44 Then at the bottom, there's this thing that talks e-pi, and that dash e usually means run the environment, run a specific one, but I don't set up the one that just says pi.

21:57 I usually say pi 37 to pi 38.

21:59 But I got some help also on Twitter to understand this.

22:04 What that does is it just will pick the one that's valid.

22:08 I tried it out and it works.

22:10 If you do this code, it'll run the correct one.

22:13 >> Very nice. In the live stream, we have Felix.

22:16 Hey, Felix says, "I love talks to you using it for my strong typing package and it's awesome." Welcome Felix. Yeah, we covered your strong typing package a few weeks ago. That's really good.

22:25 Yeah. Oh, and then Oli says the machine language sounds good.

22:31 So thanks Oli.

22:32 Yeah, absolutely. Yeah, absolutely. Yeah. All right.

22:34 Well, Brian, you spoke about the stuff on the plane, and I've got an alternative solution for you.

22:41 Okay.

22:42 This is really interesting.

22:43 This one comes from Patrick Park, this recommendation, and it's called Python-Vendorize.

22:49 So, vendoring a dependency in Python means instead of linking to the package you get from pip, you just go, I'm going to find that code and just jam it into my project and just copy it over, right?

23:01 Which is a bit of a hassle because then you've got to like keep syncing it and stuff.

23:04 But for small things like, you know, six, unsync, you know, like things that are one file or they're just pure Python and they don't have many dependencies, you know, it might just make sense if there were an easy way to just make that like a sub directory sub module of your package, then when somebody runs your code, they don't have to pip install anything.

23:23 No virtual environments, nothing.

23:25 So with this Python vendorize, that's what you can do for pure Python packages.

23:30 So the idea is if you've got some code that has lightweight dependencies, I don't know if I do this with something like Flask that depends on Vixoic, that depends on who knows what, right-click and so on, I wouldn't necessarily go too deep.

23:44 But for things that are smallish, What you can do is you can set up a vendorize.toml file, and then in here just list the packages, and you give it a location.

23:52 You say I wanted to go for my project into underscore vendor in this example, but that could be whatever.

23:57 Then you just run vendorize, Python-vendorize in the working directory where that toml file is.

24:04 What it'll do is it'll actually copy the package details over for that project.

24:10 Then in your code, you just say from underscore vendor, import package name, six requests, whatever.

24:16 >> Interesting.

24:17 >> It's interesting, right?

24:18 >> Yeah.

24:18 >> Yeah. So then you've got a program or a package really, that has effectively zero dependencies, even though you're still using some of these third-party libraries.

24:28 >> Do you know if it'll re-download, if you run this again, will it re-download them or?

24:33 >> I don't know for sure and I looked, I didn't see anything in the documentation one way or the other.

24:38 It is honestly a little sparse on documentation.

24:40 >> This is an interesting idea.

24:42 Actually, this does happen whether people like it or not, and it's completely legitimate according to a lot of the licensing.

24:54 But for commercial projects, this is very common that I don't want to go out and pull things from pip all the time.

25:03 I want to just have things local so that they're just built locally.

25:07 >> It might not be for just to avoid the pip install.

25:11 It might be that you want extreme control over what's shipped and you don't want something that might happen to that package coming down through pip and breaking your code.

25:20 Even if you pin it, you know, you might want to just have more control.

25:23 >> Right.

25:23 Or a decision that somebody takes the project in a completely different direction that you don't want.

25:28 It's like, this is a very hard fork sometimes.

25:31 >> Yeah.

25:32 I suspect rerunning Python-Vendorize will re-download it, but I don't know for sure.

25:37 Brandon, go ahead.

25:38 >> Can you pin versions in this?

25:40 >> Well, it looks like the packages in the vendorized.toml, it doesn't say that you can do versions, but I was guessing here, I'm thinking that you can probably pin them.

25:50 >> Yeah. I'm just guessing that it passes whatever that string is over to pip.

25:55 >> Yeah, that's what I was thinking as well. So probably you can.

25:58 >> We'll have to try it out. Somebody can tell us if we're wrong.

26:00 >> Felix is right there with you, Brandon, asking do you know of any specified version.

26:04 I don't know. Like I said, it doesn't say in the docs about it, but yeah, it's a small project, but I think it's an interesting idea and it could be, you know, if you just have these real simple dependencies and you're like, ah, we're gonna have to create environments and have all these complicated instructions because of, you know, a few little files, like just, here's a nice way to do that.

26:22 Obviously you can do it yourself, right?

26:23 But here's a more repeatable type of way.

26:26 Cool, all right, Brandon, take us out.

26:28 What's your last one?

26:29 - Yeah, so there's a newer project out there called Supabase.

26:34 I feel really weird saying the name Supabase.

26:36 (laughing)

26:37 - You gotta say it with an attitude.

26:40 It sounds like a car audio product.

26:41 I'm gonna go put a super bass in my car.

26:43 But basically what it is, sorry.

26:45 (laughing)

26:46 - When you're doing a query, it's like.

26:48 (laughing)

26:50 - But yeah, so they tout themselves as an open source Firebase alternative.

26:56 So if you've ever done a lot of JavaScript or been friends with JavaScript developers, a lot of people use Firebase because it provides authentication.

27:04 I believe they're more of a NoSQL database.

27:07 Real time updates, so if you subscribe to database changes, your app will change based on if it, you know, something changes.

27:14 So what Superbase is doing is something kind of similar, but they are running basically a Postgres database for you.

27:23 And then they've got different open source projects that are wrapping it.

27:27 So they have the authentication part of, which they have a wrap around the GoTo library from Netlify for handling authentication.

27:33 So if you want to have authentication for your app, You can easily do first name or email password, just email that sends an authentication link to the email.

27:42 They have an extensive list of OAuth 2 providers.

27:45 So if you want to add OAuth 2, they handle all that for you.

27:49 >> Yeah. So the main idea of this database is like, I want to have a front-end JavaScript framework, maybe hosted on the back-end by Python.

27:57 But then I just wanted to have a database access over an API, just like the entire CRUD story, And all of a sudden you run into all these challenges of offline, of authentication and stuff. And that's what this is mostly focused on, right?

28:13 Yeah, so they have a package that gets, you can use it called Postgres.

28:18 I can't say it.

28:19 It's a wrap around Postgres that basically gives you an API to your Postgres database that you don't have to write.

28:27 And they implement that in a way that, you know, you can just like you said, make those HTTP calls to write, read, to basically do your card operations to your database.

28:35 And what's nice is whenever you update your database, they automatically generate the API documentation for you.

28:40 So you're not writing any controllers, any services or anything to do that.

28:43 It's just provided by them.

28:45 And like you said, it looks like it's definitely a JavaScript thing, but they're actually just released a Python library for it. They show up right now.

28:52 Superbase-py.

28:54 Yeah.

28:55 So your snake has base.

28:58 Anyways, so it's currently, I believe, in alpha.

29:02 So I wouldn't suggest using it in like an enterprise application.

29:06 But it's definitely something to try, you know, play around with if you want to deploy to do authentication access to a Postgres database.

29:12 It was nice, you know, they give you the Postgres database, but you don't actually have to access it through their terminal where their UI, you can connect to it through, you know, whatever you use for your database.

29:21 And yeah, going along the no internet development, they also have a Sufa-based local you can run locally so you don't need internet to do your development.

29:29 So if you lose power or you wanna get on a plane or something, you can still do your work.

29:32 - Yeah, this is super cool.

29:34 And one of the things that's interesting here is the subscribing to the real time changes, right?

29:39 That's pretty unique, especially over a remote API.

29:43 So if you've got some front end and you want everyone to see those changes, possibly, guess you could even do this in like a Qt or a WX Python app or even a Terminal app, But you might even wanna just say, I've got a FastAPI app and I'm gonna fire up a web socket there so all the clients just get the changes streamed down.

30:02 So the changes stream to you and then they kind of like multiplex on out to all the people watching.

30:07 That'd be neat.

30:08 - Yeah, I was thinking something like, I was curious if you could set up like an AWS Lambda so where someone changes and you need to send out a notification email or something to get hooked up to that and it would just kick that off for you.

30:17 - Oh yeah.

30:18 - So things like that.

30:18 - Yeah, that's a good find.

30:19 I had not heard about Superbase but it does look super.

30:23 - Yeah, it looks really useful actually.

30:25 Do you know what the story is?

30:26 So what I'm looking at over here, they talk about, okay, so here's how you specify your API endpoint at app.supabase.io.

30:34 Is there, and it's in this open source thing, but there's probably some database as a service or something equivalent that I maybe sign up for, or I pay for, do you know what the story is around that?

30:44 I don't know, I mean, surely they are not running the database for the world for free.

30:48 They gotta charge at least bandwidth.

30:49 - Yeah, so that's the interesting thing.

30:51 So there's a, their pricing model is a little confusing.

30:53 I know that, I feel like they've gotten some funding.

30:56 And I don't know how they're going to plan to make money with this.

30:59 The pricing that they have is like $25 a project a month.

31:02 And that gives you unlimited API calls, real-time functionality, eight gigabytes of database space.

31:08 I mean, I don't know who they're using for their database provider.

31:11 I can't imagine they have a data center somewhere where they're running it, but.

31:14 - Yeah, it's probably on top of some cloud somewhere.

31:17 - Yeah.

31:18 - They do have a zero dollars per month version.

31:21 - Yeah. - Yeah.

31:21 - It's nice to get your project up and going, so.

31:23 - Yeah, very nice.

31:24 That's an excellent one.

31:25 All right, well, I think that's it for our six items.

31:28 Brian, you got anything else you wanna throw out extra, you wanna throw out there for everyone?

31:31 - Yeah, I mean, we had Simon Wilson on recently, and he just released a post about the baked data architecture pattern, and that's, if you know what he's up to, this isn't surprising, but it's a nice write-up.

31:46 Baked data is bundling a read-only copy of your data alongside the code for your application as part of the same deployment.

31:53 And it's just an interesting and neat write up and it's good to go have a read.

31:58 - Yeah, it says, "Most dynamic sites keep their code "and data separate.

32:02 "Code runs on the server and it's stored in "like Postgres or Mongo.

32:04 "With baked data, the data is deployed "as part of the application bundle." Interesting. - Okay.

32:09 - Yeah, and then also on the live stream, Tim Pogue is doing real-time research for us.

32:13 Thank you.

32:14 It looks like you were able to do a pin similar to as you would with pip with the Python vendorize.

32:20 So yeah, awesome, thanks.

32:21 Appreciate that.

32:22 Brandon, anything else you wanna throw out for people while we're here?

32:25 - No, not really.

32:26 I guess maybe a little bit of self-promotion if I could.

32:29 I'm currently working on a side project called Released.

32:32 It's at released.sh.

32:35 Basically what it is, it's working on a tool to automate release notes for companies.

32:40 I've noticed a lot of places, when they have releases, they need to go out and curate all these release notes and have somebody manually do this work It takes hours upon hours every release.

32:49 So I'm gonna try to automate that and make it easier for people.

32:53 - That looks like a great project and nice web design.

32:56 Well done.

32:57 - Thank you, thank you.

32:58 Tailwind CSS, if you haven't tried it, give it a shot.

33:00 (laughing)

33:01 - Hearing good things about Tailwind.

33:03 So many good things, must learn.

33:05 All right, speaking of must learn, one must be cautious when learning it turns out because if we study the circle of AI life, there's this great cartoon here on devhumor.com.

33:16 So there's the circle of AI life, and it's got these little pictures of how humanity progresses.

33:21 So there's some two humans sitting here analyzing neural networks.

33:25 It says, "Human researches AI," and then they're celebrating near a quantum computer.

33:29 "Humanity perfects AI." Then AI perfects itself with lots of lightning.

33:33 "AI enslaves humanity." There's pyramids.

33:36 "A solar flare disables the AI." And then there's humans worshiping a sun god.

33:40 Humanity worships the sun god.

33:42 (both laughing)

33:43 And we start over.

33:43 (both laughing)

33:46 There's our joke for the week.

33:47 >> It's good.

33:48 Thanks.

33:49 >> Yeah.

33:50 >> Awesome.

33:51 >> Yeah, yeah.

33:52 It's a warning.

33:53 It's humorous and ominous.

33:54 >> The singularity is coming.

33:55 Anyway.

33:56 >> Awesome.

33:57 >> Thanks, Brandon, for coming on the show.

33:58 It was fun.

33:59 >> Yes, thanks for having me.

34:00 >> Yeah, it was great to have you here, Brandon, Brian.

34:01 Good to chat with you all.

34:02 And thank you, everyone.

34:03 Bye.

34:04 >> Bye.

34:05 >> Thanks for listening to Python Bytes.

34:06 Follow the show on Twitter via @PythonBytes.

34:07 That's Python Bytes as in B-Y-T-E-S.

34:08 Get the full show notes over at PythonBytes.com.

34:09 >> Bye.

34:10 >> Bye.

34:11 >> Bye.

34:12 in BYTES. Get the full show notes over at PythonBytes.fm. If you have a news item we should cover, just visit PythonBytes.fm and click submit in the nav bar. We're always on the lookout for sharing something cool. If you want to join us for the live recording, just visit the website and click live stream to get notified of when our next episode goes live. That's usually happening at noon Pacific on Wednesdays over at YouTube. On behalf of myself and Brian Aukin, this is Michael Michael Kennedy, thank you for listening and sharing this podcast with your friends and

Back to show page