Coding 2022-12-21
I was thinking about working on MOTR, and I realized that, before I do anything else, I want to audit my dependencies to check for urgent updates. I know Trio has some stuff coming down the pipe that I need to be ready for. And I can make some improvements to how I'm requiring Cement if I use a newer version. Here are MOTR's direct dependencies, and notes on them:
- attrs: has a new interface that I would like to switch to at some point.
- blessed: It looks like nothing breaking is happening. I'll have to revisit it when I look at some issues with the templates.
- cement: newer versions provide a nicer way to pull in the following dependencies:
- colorlog
- jinja2
- pyyaml: I want to figure out what it takes to drop this dependency, because it's for reading configuration files, and I don't... I'm not... You can't fit a motrfile in yaml.
- pyrsistent: I think I want to cut down on the usage of this slightly, because I'm fairly sure I'm not playing to the strengths of PVector or PSet.
- tqdm: I have some ideas for trying to make the progress bar a little nicer, but I'm going to hold off on trying them out for now.
- trio: Some of the interfaces I'm using are changing, and also there are some interactions with Cement that I want to address.
- virtualenv
- wheel-filename
Let's have a quick look at the Trio changes.
The upcoming change is to trio.MultiError creation, or lack thereof. In order to handle everything properly, I need to:
- add strict_exception_groups=True to the trio.run call
- replace the contextlib.suppress(_exc.MOTRTaskError) with, um, exceptiongroup.catch({_exc.MOTRTaskError: noop}), or something?
- Figure out what Cement does when it gets a BaseExceptionGroup
- Fix any tests that this breaks. Like, can I write catch handlers that will preferentially reraise any error besides the expected one, and reraise the expected error type if there are no others? Is pytest getting changes to handle exception groups? I don't think these off-the-cuff ideas are quite enough...
The other Trio-related change I want to make is to stop telling Cement to handle SIGINT. This requires getting a small number of changes just right, which shouldn't be hard, but it took a bunch of effort to verify that this was the case. And I'm still not totally sure.
Anyway, I'll look into making those changes later. For now, I should wind down.
Good night.