March 27, 2025
Pixi Workflows
Felipe Fernandes, SECOORA/IOOS, Research Software Engineer
Run time: 35:22
00:00:00:00 - 00:00:17:23
Matt Biddle
So hi everybody! Welcome to — what month are we in — March! The March IOOS DMAC tech webinar. I'm Mathew Biddle. I'm part of the IOOS DMAC team in addition to Micah and Laura on helping to coordinate these meetings,
00:00:18:00 - 00:00:42:01
Matt Biddle
and today we have a great presentation from Filipe Fernandes on the tool pixi. But first and foremost, I want to give a little bit of background about the DMAC tech webinars. These are monthly opportunities for you all, the community, to come together and discuss topics related to data management, cyberinfrastructure, approaches within the regions, within projects and partners of the IOOS community,
00:00:42:03 - 00:01:00:11
Matt Biddle
but the topics can be ranged from technical — really diving into the details some of the stuff that Filipe is gonna talk about — but also going into reviewing data and metadata standards or review of something that might be of interest to the rest of the community. So I say that because feel free to propose a topic and bring it in.
00:01:00:13 - 00:01:24:19
Matt Biddle
We do have open slots later on in the year, and you're more than welcome to come in and talk about a DMAC topic of interest if you have any. I do have a couple of announcements — or actually I have one big announcement — is the registration is open for the 2025 IOOS DMAC Annual Meeting that is scheduled for Tuesday, April 29th through Thursday, May 1st in Silver Spring, Maryland.
00:01:24:21 - 00:01:43:24
Matt Biddle
We are still going. We are still planning. We are still pushing forward with that, and registration will close April 24th. If anything changes, we will make sure we let everybody know if, what the changes will be, but for now we're moving forward with a hybrid event from April 29th to May 1st,
00:01:44:01 - 00:02:19:11
Matt Biddle
and we hope to see you there. With that, that's all the announcements and introductory stuff I have to give. So we'll dive into Filipe Fernandes is here to talk about the the pixi tool — the pixi package. Pixi package? Pixi, I'll just say that because I don't know much about it. and I've heard this thing mentioned a couple different times and I thought this would be really interesting for the community to hear about what it is and how you might be able to work with it in your environments.
00:02:19:13 - 00:02:29:21
Matt Biddle
So Filipe Fernandes is a research software engineer for SECOORA/IOOS and he's here to give us a little introduction into this new cool tool. So I'll let Filipe take it from here.
00:02:29:23 - 00:02:37:03
Felipe Fernandes
Alright, thank you Matt for the introduction. Thank you for having me. If you're not hearing me or if you have any questions, feel free to interrupt.
00:02:37:05 - 00:03:02:03
Felipe Fernandes
This is gonna be a very easy going presentation, and I am sorry for the emphasis on the tech in the DMAC tech webinar because this is kind of a boring topic. But hopefully everybody will take something from it. Alright, so pixi workflows. For those who don't know this meme — it's dangerous to go alone, take this. It's a meme that comes from video games where a very bad translation from the Japanese,
00:03:02:03 - 00:03:20:21
Felipe Fernandes
the guy said that it’s dangerous to go alone and gives you a sword instead of offering to go with you. I'm offering you a tool, pixi, but I'm also offering to go with you. If you have any questions, feel free to ask me on Slack later, later on this presentation, or via email or via the IOOS tech mailing list.
00:03:20:23 - 00:03:28:03
Felipe Fernandes
So I'm not gonna abandon you with a tool. I'm here to answer any questions now or later.
00:03:28:05 - 00:03:52:12
Felipe Fernandes
Alright, so before we start, why another package manager? We have tons of package managers, right? We have the system ones that's in our systems. Brew for those who use Mac, choco for those who use Windows, APT for those who use dev-based distributions like Ubuntu, yum for those that use Fedora based distributions like Headhat, zypper for those very cultural people who use open source of Linux,
00:03:52:14 - 00:04:13:21
Felipe Fernandes
and I know that at least one of you out there is very cultural and does that. That was actually my first contribution to the packaging world. Then there’s the language specific ones like pip and uv that installs Python only, conan that installs C packages only, cargo that installs rost packages only, NPM control stuff and all that.
00:04:13:23 - 00:04:34:03
Felipe Fernandes
And then there is the system and language agnostic ones. So we’ll start getting in a realm where I can use a single package manager to install whatever I want, anywhere I want. Like conda, mamba, and micromamba are probably the most famous ones for this community. They're all in a way the same. Although I'm committing a crime by saying that,
00:04:34:03 - 00:04:59:03
Felipe Fernandes
but for users’ purposes, they are the same. In a respect that’s heavily used on the supercomputing world, brew can be that if you know how to use it, it's not only for Macs actually. And then there is nix, which is great, has great potential, but it's super hard to use. So it doesn't have a good adoption and doesn't work on Windows as far as I know.
00:04:59:05 - 00:05:43:17
Felipe Fernandes
Okay, so what is the project first? Ok, well, let me take a step back. So here's the thing. Why is pixi different from all those? It's project environment first, right? So conda, mamba, and pip require you to specifically name and locate dependency environments. Most language-specific package manners are project-centric. Like Python has explored this a little bit with poetry, PDM, Rye, and now UV, but it's still not something that's mainstream, especially for this community because a lot of us migrated from matlab, where we had like a kitchen sink-environment where it had everything on our path and had everything working, right? And we didn't want to mess with it because, if we installed something that broke our
00:05:43:17 - 00:06:05:20
Felipe Fernandes
environment, we couldn't do our research. So as we evolve, we’ll hopefully try to get things more contained in environments and projects. And Python is slowly moving into that direction. I was talking with Laura here and she's an R user — like before we logged in. R actually was like that from day one because R was created by scientists who were very worried about reproducibility.
00:06:05:22 - 00:06:32:01
Felipe Fernandes
So in a way, R always had that. In the Python world, it was hard to have that. We had it, but you really need to be in the know to use it properly. So what else can I say about this? So if a package manager takes more roles on managing your environment, managing the dependencies and recording indirect and direct dependencies for you, linking the correct Python environment and running additional tasks for you.
00:06:32:03 - 00:06:50:18
Felipe Fernandes
So in a way your package manager becomes more than just a package manager, right? Just managing your whole project, your own environment, and if there are other R users here, you know what I'm talking about when you create a project and R studio is exactly that, right? Okay, but is pixi just another toy that we’re gonna toss away when the next toy shows up?
00:06:50:18 - 00:07:10:03
Felipe Fernandes
The Python world is full of package managers, like popping up all the time. That old joke about data science and Pokemon, I’ll be doing Python with Python package managers and Pokemon. Like, is this a Pokemon or a Python package manager? I assure you, pixi is not a Pokemon, it's actually a Python package manager.
00:07:10:05 - 00:07:38:06
Felipe Fernandes
So why use pixi? Pixi installs conda and PyPI packages. For those who don't know the difference, conda is Python agnostic. It's not a Python package manager. It installs everything that you need from any language, from Java, JavaScript to Python, rost, C, C++, and et cetera, Fortran. And PyPI is Python only, right? So conda can be both, even though it's python agnostic, it's Python centric, right?
00:07:38:06 - 00:08:02:14
Felipe Fernandes
Because the Python community adopted it. For pixi, everything is a project, any environment. There is NO matlab kitchen sink-like environment. You can't really do like one thing to have all your stuff in it because that's fun to break, and it's usually not recommended. And it doesn’t require a Python environment to install it because you can usually break your environment when you do that.
00:08:02:16 - 00:08:23:18
Felipe Fernandes
Raise your hands here if you never broke your own conda or miniconda installation because of that? Yeah. So, and because of that, it’s focused on reproducibility, repeatability, and portability. And it's super fast. By the way, all these slides that I'm stumbling a little bit to say — they are great, but they are not mine. They are a great contribution by Alex Kerney.
00:08:23:18 - 00:08:48:09
Felipe Fernandes
Thank you, Alex. I'm stumbling because I read them, I was ready for them, and then I, for some reason, I forgot what to say there. So what is a pixi workflow? Well, the actual question should be what is your workflow, right? And say you need to download data from a server, create some metrics, and publish it on a webpage,
00:08:48:12 - 00:09:14:23
Felipe Fernandes
right? So let's do exactly that. So it's demonstration time. It's safe and scripted. Here is my script. I'm not sure if you can see me, but if anything goes wrong, you have a link and the link has everything that I was trying to say here. Let me switch to the terminal. So I have a folder with a notebook that's called gliders of the day.
00:09:15:00 - 00:09:38:06
Felipe Fernandes
We can inspect that notebook on my terminal here, and you can see that it imports a few libraries, hits a server, gets all the gliders from the last day, then requests the tracks, and after it makes that request, tries to plot a map. Pretty simple, right? And let's say I want to publish that as a zipping map on the web.
00:09:38:10 - 00:10:11:12
Felipe Fernandes
So every day you check that webpage has the gliders that deployed that day, right? So the notebook is working. How can I make that — oh, iless is a Python notebook class, or more, which is just a function that calls and converts to markdown and then colorize it and output it to less. I can copy that to you later if you want to add that to your bash. And please ask questions as we go because I tend to speak super fast. So if you interrupt me,
00:10:11:12 - 00:10:35:04
Felipe Fernandes
it's actually good. It gives me time to think where we will go next. So, ok, you all have a similar notebook, right? That gets data, does something with the data and wants to publish something, either a page, metrics, a graph, whatever, right? So, how can we make this a workflow? The first thing we need to do is create an environment to run that.
00:10:35:04 - 00:10:56:19
Felipe Fernandes
Remember I said no kitchen sink environment. I'm not gonna call my IOOS environment and run it. We are gonna create a specific environment for this. So I need to run something to inspect the dependencies on the notebook. And I'm gonna use pixi for that. I'm gonna actually use pixi global to install a dependency
00:10:56:19 - 00:11:20:21
Felipe Fernandes
called depfinder, which is a dependency finder. And what is pixi global? So it's probably the first feature of pixi that I want to demonstrate. It puts the package on your main path. So now I can call that finder from wherever I am, and it's great for things like that — command line things that you want to have always have available independent of an environment, independent of what you’re gonna do.
00:11:20:23 - 00:11:41:16
Felipe Fernandes
So now I can call depfinder on glider of the day. I think my fonts are too big and probably wrapping around here, but that's fine. All I'm doing is calling depfinder on that notebook. And depfinder gives me this beautiful output, where it tells me the built-in that I'm using, so those are not my dependencies,
00:11:41:16 - 00:12:02:01
Felipe Fernandes
and there's the ones that are required. So I'm using erddapy, folium, httpx, pandas, and stamina. So that's the ones that I need to have in my environment. Pixi is great because it tries to mimic commands that are already in our mind. So we use Git. Git init to start a project, pixi init to start a pixi project.
00:12:02:03 - 00:12:28:17
Felipe Fernandes
If I do pixi init, it created for me the project. The only things that it added was the pixi.toml file. Ignore this one, these are my notes, and it also created something that it needs to work on with Git. Let's not delve into those right now, but what is this pixi.toml file? What do we have there? So pretty much — metadata on our project.
00:12:28:19 - 00:12:53:07
Felipe Fernandes
The authors, it got my name based on Git because I'm on a git inited folder. So it's smart enough to read that. If you didn't know, I could just come here and type it. The changes where I'm getting my packages I could have a description of the project here, a name of the project, in this case it’s just a folder, the platforms where I'm deploying the project, and the project version.
00:12:53:09 - 00:13:22:08
Felipe Fernandes
There are also two empty spaces here, tasks and dependencies. We already know our own dependencies, right? These ones. So let's add those dependencies. How do we add the dependencies to our project? Pixi add. Just removing commas and asterisks. And I'm adding all those dependencies in a single go. And if you're reading my terminal, you see that's creating an environment, but it's also locking that environment,
00:13:22:10 - 00:13:43:24
Felipe Fernandes
and it just added for me based on the latest release and pinned to a major release to avoid breakages because it's thinking that this is an app — not really a software per se — and it's always nice to pin your apps. It's super quick because it uses an under the hood library within rost that's super fast.
00:13:44:01 - 00:14:05:01
Felipe Fernandes
Even for conda, it's super fast, and if you're not using conda packages, if you’re using only PyPI packets, you use UV under the hood, which is pretty much the same kind of server, but for PyPI packages only. Also I have just a few packages, so it was gonna be fast anyway. Even if I used bit, not super fast, but it was gonna be fast.
00:14:05:03 - 00:14:31:12
Felipe Fernandes
So let's check how our pixi.toml again. You see the dependency field is now populated. Right. So far, so good. I use pixi global to inspect my notebook. I use pixi init to create my projects. I use pixi add to add extras to my project, and let's say that I want to run this notebook the old fashioned way, like we do with a conda environment.
00:14:31:14 - 00:14:57:08
Felipe Fernandes
How can I activate this? Well, pixi doesn't really have the concept of activating, but you can enter its pixi shell, which is kind of a call to activate, which can be used for debugging. And I can here call my Jupyter notebook and run it. And oops, I don't have Jupyter notebook on that environment. So I can just exit my pixi shell
00:14:57:10 - 00:15:25:06
Felipe Fernandes
and add it, and that's it. Like it's gonna resolve everything super fast and it's gonna add to my project. You can see that I just added nbclassic. I'm old, I don't use Jupyter Lab. I use the old one. And I have this new file here, the pixi.lock. Let's inspect it a little bit. The pixi.lock is the lock file.
00:15:25:08 - 00:15:48:06
Felipe Fernandes
It has your environment, the URL that the packages are coming from, the platforms, and all the packages that you're using. The beauty about the lock file is that it's hashed based on the package URL. So if I send this to any one of you and I ask you to reproduce the environment, you have exactly the same environment that I have.
00:15:48:08 - 00:16:09:20
Felipe Fernandes
So it's great for reproducibility. Also, if you're deploying, if you're solving from the lock file instead of solving from the pixi.toml, it's super fast because there is no server actually involved. You just download those files. You just download those packages because it's already solved, it's pre-solved. Another great advantage of lock files is pixi relocks
00:16:09:20 - 00:16:30:08
Felipe Fernandes
every time you add a new dependency. So say we're working on our project together, say me, Matt, and Micah. You're doing something, and then Matt adds a new dependency and it runs on his machine, and then I try to run it. I can solve it because the dependency he added doesn't work on Linux, and he did it only on Windows for some reason, right?
00:16:30:10 - 00:16:49:19
Felipe Fernandes
If we had a pixi project, as soon as he added it, pixi was gonna solve it, and it was gonna crash on his machine before he sent it to us. So it kind of reduces the work on my machine phrase, which I say that a lot because it's usually reverse. I do that on Linux, it works, and then I send it someone on Windows and it breaks.
00:16:49:21 - 00:17:15:07
Felipe Fernandes
But then comes the question, how can I add more platforms to my pixi file? So here's how you do that. I'm gonna open my pixi.toml file and I have here the platforms, and now let's say I know someone in my group works on Windows,
00:17:15:09 - 00:17:54:23
Felipe Fernandes
someone works on Mac OS, and most people nowadays have the brand new Mac OS 64. I don't remember OSXarm64, I guess. Yeah, for the M1, M2 chips. I think I got it right, but that's why I have my notes. Yes, I got it right. So let's try to resolve it, and one way of resolving is to ask for the list of packages.
00:17:55:03 - 00:18:19:14
Felipe Fernandes
And you see, it's now solving for all the platforms that didn't solve before. It's not resolving Linux because it's already solved, but it's solving for the other ones. And now my lock file is much bigger because it has all those platforms in it, which means that if I keep adding packages, I will know that I broke something on Windows, or Mac, or the new Mac before I send it to anyone,
00:18:19:16 - 00:18:51:12
Felipe Fernandes
right? I can't track any questions on the chat, but if anyone sees anything that's worth commenting, please stop me and we can do that. Alrighty, so now let's try the pixi shell again. This is like the code activation. Let's try to call the notebook again, and let's open up this notebook.
00:18:51:14 - 00:19:17:05
Felipe Fernandes
So there you have it. This is pretty much like a conda-like environment, right? This is using pixi as a miniconda or anything, but we want more from pixi, right? It's managing all our dependencies. It’s managing our lock file. It's managing the project metadata. So it's managing a lot for us right now. If you're doing this with any other package manager, it’s gonna be a little bit harder because you need more tools. Like say if you’re using conda, you need conda-lock which is a separate tool.
00:19:17:11 - 00:19:43:00
Felipe Fernandes
If I manage a project, most people have their own way. They have a readme or something instead of like the pixi.toml and all that. So it's aggregating things to make the user experience a little bit better. But now, say I want even better, because I want to run this notebook automatically on a GitHub action CI or any CI environment,
00:19:43:02 - 00:20:04:18
Felipe Fernandes
and I want pixi to manage that for me. Like to run that task, just save that HTML file and to publish that file. How can I do that? Remember when I said we have this task field here that's empty? So I'm gonna cheat here. I'm gonna open my notes, and I'm gonna copy the tasks from here,
00:20:04:18 - 00:20:14:10
Felipe Fernandes
and I'm gonna explain those to you as I type them in the new one.
00:20:14:12 - 00:20:40:05
Felipe Fernandes
I always forget that my cat has lines so I need to remove the lines. Ok, so my first task, I called it map. It calls Jupyter nbconverts to notebook, execute that notebook, and saves an output. So it's pretty much a trick to run the notebook for me using nbconvert. My second task is called serve, and this one depends on map.
00:20:40:07 - 00:21:03:10
Felipe Fernandes
So if I call this task, it's gonna run map first, and then it's gonna enter this directory and serve whatever is in that directory, which is my map, my HTML map. And then I can have other tests, like initialize an email server. I don't have a specific task for this because it is super hard to initialize an email server in Python3.
00:21:03:12 - 00:21:25:02
Felipe Fernandes
But then I can have another task that depends on email_server that sends me an email when the task completes. So you're starting to see task dependency. So pixi can work as a makefile, right? Like, you create one task — download data. Another task — create a plot. Another task — publish plots to that page.
00:21:25:04 - 00:21:49:07
Felipe Fernandes
And then the last task depends on the other tasks, and you run just that one, and everything runs in sequence. So let's try that out. Let's see how that works. So pixi run serve, right? This should run map as well. And there you go, it's running the notebook, it's saving the map, and then it should serve the map on a webpage.
00:21:49:09 - 00:22:00:07
Felipe Fernandes
This is gonna take a while if our ERDDAP server's not broken. So it's a good time for questions.
00:22:00:09 - 00:22:15:13
Matt Biddle
I see Alex has a couple of comments in the chat about just command line ways to add platforms into the toml file as well as some info about the pixi shell.
00:22:15:15 - 00:22:29:07
Felipe Fernandes
By the way, Alex is a pixi expert. The only reason I'm presenting this here is because he refused it, it should be him. He even has full requests adding a super nice feature to pixi that's called pixi tree that we're gonna demonstrate later.
00:22:29:09 - 00:22:32:20
Felipe Fernandes
It's his work.
00:22:32:22 - 00:22:36:10
Felipe Fernandes
Sorry for calling you out like that, Alex. So, alright.
00:22:36:10 - 00:22:55:21
MIcah Wengren
Filipe, I was just going to ask quickly. So the platform, I forget what the term was, but the different installation environments, that’s something that's not possible with conda? Like sort of pre-creating the lock file for different platforms?
00:22:55:23 - 00:23:04:12
Felipe Fernandes
It is, but you need another software, you need conda-lock, right? In pixi, it's one experience, one thing.
00:23:04:14 - 00:23:21:21
Felipe Fernandes
That's the beauty of it. It's integrating all the things into one single software, single user experience. It makes things easier. It forces you to do the right thing from the get go, right? In conda, I can introduce you to conda, and then I have to teach you conda-lock, and then I have to teach you how conda-lock interacts with conda.
00:23:21:23 - 00:23:56:13
Felipe Fernandes
Like these are all separate software, separate packages. By the way, I'm one of the creators of conda-lock and I no longer advocate for conda-lock use. I advocate for pixi use. So this is the serve thing. It creates a map and it's serving it. And you can just see the past 15 days of gliders. It has like the start, the end, oh, this one…hasn’t been updated for a while. And you can see like the TS diagram if the server is nice to us, and there you go.
00:23:56:15 - 00:24:27:00
Felipe Fernandes
So alright, let me take a step back. Let me go back here, break the server, and ok. And last demonstration, let's go back to our presentation. So I have a spoiler here. Suppose you are a hardcore conda fan and you have environment.yml files everywhere. How can I start pixi? You don't have to do all that that I just did.
00:24:27:00 - 00:24:40:03
Felipe Fernandes
You can just import your environment, and it's gonna create for you a pixi.toml project based on the environment.yml file. So it's a nice way of just moving over, right?
00:24:40:05 - 00:25:03:08
Felipe Fernandes
So quick review, we have pixi global to install packages in a global space, which is a great option for command line tools. When you want to use that, something like depfinder, or say you want NCTF from NCO on your terminal all the time to inspect netCDF files, or netCDF, or any other command line tool that you want to create, right? That you want to put in there.
00:25:03:14 - 00:25:28:13
Felipe Fernandes
I have a few I have like the GitHub actions inspection. I have the GitHub CLI. I have depfinder and others. It's an easy way to standardize your command line tools throughout many computers, for example. Instead of installing them on Windows, Mac and Linux, I can install them with pixi on all the machines that I have. Even different Linux machines.
00:25:28:15 - 00:25:48:10
Felipe Fernandes
Quick review on the pixel.toml config. The project’s pretty much metadata, so project description, authors, and all that. Then we have the tasks and the dependencies. The task and the dependencies is the meat of pixi here.
00:25:48:12 - 00:25:54:19
Matt Biddle
I had a quick question. With tasks, can you run like cron jobs in there?
00:25:54:21 - 00:26:14:01
Felipe Fernandes
You should set up the cron jobs separate, like you create a path, and then you set up a GitHub action in a cron job. I have that gliders of the day in a cron job that runs everyday, for example. If you did that in the pixi.toml file, you need some sort of time on to keep reading it and running it,
00:26:14:01 - 00:26:31:00
Felipe Fernandes
right? So this is one of the things that maybe you should not integrate in the project because there are so many ways of doing it, that it’s better to leave you to your own devices, like do whatever you wanna do. Say you don't use GitHub and you don’t use GitHub actions. You want to use GitLab and whatever GitLab has that’s similar, right?
00:26:31:02 - 00:26:52:18
Felipe Fernandes
Or you want to run on a server using a cron job on the server, or something like that. But this is probably one of the only things that is not really worth integrating on pixi per se. But it's a great question. Yes. Ok, so you have the tasks that give you a makefile-like experience, and then you have the dependencies, and you have the lock file that's separate.
00:26:52:24 - 00:27:12:19
Felipe Fernandes
We have the pixi add that not only adds a package, but also resolves for you all the time you add something. So if something breaks, it breaks early, and it breaks on your hands, not on someone else's hands, which is great. Then we have the lock file that ensures you have the exact same version, same package, same hashed package,
00:27:12:19 - 00:27:35:13
Felipe Fernandes
in fact. For those who don't know a hash, it’s like a fingerprint, so it's the same package that I downloaded at this time that you're gonna have, and it can be configured across platforms. By the way, when we do cross-platform lock files, we are breaking the promise of reproducibility and repeatability and all that. Why?
00:27:35:15 - 00:27:59:12
Felipe Fernandes
Because it's impossible to have the same environment cross-platforms unless you use something like docker or like web assembly or something like that. But it's — how can I say — reproducible enough, right? It's close enough. It’s the next best thing that we have when you're working on people with multiple OSes.
00:27:59:14 - 00:28:22:24
Felipe Fernandes
So why are lock files important and why should the package manager be creating that? Because, in addition to the reproducability, it is what I've been saying all this time — it breaks early. Right? It breaks when you're trying to add something, it doesn't break after. It breaks on your computer; it doesn't break on production. So another review topic — pixi as a conda alternative.
00:28:22:24 - 00:28:41:13
Felipe Fernandes
So I said that you don't really have a conda-like environment or a matlab kitchen sink-like environment, but you can if you use pixi shell, you can create like a big environment with everything you have and do pixel shell to instantiate it. It was just not designed for that, but it works.
00:28:41:15 - 00:29:05:00
Felipe Fernandes
And then we have the tasks field where you can do pretty much any task with any software or command line that you envision, and you can create dependencies on tasks. One task runs after the other task ran successfully, and you can chain those as much as you can and then create an intricate graphs of tasks. Pretty much like you do when using any sort of makefile technology.
00:29:05:02 - 00:29:31:20
Felipe Fernandes
For those who are not familiar with makefile, it's a way of doing exactly that. Like you can have a task to build something, publish something, create a figure, clean them up, and all that. Alright, and now for something completely different. Using pixi for your actual python package, not an application or workflow and for GitHub actions. So let me get out of the full screen here, and I'm gonna open two pages here.
00:29:31:22 - 00:29:52:05
Felipe Fernandes
And I was very lazy and I did not create slides. I'm actually gonna take you to a real life example of that. So this may be a bit small. So this is an IOOS package that we have, and this is a very typical GitHub action. I did a tech webinar on GitHub actions some time ago.
00:29:52:05 - 00:30:21:10
Felipe Fernandes
I think they’re recorded, I'm not sure, but if they are not, you can ask me what they are. But it's a way of defining a task that’s run on GitHub. And the meat here is this. We have a pixi GitHub action that pretty much reads the toml file and does everything for you. In this case, the pyproject.toml file has the information of the pixi.toml file because this is applied to the project. It's a python package.
00:30:21:10 - 00:30:42:01
Felipe Fernandes
I can open that file later for you. And then, all the pixi goodies are available for me. Say I can run a task on a specific pixi environment, and this is gonna be clear when I open the project .toml and I can run the task tests. So I can run all my tasks for this package using pixi. It's solved,
00:30:42:06 - 00:30:52:00
Felipe Fernandes
it has multiple pythons, and all the information is on a Python project. So let's open this pyproject.toml,
00:30:52:02 - 00:31:22:24
Felipe Fernandes
and here we go. It's a very basic pyproject.toml up until the pixi field, and the pixi field is right here. It has virtually the same metadata as a pixi project. The platforms, the channels, the main difference here is pixi.environments. I can have more than one environment. In this case, the only environment I'm defining is different Python versions because I want to run the tests for all my Python versions, but I can have an environment to publish docs,
00:31:22:24 - 00:31:44:09
Felipe Fernandes
I could have an environment for tests, I could have an environment for expanded tests that takes longer, and all that. All those things that we do for any python package — I can do that with pixi as well. I can have pixi tasks the same way we have in pixi projects. I can have a task to install pre-commit, to run the pre-commits, to run the tasks, to run the docs, and all that.
00:31:44:11 - 00:32:07:20
Felipe Fernandes
Right? So it starts integrating all the things that we do with separate tools into one tool. And hopefully that's a little bit clearer and not as murky as when I started this talk. And the other example is this actual project that I sent showed to you — this glider of the day. And here, Matt, is how you're probably used to that,
00:32:07:20 - 00:32:29:10
Felipe Fernandes
you do that all the time. You schedule a cron job. You also want that on workflow dispatch all the time because if the cron job fails, you want to click and deploy it yourself. AI cannot do that for you. You need a human to click the button when things fail. So. Pretty much the standard things of any GitHub action,
00:32:29:10 - 00:32:55:14
Felipe Fernandes
and here's the difference: set up pixi, run the task. It's literally two lines on pixi is set up. It’s just that it knows about the environment here, it knows about the tasks here, and it's done. All right, let's go back to our slides. So some extra commands that I would like to show. This is just random comments that I put out there because I think they're important: info, tree,
00:32:55:16 - 00:33:24:19
Felipe Fernandes
and list. List, in a way, I already showed. And pixi info will give me information about the environment like what it’s doing and all that. It's pretty much reading the project.toml file for you. Pixi.tree is Alex’s contribution, and this one is great because, as you can see, on my tree, on the leftmost side — and let me go all the way up — is the direct dependencies, right?
00:33:24:19 - 00:33:51:11
Felipe Fernandes
I listed pandas and here's all pandas’ indirect dependencies, right? It’s bringing in numpy, numpy is bringing in libblas, and all that. And you can see, in a very detailed way, what your environment is doing, like what you were installing and what the environment requires to work. This makes debugging the environment super easy and much more intuitive, right? So, thanks Alex for that PR,
00:33:51:13 - 00:34:02:05
Felipe Fernandes
and I think up to this day it's one of the best non-pixi-led contributions to pixi so far.
00:34:02:07 - 00:34:20:11
Felipe Fernandes
Alright, and then there is pixi update. What pixi update does is updates the environment. In this case, no new package was released during the beginning of my project and as I type this. But suppose if I do this update tomorrow, there is a big chance of a new package showing up, so it's gonna relock for me.
00:34:20:17 - 00:34:33:05
Felipe Fernandes
It's gonna get all the metadata and relock it. And the last one was, oh, list, that I already did.
00:34:33:07 - 00:34:58:08
Felipe Fernandes
Okay, so I say this to everybody, you can watch this video, you can ask me questions, you can ask an AI or stack overflow, but if you really want to understand pixi, read the docs. Their docs are great. Their docs are super intuitive. They love feedback. Also, if you find some problem with the docs or anything, give them feedback on how to improve them. And it’s not
00:34:58:10 - 00:35:21:21
Felipe Fernandes
an unpleasant experience because hopefully everybody will take something from this. Like if you're managing a data pipeline, if you’re managing the deployment of an app, if you’re managing a Python package, this is useful for you in a way. And last but not least, questions. So this cartoon is not that important to the talk. I just think that it’s nice for us to chill out sometimes and enjoy the sun.