Using rix/nix on Debian Bookworm

Clocks From Pexels Castorly Stock

Now, I’ve been asked to make a course work with Python, not just R.

I’ve decided:

(a) Configuration management: conda (specifically the environment.yml) file serves a similar purpose to the renv lockfile renv.lockfile; actually the conda tools are broader as I can even install external packages such as quarto through conda. I found it quite hard to install this in nix; I’ll comment on that later. (b) The python doit pydoit.org seems to offer a lightweight “internal” pipeline management (c) pytestis obviously a good alternative to testthat. To be completely honest, I much prefer pytest; there are a lot of opinionated choices built into the R ecosystem, in this case the belief that you should always be building a package and this is the best way to do anything. Curiously enough (or not) this confuses renv which doesn’t like it if you have packages in your lockfile that you don’t use. That’s a nice piece of housekeeping except that renv only knows you’ve used a package because you have library(a_package) at the start of your R scripts; a_package::a_function calls are not seen. (d) I haven’t looked into code linting yet, but I’m assuming flake8 is still an optimal way of doing this.

Some technical notes. I had to install quarto via conda and not “via” nix(I say install via nix, what I mean is that using a default.nix shell section to instruct installation); otherwise it can’t see the relavant python packages in an activated environment. I never found another way of doing this.

All that remains is setting up some GitHub actions that can run these on code submisson.