Latest / Talk Python To Me / #436: An Unbiased Evaluation of Environment and Packaging Tools
Transcript
- 0:00How well do you know your Python packaging tools?
- 0:02There are things like pip, which install a project's dependencies and their dependencies and so on.
- 0:07But in this mix, we also have more modern tools such as Poetry, Flit, Hatch, and others,
- 0:13and even tools outside of Python itself, which may attempt to manage Python in addition to the libraries.
- 0:20To make sense of all this, we welcome back Annalena Popkas
- 0:24for an unbiased evaluation of environment and packaging tools in Python.
- 0:29This is Talk Python To Me, episode 436, recorded September 21st, 2023.
- 0:34Welcome to Talk Python To Me, a weekly podcast on Python.
- 0:52This is your host, Michael Kennedy.
- 0:54Follow me on Mastodon, where I'm @mkennedy and follow the podcast using
- 0:58at Talk Python, both on fosstodon.org.
- 1:01Keep up with the show and listen to over seven years of past episodes at talkpython.fm.
- 1:06We've started streaming most of our episodes live on YouTube.
- 1:10Subscribe to our YouTube channel over at talkpython.fm/youtube
- 1:14to get notified about upcoming shows and be part of that episode.
- 1:18This episode is brought to you by IRL, an original podcast from Mozilla.
- 1:23When it comes to artificial intelligence, AI, what's good for trillion dollar companies,
- 1:28isn't necessarily good for people.
- 1:30That's the theme of season seven of IRL, Mozilla's multi-award winning podcast hosted by Bridget Todd.
- 1:36Season seven is all about putting people over profit in AI.
- 1:40Check them out and listen to an episode at talkpython.fm/IRL.
- 1:44And it's brought to you by Sentry.
- 1:46They have a special live event, like a mini online conference, where you can connect with the team
- 1:51and take a deep dive into different products and services every day for a week.
- 1:56Join them for launch week, new product releases, exclusive demos, and discussions with experts
- 2:01from their community on the latest with Sentry.
- 2:04You'll see how Sentry's latest product updates can make your work life easier.
- 2:08Visit talkpython.fm/sentry dash launch dash week to register for free.
- 2:14Hey folks, before we jump into the interview, I want to tell you about a new course we just launched,
- 2:20Data Science Jumpstart with 10 Projects.
- 2:22This is written by Matt Harrison, who has years of data science and Python teaching experience.
- 2:27And he brings his tips and guidance to you across 10 different data sets and projects
- 2:32in this new three-hour course.
- 2:34If you want to up your data science game, I encourage you to check it out at talkpython.fm
- 2:38slash data dash sci dash jumpstart.
- 2:41I learned a lot from this course, and I'm sure that you will too.
- 2:44The link is in your podcast player's show notes, so be sure to check it out.
- 2:47Now, on to that interview.
- 2:49Anna Lena, welcome back to Talk Python To Me.
- 2:54It's awesome to have you here.
- 2:55Thanks for having me again.
- 2:57It's always good to have you on the show.
- 3:00We had you on several times before.
- 3:03We talked about testing and mocking out dependencies in Python.
- 3:08And the very first time, this is quite a while ago.
- 3:11Yeah, it was.
- 3:12Way back in 2018, we talked about the magical universe, 100 days of Python by learning through
- 3:20Harry Potter themed problems, which is very fun.
- 3:22I learned so much in that project.
- 3:24It was really nice.
- 3:25I can still recommend it to anyone to do this 100 days of code.
- 3:29It's super fun and super fun.
- 3:30Let's maybe do a quick catch up before we dive into Python packaging comparisons and positioning.
- 3:38What have you been up to?
- 3:39I'm still a machine learning engineer.
- 3:41I'm in a German company.
- 3:43I think I was there the last time as well.
- 3:45It's called InnoVex.
- 3:46And we do all kinds of machine learning projects with customers.
- 3:51So I rotate from project to project.
- 3:54Right now, I'm working at a company called Babbel.
- 3:56Not sure if you heard of that.
- 3:58Oh, yeah.
- 3:58It's really a fantastic company since they enable users to learn new languages.
- 4:02And I'm working in the speech recognition team, which I like a lot since talking is such an
- 4:07important part of learning a new language.
- 4:09And yeah, I'm there as a senior machine learning engineer and helping them build their product,
- 4:15develop it further.
- 4:16And I really love it there.
- 4:17Yeah, that sounds like such a fun problem to be working on.
- 4:20And machine learning is evolving so quickly, right?
- 4:24Yeah, especially now with the generative AI.
- 4:27There's so much going on, so much you can do that it's hard to keep track of what's happening
- 4:32sometimes.
- 4:32Yeah, it seems like as soon as you have it figured out, something new comes along.
- 4:36Are you able to talk about what libraries you're using for that project?
- 4:39No, I don't think so.
- 4:41No worries.
- 4:41I checked before that I'm allowed to say that I work on speech recognition, but that's basically it.
- 4:47But that's, I'm going to guess it probably has something to do with Python, but we'll
- 4:50leave it there.
- 4:51I won't put you on the spot.
- 4:52Awesome.
- 4:52So, and that's not a surprise, right?
- 4:54To say people are doing machine learning with Python.
- 4:56That's by far the most popular way to do it these days.
- 4:59Yeah.
- 5:00Cool.
- 5:01Well, again, that sounds like a super fun thing to be working on right on the cutting edge.
- 5:06And understanding spoken word is especially tricky, right?
- 5:10For me, it's also so nice since I use the software myself to learn a language and working on something
- 5:16that is useful, not only for you, but for so many people, since it can be so hard to learn
- 5:22a different language.
- 5:23That's really nice.
- 5:23Yeah.
- 5:24It's really fun to work on software.
- 5:25It's more fun to work on software that, you know, other people, many other people are using
- 5:29it.
- 5:30It's a special kind of joy, I think.
- 5:32Absolutely.
- 5:32Would you say that projects that you work on have to use Python dependencies and virtual
- 5:37environments and stuff?
- 5:38Yes, so much.
- 5:39That's actually also why I did this talk in the beginning or why I started working on
- 5:44the talk on this topic since I was in a different project.
- 5:47And the people there asked me, okay, which packaging tool should we use?
- 5:51And I was like, wow, this is so difficult.
- 5:53I cannot even answer it.
- 5:54Since I know that there are so many tools out there, I didn't have a good overview of them
- 6:00and also especially not of the differences and what they are good for, what they can
- 6:05do, what they are not good for.
- 6:07And then I started digging into the topic and I was like, wow, this is just so complex and
- 6:13so many different tools.
- 6:14And yeah, it was really time for a good overview.
- 6:18And I think you did a really fantastic job writing this up and you did it in two varieties,
- 6:23right?
- 6:23You have the article on your blog and then you also have, you gave a talk at PyCon DE,
- 6:30right?
- 6:30So depending how people want to experience it.
- 6:33I also gave one at EuroPython, which is a more updated version, I guess, since Rai came
- 6:38out after I gave the talk at the German PyCon.
- 6:41So the new video from EuroPython, which is not on YouTube yet, it also features Rai.
- 6:48Yeah, we'll talk about Rai.
- 6:49It's crazy since it already shows that in a few months, there was another change and
- 6:54another tool came up, which is so popular now.
- 6:56It's only a few months old, you're like, Kondi talking.
- 7:00It's already a little outdated, right?
- 7:01That highlights what you're talking about, doesn't it?
- 7:03Yes.
- 7:04Let's start by thinking about Python from a beginner's perspective, because one of the first
- 7:09things that people are like, okay, Python is awesome.
- 7:12Whether they're a machine learning engineer who wants to use PyTorch, they're a web developer
- 7:17who is all excited about FastAPI or whatever.
- 7:21One of the huge powers of Python is that you have almost half a million libraries on PyPI.org
- 7:29to work with, right?
- 7:30And so if you pick one of them, it's awesome.
- 7:33It says, okay, this somewhere requires like, for example, FastAPI requires Python 3.7 or above.
- 7:39That's a pretty low bar these days.
- 7:41But there's already two things you have to deal with.
- 7:44FastAPI, the package, the version of it so it can't clash, and the version of Python that
- 7:49it runs on.
- 7:50And somehow as a beginner, you have to figure out, okay, how do I put all these things together,
- 7:55right?
- 7:56And how do you get started with these environments?
- 7:58So maybe speak to that just a little bit.
- 7:59I think that's a good starting point, since especially when you begin, I remember that
- 8:04for me, the concept of a virtual environment already was really confusing, although it's
- 8:09such a simple thing to understand.
- 8:11And then to go from there, maybe how you install packages in the best way, since I think it's
- 8:17always a good idea to start with a virtual environment.
- 8:20Since then, you have your dependencies in this nice little box or environment where it's isolated
- 8:27from the rest, and you do not have these dependency issues between different projects you might
- 8:31have or might work on that require the same package, but in a different version.
- 8:36So you can create this virtual environment or maybe a local environment.
- 8:41There's also this new variant.
- 8:43And then you can install packages there.
- 8:45So for example, with the FastAPI you just showed, you could use pip to install it.
- 8:50given that you have the right Python version.
- 8:52Yeah, wow, this already shows right now, since this is already the next category, right?
- 8:57Python version management.
- 8:59Yeah, it can be quite confusing.
- 9:01So you need the right Python version, which you can handle using a tool or different tools
- 9:07are available for that.
- 9:08Then you need to be able to install the package with pip, for example, or another tool.
- 9:13And it would be nice, or it's always nice to have a virtual environment for your different
- 9:18projects, which you will also need a tool for.
- 9:20Yeah, of course.
- 9:22So I guess it's already three things just if you want to get started installing a package.
- 9:26So in your article, in your talk, you broke it down into five different categories.
- 9:31Yes.
- 9:31These tools might work in, right?
- 9:32And depending on the tool chain you choose, you might need to use two or three different
- 9:36tools just to get started, right?
- 9:38Or you use one tool that can do it all.
- 9:40I think that for most would be the ultimate goal, I guess, that we have this single one
- 9:46tool.
- 9:46And I remember that you had this panel on packaging, right?
- 9:50Where you also talked about the difficulties of creating this tool and why it is so hard
- 9:55to do that in Python.
- 9:56And yeah, so I identified five main categories.
- 10:00One is Python version management, which we just mentioned already.
- 10:04Then you have environment management, where you can create, manage your virtual environments.
- 10:09We have package management, which is basically about installing packages and upgrading them
- 10:17when you need a new version.
- 10:18And then when it comes to packaging, I first thought, okay, there's just packaging, but there's
- 10:24actually also tools that can just do the package build step.
- 10:29And then there are tools that just do the publishing.
- 10:32So I split it up into two categories, one for building and one for publishing.
- 10:36I think that makes sense.
- 10:37Yeah.
- 10:37The publishing stuff people have less exposure to, right?
- 10:41That's farther down the line.
- 10:43You're not really a beginner at that point.
- 10:45Not usually anyway.
- 10:46Absolutely.
- 10:46But I think since many of the tools that do the building step also do the publishing step,
- 10:52you most of the time are going to use a tool that could do it anyway.
- 10:57Sure.
- 10:58Yeah.
- 10:58A bit of real-time follow-up from the audience here.
- 11:00Tushar says, actually, the EuroPython videos came out just yesterday.
- 11:06So how about that?
- 11:07People can check that.
- 11:08Oh, that's so nice.
- 11:09Yeah.
- 11:09Great.
- 11:09Yeah.
- 11:10We can link it in the show notes.
- 11:11Yeah.
- 11:12We absolutely can.
- 11:12Cool.
- 11:13Thanks for letting us know.
- 11:14So we've already started in kind of talking about the categorization here.
- 11:18And I'll give a quick shout out to some of the tools.
- 11:21You know, obviously, pip is involved, virtual VNV, but also virtual ENV.
- 11:27Then you might start talking about, well, some of the tools that do more like you talked about.
- 11:32So maybe poetry, PDM, Hatch, Rye, but stuff people might not know about too much is Maturion or Ensconce.
- 11:40There's a wide ranging set of tools.
- 11:42And what you did really nicely in your article and talk is you said, these five categories, let's create Venn diagrams and put into the overlaps the various tools.
- 11:53Like PDM can do package publishing and building and environment management and package management, not Python version management.
- 12:01So that's kind of the way that you evaluated.
- 12:04That's the unbiased aspect, right?
- 12:07Is that you're like, okay, let's just create some categories and create some ways to evaluate how full featured or how good is this.
- 12:13And then you go through it, right?
- 12:15There's actually one step further for the packaging tools like Hatch and PDM Poetry and so on.
- 12:21I also thought about features.
- 12:23And if you scroll down, there's like a feature list and things I thought about what should these tools be able to do or how do they differ?
- 12:33For example, yeah, that's the one.
- 12:36So one is if it allows you to manage your dependencies and if it resolves and locks dependencies.
- 12:42Since there are some tools like Hatch, which cannot do that at the moment.
- 12:47I know that it's supposed to do it in the future.
- 12:49But if you want that functionality, then for example, you might not want to use Hatch at the moment.
- 12:55And then there's also there's a large number of peps on packaging.
- 12:59But I picked out two specific ones.
- 13:02One on editable installs, which I think can be quite useful, especially if you develop your package yourself and you want to install it in editable mode.
- 13:12Yeah, maybe it's good to mention what this is.
- 13:14Yeah, yeah.
- 13:15Tell people why you care about that.
- 13:17Yeah, exactly.
- 13:17So if you develop your project yourself and you want to make sure that during development, the changes to your package are directly reflected in your environment.
- 13:29You would install the package with pip install minus E for the editable flag and the name of the package.
- 13:36And then you do not have to reinstall it every time you make a change.
- 13:39This is very useful.
- 13:41And then there's one PEP on how to specify your project metadata in the piproject.toml file, which is like the basic file you need when you specify or create a package where you put all your general information, the name of the package, the website, your author name and so on.
- 14:01So you can define the code, the dependencies, the dependencies, the dependencies, the dependencies, you can define scripts there.
- 14:04And there's one tool, namely Poetry, which has its own way of defining the metadata, I think because it was developed before this PEP was accepted.
- 14:15And they also promised to change it at some point, but they still haven't done that.
- 14:20So I guess that's also something at least you should be aware of when you choose a tool like Poetry that it might have like a few differences in how to specify it in the piproject.toml file.
- 14:32I'd like to hear your thoughts.
- 14:33This portion of Talk Python To Me is brought to you by IRL, an original podcast from Mozilla.
- 14:40When it comes to artificial intelligence, AI, what's good for trillion dollar companies, isn't necessarily good for people.
- 14:47Can the risk and rewards be balanced?
- 14:49That's the theme of Season 7 of IRL, Mozilla's multi-award winning podcast, hosted by Bridget Todd.
- 14:55Season 7 is all about putting people over profit in AI.
- 14:59I think you'll find Episode 2 pretty interesting.
- 15:02As you surely know, LLMs like ChatGPT are all the rage these days.
- 15:07Do they seem like magic?
- 15:08Well, it turns out that much of their power comes from millions of people entering and correcting data in these LLMs.
- 15:14Episode 2, The Humans and the Machine, gives us a glimpse into the world of these people behind the AIs.
- 15:20For policy junkies, IRL looks at the idea that we're all just guinea pigs in a big AI experiment,
- 15:27like the meal planning app that suggests bizarre recipes such as Oreo vegetable stir fries
- 15:32and flawed technologies that compose more deadly risks when it comes to something going wrong,
- 15:37like self-driving cars blocking emergency responders.
- 15:40You'll also hear from people building more responsible ways to test new AI technology.
- 15:45And we find out why it's taking so long to regulate this massive industry.
- 15:49That's IRL, Season 7 from Mozilla.
- 15:52Check them out and listen to an episode at talkpython.fm/IRL.
- 15:56The link is in your podcast player show notes.
- 15:59Thank you to IRL and Mozilla for sponsoring the show.
- 16:04To me, it seems like a lot of these tools like Poetry or Flit or others, as their own thing, they're pretty self-contained.
- 16:12And they kind of do the job for most things you need to do for your package management, project management, installing.
- 16:19The hash doesn't lock.
- 16:21But as long as you kind of stick to them, you're more or less, you can solve all the problems you need with one.
- 16:26But choosing, figure out how to choose which one is really hard and kind of like with your Rai example is the reason you chose one six months ago might not.
- 16:36There might be a better choice now.
- 16:38So it's good to see them side by side, don't you think?
- 16:40Yes, absolutely.
- 16:41And also, that's why I wanted to do the unbiased evaluation.
- 16:45There's often personal preference that comes in with packaging tools.
- 16:50For example, one of my colleagues, like, hates might be a strong word, but he very strongly dislikes poetry.
- 16:57Since in the past, they once did an update or a new version, and it broke something in the older versions, but they did not tell the users beforehand.
- 17:06And several people got very upset.
- 17:09And they just said, okay, I'm not using poetry anymore.
- 17:12Now, if you were then in a team with people, and you choose a tool, and one of them says, like, no, we are not going to use poetry, then, yeah, this has also an influence on people.
- 17:23So I think having an unbiased view of these tools can be very difficult, since it's often also a team decision that if you're already used to using a tool, it might be easier to just use that in your team.
- 17:35Or if something is already working for you, then it might not be worth putting in effort to learn or, yeah, get caught up with a new tool.
- 17:43Yeah, you don't have to necessarily keep switching to the newest, shiniest one of these, right?
- 17:49Like, if it's working for you, whatever you're doing, then maybe that's fine, right?
- 17:52Definitely.
- 17:52So before we get into this, many of these things we're going to talk about don't come with Python itself.
- 17:59We have pip, we have venv, and setup tools, and I think that that's it out of this big, long list of things.
- 18:06Do you have a preference or a tendency to stick with what comes with Python so you don't have to install other things?
- 18:13Or do you see the advantages of these external tools to be greater and worth it?
- 18:18I do see the use, and sometimes for me, although I've created so many virtual environments, I sometimes cannot remember how I need to call venv correctly to create a new virtual environment.
- 18:28And with virtualenv, it's just virtualenv and then the name of the environment, and it's just simpler.
- 18:35And I can remember that.
- 18:37So sometimes it can be that easy that it makes it more useful.
- 18:41Other tools, they solve a different problem that's not really related, like pipX and pyenv.
- 18:49There's no real Python equivalent.
- 18:51That's true.
- 18:51Well, let's go through and I guess talk about probably one that people do less, but is also really important.
- 18:58Not package management, but Python management.
- 19:02Want to tell us about that one?
- 19:04Okay, so Python version management, I always included a short definition since there are no proper definitions of these categories.
- 19:11It's just what I thought would be useful.
- 19:13So for me, Python version management means that the tool is able to install Python versions and lets you switch between them easily.
- 19:22And yeah, most popular for that is pyenv.
- 19:25And it's also one of the few tools actually that can do that.
- 19:29You can also do Python version management with Conda and then there's Rhino, which can do it and also pyflow.
- 19:35But pyflows, I excluded it from my list since it's not actively developed anymore.
- 19:41It's still in the Venn diagram, but yeah, I'm not sure if it's that up to date anymore.
- 19:45But yeah, you can just with pyenv, for example, you can say pyenv install and then like 3.10.4
- 19:53and we'll get the version of Python and install it on your system.
- 19:57And then you can just switch between the different versions you have installed.
- 20:01And yeah, this can be useful in many different ways.
- 20:04For example, if you have projects that support multiple Python versions, or maybe you just want to install the newest one and check out a few of the features it has to offer.
- 20:15Yeah, it can just be nice to be able to switch between the versions yourself or set them for your current shell session and so on.
- 20:23Yeah, and this starts to get us into an interesting philosophy here.
- 20:27Many of these tools kind of take over your day-to-day flow of working with your code and the tools, right?
- 20:35So for example, pyenv, you do pyenv local, pyenv global.
- 20:40I guess maybe even more with things like hatch and flitch and so on.
- 20:44Instead of just saying Python my code or Python, you know, dash M something, you would say like flit run something.
- 20:54Sort of, you've got to adopt its way of working on the terminal a little bit to get the most value out of it, right?
- 21:00And that's also something I found confusing in the beginning.
- 21:03I remember that when I used poetry for the first time, I didn't really understand why I couldn't run my package or my code anymore with Python.
- 21:12But I always had to put poetry run Python, my script.py.
- 21:18Once you understand that this enables the tool to run your code within a virtual environment for you with all the dependencies installed, and you do not have to do anything, then it made click for me.
- 21:30And it made sense, but in the beginning, I was thinking that it was just more complicated, and I didn't really see the point.
- 21:36Yeah, and going back to the beginner type of thing, it helps you in a lot of ways, but it's also a new thing that you have to learn in order to get started.
- 21:45It alleviates the need to say, well, now you know the venv command.
- 21:50You don't just run it.
- 21:51You say Python dash M, and then you activate it, and it's different on Windows.
- 21:54I don't know why it's different on Windows, but it just is, so you just do that.
- 21:57But at the same time, you now have to learn a slightly different way to run it.
- 22:01So I think that that's an interesting tradeoff that a lot of these tools make.
- 22:05Another thing that I think about when I think about these tools is like you were saying you can't just run your Python code,
- 22:12because a lot of times this management of the dependencies and the environment that often lives in some kind of hidden place in your user profile or somewhere, right?
- 22:24Whereas if I say Python dash MVNV, it makes a folder wherever I run that.
- 22:29And so I can activate it.
- 22:31So, for example, if one of these tools were to make the environment locally instead of in some kind of obscure location it finds,
- 22:39then I could still just activate it and do regular Python things.
- 22:43But if it hides it from me, then I'm required basically for any practical reason to go through its terminal commands, its shell, CLI, right?
- 22:53Is that something you considered?
- 22:55Like which ones have overrides to put them locally or do it by default?
- 22:58Or is that anything you considered here?
- 23:00No, actually, I did not.
- 23:01But that's a very good point for an extension of the post to consider that.
- 23:06I just got used to just calling, for example, with poetry, you can just say poetry shell.
- 23:12And then it will activate the virtual environment for you, right?
- 23:16So it's just, I guess, getting used to a different way of activating your virtual environment.
- 23:22So that worked well for me.
- 23:24But I think it just depends on how much you have used the other virtual environment functionalities before.
- 23:31For me, it wasn't that hard to switch, I guess, since I work a lot with packages.
- 23:36And then it can be very convenient.
- 23:38I totally agree.
- 23:39I guess what I didn't really say before, and I was talking about like using the new CLI stuff is when you're doing this for yourself, you kind of adopt one and you get used to it.
- 23:48And you're like, all right, this is great.
- 23:49But if I'm following, say, a tutorial on some docs, it'll say, you know, okay, activate the virtual environment this way.
- 23:57You're like, wait, that's not how I do it.
- 23:58You know, now run Python.
- 23:59Wait, that's not how I run it.
- 24:01And so this putting it together of like, I know what I'm doing and I see what the thing tells me to do.
- 24:06But how do you make sure that those are lining up?
- 24:08And if there's a local environment that's kind of equivalent, like you could sort of follow the steps and it might still work.
- 24:15It's kind of what I was thinking.
- 24:16That's a very useful idea.
- 24:18I will put that on my list of things to look at.
- 24:21This could be your PyCon US talk.
- 24:23Yeah.
- 24:24Yeah.
- 24:25I actually have an idea for PyCon US next year already, which I want to work on.
- 24:29I did a lot of packaging work for the last months.
- 24:33But I'm really, I really want to keep this post updated, since I find it useful myself.
- 24:38And I was asked by so many people after the talks and also at my company.
- 24:42Now, many people ask me, which tool am I supposed to use now?
- 24:45And we have these requirements and so on.
- 24:48And running, like having the virtual environments somewhere where you can activate them also yourself.
- 24:53I think that's a very useful thing to do.
- 24:56I never thought about this following a tutorial point of view, but it is very important for learners, I guess.
- 25:02Yeah.
- 25:02Especially when you're a beginner.
- 25:03Yeah, absolutely.
- 25:04Absolutely.
- 25:05It's also worth pointing out there are some tools that you just didn't really evaluate because you didn't quite necessarily see that they fit totally in the picture, like pip-tools, which I'm a big fan of, actually.
- 25:15But also, Mike Fiedler out there asked, was PyEV-VirtualEV evaluated as well?
- 25:21No, it wasn't.
- 25:23I should write that down.
- 25:24I will do that right now.
- 25:25I can guess, but I have no experience with PyEV-VirtualEV.
- 25:29Me neither.
- 25:30The speaking of it is tricky.
- 25:31Okay.
- 25:33But I think I put pip-tools in the very end of the post into the categories of tools which don't really fit in.
- 25:39Yeah.
- 25:39Also, Tox is there and the author of Tox, which can be used or which I only knew from testing, where it allows you during testing to specify different Python versions, which you want to run your tests with.
- 25:53But Tox also can be used to handle virtual environments.
- 25:58And I was completely unaware of that.
- 26:00But it's still not complete the picture with the five categories, but it's already complicated enough, I guess.
- 26:07Yeah, I don't know how much value it adds to really say, we're going to completely cover everything because part of the value is making a few recommendations as well, I think.
- 26:17Yes.
- 26:18Not just going, here's a complete list.
- 26:19That sounds more like an awesome list of packaging, which maybe that exists.
- 26:23I don't know.
- 26:23Maybe that's also a good point to add for everyone that wants the solution now.
- 26:29I do not have the solution.
- 26:31I cannot give you the best tool.
- 26:34It really depends on what you want to do, what your team is doing, what your personal preferences are.
- 26:39Hopefully, at some point, we might have the one tool which can do everything and is adopted by most people.
- 26:45But at the moment, lots of these tools are really used and also can be useful.
- 26:51And there's more variations, not fewer.
- 26:53So I would like to see that too, but it is tricky.
- 26:56There's so many, I think another one of the challenges to think about that I know I've seen previously around, say, for example, pipenv versus some of the other tools where are you building a library that you want others to use?
- 27:09Or are you building an application?
- 27:10Yes.
- 27:11Because if you over-constrained, say, like your lock file, no one can use your library.
- 27:16But that's exactly what you want for your application.
- 27:18So it's totally stable, right?
- 27:20These kinds of tensions are in there.
- 27:22And so it could also be pick the right tool for the right situation.
- 27:26In the beginning, when I first worked on the talk, like it is 45 minutes long, which is the longest time slot you can get at PyCon.
- 27:34And I had this point with applications versus library in it, but I really had to get rid of stuff since it was way too long.
- 27:43And it was really hard to decide what to talk about and whatnot, since there are so many points to consider that it can be hard to boil down to the most important facts.
- 27:53I also had live demos in the talk in the beginning for the different tools, but that also took up way too much time.
- 28:00But it can be fun to play around with them to get to know them better.
- 28:04It's super fun.
- 28:05The live demos that involve downloading stuff from the internet are scary, though, because at conferences, the internet can be pretty sketchy sometimes.
- 28:12That's true.
- 28:12All right.
- 28:13So the first area was virtual environment management, and that's tools like VNV, so virtual ENV, pip ENV, which we just talked about, Conda,
- 28:22and then even Raya.
- 28:23So let's maybe talk about some of these.
- 28:27You sort of compare.
- 28:28We talked a bit about using VNV versus virtual ENV.
- 28:31I've always just stuck with the built-in one for the reason that it's built-in, but, you know, it sounds like you use virtual ENV more.
- 28:39What do you find better about it?
- 28:41I use both, actually.
- 28:42Sometimes I use one and sometimes the other.
- 28:45My understanding is virtual ENV is faster, but it's not something I'm doing a ton of.
- 28:50So it's like I'll set one up for a project and then I'm good to go.
- 28:52So I don't, it doesn't really motivate me.
- 28:55One area that I think is important to cover is maybe the files that specify your project and your dependencies.
- 29:02Yes, maybe let's do that.
- 29:04Yeah, yeah.
- 29:04So traditionally there's been this requirements.txt, which is just lines in a text file, but there's been a, in almost all of these tools, a move towards pyproject.toml.
- 29:14I think that's a very important point to know about if you talk about packaging in general, that you have one file, which is pyproject.toml.
- 29:23For me, toml was in the beginning of a new config language or format I didn't know about.
- 29:29So it's like you have YAML files and JSON files and toml is this other format, which is quite simple.
- 29:36And it was decided to use the toml format and in the PEP for pyproject.toml, where it was introduced, they also discussed the different formats.
- 29:45So it's quite an interesting read.
- 29:47This central file in your package, I already mentioned that you put like general information there, like the name of the package, the author names, where the readme is and so on.
- 29:59But it allows you to do very complex things as well.
- 30:02Now you can configure tools there, like if you want to do formatting with black or style checks and so on, you can define that there.
- 30:11Yeah.
- 30:12And you can put your dependencies when what you mentioned there, then some tools allow you even to specify different virtual environments and how they should look like.
- 30:24You can define scripts that you want to run.
- 30:26And then, for example, if you always run your pytest tests, you can have like a command, hatch run test or poetry run test and it would run the test for you and maybe also do the coverage report and so on.
- 30:43This portion of Talk Python To Me is brought to you by Sentry.
- 30:45You've heard me sing the praises of Sentry for their error tracking and performance monitoring plenty of times on the show.
- 30:52But this time is different.
- 30:53They have a special live event, like a mini online conference, where you can connect with the team and take a deep dive into different products and services every day for a week.
- 31:04Join them for launch week, new product releases, exclusive demos, and discussions with experts from their community on the latest with Sentry.
- 31:10You'll see how Sentry's latest product updates can make your work life easier.
- 31:15New announcements will be released every day on YouTube at exactly 9 a.m. Pacific time.
- 31:21On Monday, November 13th, performance.
- 31:23Tuesday, user feedback and session replay.
- 31:26Wednesday, data resiliency and platform.
- 31:29Thursday, frameworks, community, and integrations.
- 31:32And finally, Friday, November 17th, open source sustainability.
- 31:35I'm already signed up.
- 31:37Join me at talkpython.fm/sentry dash launch dash week.
- 31:42The link is in your podcast player show notes.
- 31:44I'll see you there.
- 31:45Thank you to Sentry for their continued support of Talk Python To Me.
- 31:49In your article, you'll link over to the pandas, pyproject.toml.
- 31:55And that thing has a lot of stuff going on, as you would imagine from such a project as pandas, right?
- 32:00But you can even specify like project URLs, entry points for just running a command on the terminal.
- 32:09Things like if you want to use AWS, you could pip install bracket AWS, and it'll, that actually brings in a whole list of potential dependencies or GCP.
- 32:18Pretty comprehensive.
- 32:19Way more than just the list of dependencies.
- 32:21If you stay there, that is also an important point that in the pyproject.toml file, you define which build backend you use.
- 32:28Yeah.
- 32:28This would then be where you, for example, maybe have poetry or hatchling or setup tools and so on.
- 32:36So which tool you want to use to really do the building step in the, like behind the curtain?
- 32:42How do you say that?
- 32:44Yeah.
- 32:44You know what I mean.
- 32:45Yeah.
- 32:45Yeah.
- 32:46Here's the build system that it's got here.
- 32:49Build backend is mesonpy for this particular one.
- 32:53Interesting.
- 32:53It's less important if you have a pure Python thing, right?
- 32:58Although it's still potentially relevant for building the wheel.
- 33:01But if you've got a really complex, like a Rust integration or a C++ integration, then how that all happens when you say build, you want to have a lot of control over that, right?
- 33:11And also, if you use a tool like poetry, it will set the build backend to poetry, I guess, automatically, which most of the tools do.
- 33:20Most of the tools decide which build backend to use.
- 33:22Only PDM is a tool which allows the user to choose the build backend freely.
- 33:27I think Hedge uses Hedgeling.
- 33:29Poetry uses poetry, I guess.
- 33:31I don't know about the others, actually.
- 33:33Sure.
- 33:34We've been talking for a little while.
- 33:35Now we've finally come to the thing the person wants to do, pip install a package, right?
- 33:40Exactly.
- 33:41So that is package management.
- 33:43There are several tools that allow you to download and install libraries and their dependencies.
- 33:48And the major one, which everyone knows, I guess, is pip.
- 33:51But there's also pipx.
- 33:53Or you could use Conda to install packages.
- 33:56But also poetry, for example, like one of these packaging tools.
- 33:59And yeah, it will download the library for you and install all the dependencies automatically.
- 34:04Yeah, I guess that's the most important thing to know about it.
- 34:08Yeah.
- 34:08So a lot of these will make the virtual environment for you.
- 34:11And then you just, instead of pip install, you, their name install, right?
- 34:16Like poetry install.
- 34:17Or sometimes they have add, right?
- 34:19Something along those lines.
- 34:21But then they'll figure out where their virtual environment is and install the thing the way you've asked.
- 34:25And also, if you use one of the packaging tools, it will do the dependency resolutions for you, which sometimes works, sometimes not so well.
- 34:34But I guess this is something that pip is not doing.
- 34:37I think it just tells you about conflict.
- 34:40Another important thing that it helps you, that many of these tools help you with that pip will not help you with is dependency recording or accounting, I guess, is the right way to maybe think about that.
- 34:52As well as restricting it to a particular version.
- 34:55So if you add one of these things, it might put the dependency into the piproject.toml and then also create a lock file, right?
- 35:02Yeah.
- 35:03Should we shortly say what lock files are about?
- 35:05Yeah.
- 35:06Tell people about it.
- 35:06Okay.
- 35:07So this is the second recap I had in the talk or which is also in the blog post.
- 35:11First one was piproject.toml.
- 35:13And the second one is a lock file.
- 35:16So in the piproject.toml file, you would usually have your dependencies, but in an abstract fashion.
- 35:22So you would not pin them to exact versions.
- 35:25So you would not say I need pandas 2.0.3, but you would set a range or not give restriction at all.
- 35:34And then you have the lock file, which really records the exact versions of all the dependencies that you have installed for a project.
- 35:41And if you commit or have that lock file within your repository, it allows to really reproduce the exactly same setup that you have on your machine.
- 35:53So you can reproduce it on multiple platforms.
- 35:56And I also linked one, I think the one from Poetry.
- 35:59So if you look at a lock file, it can become huge.
- 36:02So it really has the exact versions of all dependencies and sub dependencies and so on recorded.
- 36:08Yeah.
- 36:08Here we go.
- 36:09This one from Poetry.
- 36:11Yeah, that is, let's see, that's 1,685 lines.
- 36:15That is, that's a big lock file.
- 36:17It is.
- 36:17It also, though, it does follow some of the best practices, right?
- 36:21So it says the package mypy in the version of it, rather than just mypy equal equal one five one, it'll have things like, and here's the hash of that, which is, you know, a recommendation to store that.
- 36:34But in addition to just saying, here's the hash for my particular install, it has it, here it is for macOS, here it is for this other version of Mac, here it is for Linux, here it is for the ARM version of Windows, or the AMD version of Windows, right?
- 36:47And on and on and on.
- 36:48So it does record a lot of information there.
- 36:51But the main goal of just saying, in a year, if I go pip install or poetry update or what, I don't remember the poetry command.
- 37:00There's so many, I've read all of the different CLIs for all of them.
- 37:04So the equivalent of pip install, it'll look at that and go exactly the same thing.
- 37:08Because I see one of the guys in the audience here, I was just speaking with him.
- 37:14One of my courses, I didn't pin the dependencies, and it uses SQLAlchemy.
- 37:19And SQLAlchemy 2 is now out, which is awesome.
- 37:22But SQLAlchemy 2 has a breaking change from SQLAlchemy 1, so some code sample wouldn't run.
- 37:28It's like, oh, what's going on?
- 37:29I'm like, oh, no, just for now, pin the dependency yourself, and I'll fix it later today.
- 37:33But it's not a theoretical problem.
- 37:35I literally ran into it yesterday, today, by way of one of the students.
- 37:40I agree.
- 37:40It can be very useful.
- 37:41Also, if you work on a project with several people, then having the same setup everywhere can keep you from having a headache.
- 37:50Yeah.
- 37:50How much isolation do you do, personally, for your work?
- 37:53Do you do Docker containers, or is it enough to just have a lock file and an agreed-upon version of Python?
- 38:00We often use Docker containers, since I work a lot with production environments.
- 38:04But for personal projects, I usually only use lock file.
- 38:08Same here.
- 38:09I don't really use Docker all that much.
- 38:10I find that it's enough with just a lock file.
- 38:14Yeah.
- 38:14Lock file is super important.
- 38:16Maybe, you know, instead of going through all of these, maybe just give your thoughts on some of the, with regard to package management, just some of the things in here.
- 38:24For me, especially one important point was there is Conda also, which you can use for lots of things.
- 38:29But the post and also the talk does not go into detail on Conda, since it's this huge, like, huge own environment or universe with Conda.
- 38:41Also, packaging works a little differently.
- 38:43And the resulting packages will be on the, not on PyPI, but they have their own index.
- 38:49Yeah.
- 38:49There is not a lot of detail there.
- 38:50And there's also pipenv.
- 38:52I've never used pipenv myself, actually.
- 38:54I never really had the use case for it, but it has been around for a long time.
- 38:59And what I found interesting is that pipenv uses also the lock file functionality and also introduces a TOML file, but it's pipfile.toml, which I found interesting since it shows that also some tools before the standard was introduced used something similar, which I found interesting.
- 39:21But for me now, I'm not using pipenv since I like having only the PyProject TOML file.
- 39:28Having this additional pipfile just confuses me.
- 39:31Yeah, because a lot of the packaging and stuff you can already do through pyproject.toml.
- 39:35So why have more files?
- 39:36Yeah.
- 39:37And I often also have to do package building.
- 39:39So to get a real file or just be able to install the packages on different environments.
- 39:45And then it's nice to use one of the other tools since pipenv can do package management and environment management, but not the packaging itself, like building a real file or publishing the package.
- 39:57What one are you using these days for building packages or publishing them?
- 40:02I'm currently using Hatch.
- 40:03I like it a lot since it allows you to declare your environments within the PyProject TOML file.
- 40:10And I like to have everything organized.
- 40:13So having a single place where you can also say, okay, this is my environment for creating the documentation.
- 40:20And I only need material like MkDocs material for this or having one environment for all the style issues like running black and eyesword and the type checkers.
- 40:32I like that a lot.
- 40:34But a lot of people from my company are now using Rai.
- 40:38So I have to check that out, I guess, very soon for some proper project.
- 40:43Yeah.
- 40:43I want to save Rai until the end because it's a very different philosophy, not putting a judgment on it, but just it really lives in a different style and philosophy than many of these other tools.
- 40:53So absolutely.
- 40:54Yeah.
- 40:54You hinted towards this with the packaging panel discussion I had with some folks there.
- 40:59And it's I think we're going to see stuff going that way.
- 41:01Maybe not exactly with Rai, but in that general, general vibe.
- 41:05Yeah.
- 41:05This idea of having multiple environments for certain different parts of your program or of
- 41:12your project is really interesting because for small projects, it doesn't matter.
- 41:16Right.
- 41:16But as they get bigger and bigger, I was just talking to Brian Okken yesterday on Python Bytes about this.
- 41:22He'd brought this up.
- 41:23On Talk Python training, I have maybe where the courses are.
- 41:26I have maybe 48 dependencies that I list in the main top level.
- 41:31These are the things I'm using.
- 41:32But there's 250 different packages.
- 41:36If you pip install dash R, you know, like build out that whole thing, right?
- 41:39The transitive dependencies.
- 41:41Most of the time, it will not install everything.
- 41:45I can get the stuff to run the site all the time.
- 41:47But also the data science analysis stuff and the notebook tools and other things like this MKDoc stuff.
- 41:54One of those has a restriction that is something, you know, something less than X.
- 41:59And another part has something greater than X.
- 42:01And they just they can't go together.
- 42:03And they don't necessarily need to live together.
- 42:05But in order, just without having a separation of the where the dev tools go and where the counting tools go and where the runtime tools go, they get too mixed together.
- 42:17You know, actually not sure if any of the other tools do the same already since it all changes so quickly.
- 42:23I haven't checked the other tools in the past four weeks.
- 42:26So I just got started with Hatch.
- 42:28And that's also what I mentioned in the beginning.
- 42:31Sometimes when you got used to using a tool and it works well for you, you do not get weird errors when you install it or do things.
- 42:39And you find when you have a problem, you find the error messages useful and how it works.
- 42:43And I also like the podcast episode you had with the author.
- 42:47It was very...
- 42:49Yeah, with effect.
- 42:49Yeah, I really liked listening to it and that he's working on it.
- 42:53And I find it really impressive what he's doing with just...
- 42:57He's not even able to type, right?
- 42:59I believe he can.
- 43:00And I think it's just limited.
- 43:01So yeah, it's really impressive what he's doing.
- 43:04I think it's great.
- 43:05I think Hatch is cool.
- 43:06I have to say I also used poetry in the past, which also worked well for me.
- 43:09I have nothing against poetry.
- 43:11Just your teammate does.
- 43:13Awesome.
- 43:14Okay, let's see.
- 43:15We talked about Conda.
- 43:16I think PDMs may be interesting.
- 43:18Yes.
- 43:19It's one of the newer ones.
- 43:20So people might know less about it.
- 43:22Do you want to tell people about PDM?
- 43:23Also, I sometimes forget about it since I've never used it.
- 43:26But I know several people which like it a lot.
- 43:28PDM for me was quite new since most of the tools are based on using virtual environments.
- 43:34And PDM is one of the only tools, I think, that implements a PEP, which is PEP 582 on local packages, which is an alternative way of implementing environment management.
- 43:47And the PEP was recently rejected.
- 43:50So beforehand, it was open of whether that might be the new way to do environment management.
- 43:57But I think it's still an interesting approach.
- 43:59And yeah, PDM is also, I guess, used by many people.
- 44:03It can do everything except for managing Python versions.
- 44:07But it allows you to choose your build backend freely.
- 44:11So you have quite a lot of flexibility.
- 44:13And it's also developed very quickly.
- 44:17So like new features are added.
- 44:19And it's a very active project.
- 44:22Earlier, Mike Fielder said, pour one out for easy install.
- 44:26Indeed.
- 44:26I would say, I would add to that, that, you know, pour one out for PEP 582.
- 44:32Because I really like that idea.
- 44:34You know, it was a little bit like the way that Node modules and the project.json stuff works for Node, where it's just like, if you try to do something, it's just going to go up in the directories until it finds the directory that contains the thing.
- 44:48You know, like, find where the virtual environment is at the top and just use that without you have to activate it and do all sorts of stuff.
- 44:54And I thought that was a cool idea.
- 44:55But it's not a thing, unfortunately.
- 44:57So I guess it's still a thing for PDM, right?
- 45:00Yes, it is.
- 45:01Also, I didn't read about the rejection.
- 45:04So I have no idea why it was rejected.
- 45:07But I know that they always put a lot of thought on or into the rejection.
- 45:12So why they do that?
- 45:13I have to check that out.
- 45:14You know, you look at other ecosystems, other programming languages.
- 45:18They've got like five ways to do one thing.
- 45:20And they're just, it seems like it's just constantly being changed to just chase trends.
- 45:25And over the years, that becomes a real messy language and way to do things.
- 45:29So I really appreciate that Python says no often, but I will miss this feature, you know?
- 45:36I think it's also impressive how much work is put into these peps, how much work they do on like formulating their ideas and discussing it very thoroughly to get to a good result.
- 45:47Yeah.
- 45:48I'm very happy that they do that for Python.
- 45:50Me too.
- 45:50And I think another really interesting aspect is just so many people use it, right?
- 45:55There's so many edge cases or scenarios that don't necessarily, maybe this breaks that I don't know about.
- 46:00Let me pose a question from the audience here from demystifying dev says, newbie question.
- 46:06If pip freeze outputs a perfectly usable requirements.txt file, if you want, can't that be used?
- 46:11What's lacking?
- 46:11Why are these other tools?
- 46:12I think honestly, the reason I bring this up is this kind of like, is it almost like, why do all these tools exist, right?
- 46:18It really is at the heart of your whole article or talk.
- 46:20Especially now, this is just one of the use cases, right?
- 46:24Many of the tools do lots of other things as well.
- 46:26I think that's why a lot of them exist, especially on packaging, such that you do not have to use a one tool or several tools for all the different steps.
- 46:35I still know people which use requirements.txt files.
- 46:40So I do think it can be useful, especially if you do not work with packaging.
- 46:46So if you don't want to create a package and piproject.toml puts or adds another level of complexity, which you don't use, then I don't think you have to use it.
- 46:59I guess that's really specific for your use case.
- 47:02But if you have a package and you have all this other information that you need to publish with it, then it's nice to have this one single file with everything.
- 47:12Also with the dependencies and not have many different files for different things.
- 47:16I agree.
- 47:17I think another aspect of this is this totally works well, but a lot of it's manual, right?
- 47:23So I could pip install a thing and it works.
- 47:26But then if I forget to go and put it into the requirements.txt, well, that was a manual step that I needed to remember.
- 47:32Or I put it in there, but I forgot to pin it.
- 47:35You run into the problem that I ran into earlier, right?
- 47:38With SQLAlchemy changing.
- 47:39And with the other tools, they just, that's their flow, right?
- 47:42You say poetry, add, whatever.
- 47:45It puts it into the requirements file.
- 47:48It puts it into the lock file, right?
- 47:50It installs it.
- 47:51All of those things are kind of taken care of for you.
- 47:54So I think part of it is that they, the tools kind of do the recommended workflow for you rather than you having to remember to do it.
- 48:02That's a very good point.
- 48:03And it also allows you to make less mistakes with your project.
- 48:08Yeah.
- 48:08You don't even have to really be aware of that.
- 48:10As a newbie, you just say, well, I know I say, hatch, add a thing.
- 48:14And then it works, right?
- 48:16I don't have to know, well, here's why you use the hash and here's why you pin the dependency.
- 48:21It just, it just does.
- 48:22You do give a mention to pip-tools here at the end.
- 48:25If you go the requirements.txt file way, which actually, honestly, the thing I'm using these days is pip-tools.
- 48:32It lets you create a file and then it creates this requirement, kind of like pip freeze.
- 48:37It creates this requirements.txt, but it also lets you evolve that over time.
- 48:41Like you can say, I want to upgrade my thing.
- 48:44So if I'm using FastAPI and I say pip install --upgrade FastAPI, it'll upgrade FastAPI, but not the things like Starlette that FastAPI uses.
- 48:54Right.
- 48:54And that's another reason to not do that more manual process that we were just talking about.
- 48:59Cause it, how do you make sure you update all of the things in a coherent way?
- 49:03Right.
- 49:04That's very, very tricky.
- 49:05So you can still do it, but you, I, even if you do that, I think you got to use something like pip-tools or some other higher order, higher order.
- 49:11thing there.
- 49:12Yeah.
- 49:12I can also understand that it's sometimes it can be frustrating in the beginning.
- 49:17If you have to look into another tool to do what you want to do, if there's the simple hacky way to do it.
- 49:23But if you think in the long run, and also if you work on bigger projects, it's always a good idea to get used to these tools in the beginning, since they save you a lot of work and also save you from doing mistakes that you then have to debug, which is annoying.
- 49:40When you're working by yourself.
- 49:41When you're working by yourself, you know, YOLO, you get to do whatever you want.
- 49:44But like you working in a team, using something like Hatch means everybody does the same thing.
- 49:49And that's actually really important too.
- 49:51Rai uses pip-tools as well.
- 49:53Let's close out our conversation here with Rai because it's different in the way that it's philosophy on how it works for package management, right?
- 50:02If you want to understand Rai, you have to know about Rust, which is a very popular programming language at the moment.
- 50:08And Rust has a very nice setup of how packaging works, since you have two tools, namely RustUp and Cargo, which do everything.
- 50:17You do not have these different tools for different steps and everyone can contribute their own tool and gets really messy and hard to understand as it is for Python.
- 50:27But it is very simple and easy to use.
- 50:30And the author of Rai wrote Rai completely in Rust and was inspired by RustUp and Cargo.
- 50:37And Rai is also a tool that can do everything.
- 50:40It also is doing Python version management for you, which I guess is easier since it is not written in Python.
- 50:46And yeah, it's a tool that can do it all.
- 50:50It was started as a personal project, but there are new versions released, I guess, weekly.
- 50:57Like when I last checked it, it was moving really, really fast.
- 51:01And the author is also the creator of Flask.
- 51:03So he's, I guess, very well known.
- 51:06And that's also why people are adopting Rai very quickly.
- 51:09Yeah.
- 51:10So I think it's a very nice or interesting addition to the whole mix.
- 51:14I think it is as well.
- 51:16The most unusual thing, the reason I said it's unlike all of the others, the way that I use PipX is I somehow say Python or I say somehow pip install PipX and then I can use PipX.
- 51:30Or I somehow Python-M pip install Hatch and then I can use Hatch for more Python stuff.
- 51:37But all of those things start with Python, some version of Python, and then I can do more Python things with them.
- 51:44Whereas rustup in that world and Rai in the Python world, it says you have nothing.
- 51:51You don't even have Python.
- 51:52You ask for a version of Python and then you ask for environments, then you ask for dependencies.
- 51:57And so it has all the flexibility.
- 52:00It wants to do whatever it needs because it doesn't actually depend on you even having Python, much less the right version of Python.
- 52:06Yeah.
- 52:06Exactly.
- 52:07You think that's going to be a trend?
- 52:08Do you think we're headed that way?
- 52:09Wow, that's hard to answer.
- 52:11I'm actually not sure.
- 52:12I think it would be nice.
- 52:14I would really like having a tool that can do everything and get rid of this clutter.
- 52:19Also, since I like everything to be organized and it can be really confusing.
- 52:24And I know that most people are just complaining about packaging in Python.
- 52:28But I know that also it's just difficult to get to the state where you have this one tool.
- 52:35I remember that discussion from your podcast with the packaging panel.
- 52:38It's not that people do not want to have this tool.
- 52:41There are reasons that it's so hard to do it.
- 52:45It's hard to get everybody to agree, switch over to this thing.
- 52:48Whereas I think Rust was more built from scratch or designed from scratch to have it.
- 52:54And that's an advantage Rust has existing, getting created when it did more recently.
- 52:59Python came out when we had Usenet, maybe, right?
- 53:03Like certainly the ubiquity of the internet wasn't there.
- 53:07And we just didn't.
- 53:07Downloading stuff off the internet everywhere, just on your command prompt or whatever it was
- 53:12at the time.
- 53:13It's just not a thing.
- 53:14So it's timing.
- 53:15And it's good that newer languages learn from the mistakes of previous ones.
- 53:20We probably will end up with something like Rye, but maybe people got to agree on it.
- 53:24That's tough.
- 53:25I guess one really quick thing to close out this whole section, a main topic is Tony out
- 53:30in the audience asks, I'm working on a large Python monorepo.
- 53:33So we have all kinds of dependency conflicts and resolutions we have to deal with.
- 53:38Maybe just worth pointing out that the multiple environments that Hatch has might address that.
- 53:44What do you think?
- 53:45Also in my project right now, we have a huge monorepo, but the different folders also correspond
- 53:52often to different packages.
- 53:53So they have their own PyProject.toml file.
- 53:56So you can keep the dependencies like organized.
- 54:00But if you have lots of dependencies that are for specific things and they are not necessarily
- 54:07related to what you're doing in a different step, then that can be very useful.
- 54:12The Hatch functionality where you can define virtual environments with only the dependencies
- 54:18that you need for the specific task, like creating the documentation or checking style things.
- 54:25Excellent.
- 54:25All right.
- 54:26Well, you can see there are many more tabs on my web browser of things I would like to
- 54:30bring up and chat with you about on this topic.
- 54:32But at the same time, we are out of time and it's getting late for there in Germany.
- 54:37So maybe we'll call it a wrap here.
- 54:41But before we get out of here, how about a recommendation for a Python package or project
- 54:46that you think is cool?
- 54:47I thought about this since there are lots of people who always suggest so many nice packages.
- 54:52But what I'm really using a lot is MkDocs material for building documentation without a lot of work.
- 54:59I've just did that today since especially if you work on a project with like, which is difficult
- 55:06to explain to other people and you want to have one place and not use Confluence or other tools
- 55:13for documentation.
- 55:14This is a very nice tool to use.
- 55:16Yeah, it looks great.
- 55:17And more than a static site, it says, sets up search and all kinds of cool things for it.
- 55:22And it's very easy to use.
- 55:24I think even for beginners, that is a very easy way to set up a nice documentation for your package,
- 55:30which you can build now with one of the tools we discussed.
- 55:34Yeah, absolutely.
- 55:35It is.
- 55:36Okay.
- 55:36Excellent presentation.
- 55:38I really like the way you put this all together.
- 55:40It's going to be super helpful for folks.
- 55:42So yeah, thanks.
- 55:44Final call action.
- 55:45People are interested in this.
- 55:46They want to learn more.
- 55:47Maybe they should check out your article, which we'll link to the two conference talks you gave.
- 55:52What else do you tell them?
- 55:53Actually, that's the best way to go.
- 55:55The other projects that we discussed on previous podcasts are also on my blog.
- 55:59And definitely check out my GitHub profile, I think.
- 56:02I have, for example, a repository on machine learning with machine learning tutorials, which is really popular.
- 56:09So if you like machine learning, that might be useful as well.
- 56:12We can link the GitHub repo, I guess.
- 56:14Yeah, absolutely.
- 56:15I'll put it in the show notes.
- 56:16Anna Lena, thank you for being here.
- 56:18It's always nice to have you on the show.
- 56:19Thank you.
- 56:20Have a good day.
- 56:21This has been another episode of Talk Python To Me.
- 56:24Thank you to our sponsors.
- 56:26Be sure to check out what they're offering.
- 56:28It really helps support the show.
- 56:29When it comes to artificial intelligence, AI, what's good for trillion-dollar companies, isn't necessarily good for people.
- 56:37That's the theme of Season 7 of IRL, Mozilla's multi-award-winning podcast, hosted by Bridget Todd.
- 56:43Season 7 is all about putting people over profit in AI.
- 56:46Check them out and listen to an episode at talkpython.fm/IRL.
- 56:51Sentry.
- 56:53They have a special live event, like a mini-online conference, where you can connect with the team and take a deep dive into different products and services every day for a week.
- 57:02Join them for launch week, new product releases, exclusive demos, and discussions with experts from their community on the latest with Sentry.
- 57:10You'll see how Sentry's latest product updates can make your work life easier.
- 57:15Visit talkpython.fm/sentry-launch-week to register for free.
- 57:20Want to level up your Python?
- 57:22We have one of the largest catalogs of Python video courses over at Talk Python.
- 57:26Our content ranges from true beginners to deeply advanced topics like memory and async.
- 57:31And best of all, there's not a subscription in sight.
- 57:34Check it out for yourself at training.talkpython.fm.
- 57:37Be sure to subscribe to the show, open your favorite podcast app, and search for Python.
- 57:42We should be right at the top.
- 57:43You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the direct RSS feed at /rss on talkpython.fm.
- 57:53We're live streaming most of our recordings these days.
- 57:56If you want to be part of the show and have your comments featured on the air, be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
- 58:04This is your host, Michael Kennedy.
- 58:05Thanks so much for listening.
- 58:07I really appreciate it.
- 58:08Now get out there and write some Python code.
- 58:10I'll see you next time.
- 58:10Bye.
- 58:11Bye.
- 58:12Bye.
- 58:13Bye.
- 58:14Bye.
- 58:14Bye.
- 58:14Bye.
- 58:15Bye.
- 58:15Bye.
- 58:15Bye.
- 58:15Bye.
- 58:15Bye.
- 58:15Bye.
- 58:15Bye.
- 58:16Bye.
- 58:17Bye.
- 58:17Bye.
- 58:17Bye.
- 58:17Bye.
- 58:17Bye.
- 58:17Bye.
- 58:18Bye.
- 58:18Bye.
- 58:19Bye.
- 58:19Bye.
- 58:20Bye.
- 58:21Bye.
- 58:21Bye.
- 58:22Bye.
- 58:23Bye.
- 58:23Bye.
- 58:24Bye.
- 58:25Bye.
- 58:26you
- 58:27you
- 58:27you
- 58:28you
- 58:28Thank you.