Skip to content

Some notes on using uv for Glasgow firmware tasks #965

@thoughtpolice

Description

@thoughtpolice

This is more a report that uv works with Glasgow, and that it might be nice to add some documentation about it to the main page, somehow, maybe, if it seems reasonable.

For background, I'm not really a skilled Pythonista in the sense I have always found it very annoying to understand all the differences between various package tools and also the most reliable way to distribute Python or run one-off Python scripts and tools (without venv management, which I think is sort of a vestigial process that has remained in place, from a prior decade when sandboxed/hermetic tooling was far different and much clunkier.) uv however has been an extreme breath of fresh air and I've used it a lot because it makes running one offs so much easier, it has effectively totally changed my ability to use Python reliably, as it brings dependency management way into the 2020s. (It is extremely hyped up online, but I can personally say it actually is really good and deserving of it?)

I decided to upgrade my Glasgow's firmware this weekend to use it on a project. I normally do everything through Nix, but there isn't currently a binary build of a recent glasgow package for aarch64-linux, for my Asahi Linux laptop. Normally I'd fix this, but I have many things to do. And I've never used pipx/pdm or any of these other tools; I decided to try uv. Here's what I did, on aarch64-linux on an M2 Air:

  1. Read the documentation.
  2. Run nix shell nixpkgs#{uv,libusb1} which just adds those things to $PATH because I need them
  3. Clone the glasgow source code && cd glasgow/software
  4. Do the udev stuff that was mentioned.
  5. uv run --python 3.11 --extra builtin-toolchain glasgow list
  6. Done. Every glasgow command seemed to actually work fine. I even updated my firmware this way!

Step 1 can be replaced by whatever distro-specific thing you like. I think step 2 can even by skipped entirely, if you perform the right uv incantation pointing it to the remote source repo. Maybe. Beyond that, I needed no changes to anything for this to work, and from start to finish this process was about 90 seconds long and I got going, and it instantly worked with the pdm lockfile.

I currently am still playing around but wanted to report this here. I might add more comments here as I keep playing with things. If anyone searches up how to use uv with Glasgow, then hopefully they'll end up here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    softwareComponent: software

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions