applet: add support for applets that have addition...
by whitequark 1 year 11 months
applet: add support for applets that have additional requirements.

As a concrete example, this (abridged) `pyproject.toml` with
a mandatory dependency on `aiohttp`:

dependencies = ["aiohttp~=3.8"]

[project.entry-points."glasgow.applet"]
audio-yamaha-opx = "glasgow.applet.audio.yamaha_opx:AudioYamahaOPxApplet"

can now be transformed into the following one with an optional
dependency on `aiohttp`:

[project.optional-dependencies]
http = ["aiohttp~=3.8"]

[project.entry-points."glasgow.applet"]
audio-yamaha-opx = "glasgow.applet.audio.yamaha_opx:AudioYamahaOPxApplet [http]"

If `aiohttp` is not installed or its version is unsatisfying, the CLI
shows a placeholder instead of the applet whose `--help` text explains
how to install the missing packages.

See #234.
a4d24cea
applet: kill `all`, use Python entry points to dec...
by whitequark 1 year 11 months
applet: kill `all`, use Python entry points to declare applets.

`glasgow.applet.all` was an abomination. Now that it is gone, we have
several new possibilities:
* Out-of-tree applets is the major one. (This commit explicitly
prohibits them because the API is not stable or ready for public
consumption.)
* Applets can now have package dependencies of their own, through
their list of optional dependency groups that must be installed.
This prevents any further dependency bloat of the software stack.
* Applet metadata can at some point be cached to reduce load times.
Loading every applet (which we still do, just in a less directly
intentional way) is costly, especially on low-power systems or
systems with slow disk, and the cost only grows as more applets
are developed. Unfortunately, this will continue to be the case
so long as `argparse` continues to be used.

It might seem odd to move applet's "name" from its source code to
`pyproject.toml`. This actually makes sense because it is less its
name and more a handle by which it is invoked. It is likely that
the handles of out-of-tree applets will collide reasonably often
and in that case they will be automatically disambiguated.
9ff95922
applet.audio.yamaha_opx: fix off-by-one.
by whitequark 1 year 11 months
a5d9837b
revC2: Corrected the CAT24M01 part number.
by esden 1 year 11 months
7de4e867
software: use proper `amaranth[builtin-yosys]` dep...
by whitequark 1 year 11 months
software: use proper `amaranth[builtin-yosys]` dependency.

PDM 2.8.1 has fixed the bug that prevented its use before.
4f996f95
cli: in `glasgow voltage`, replace `Monitor` with ...
by whitequark 1 year 11 months
cli: in `glasgow voltage`, replace `Monitor` with `Vsense(range)`.

This makes it clearer exactly what is monitored.
eca76810
device.hardware: print causes of `set_voltage()` f...
by whitequark 1 year 11 months
device.hardware: print causes of `set_voltage()` failure.

For example:

$ glasgow voltage
Port Vio Vlimit Vsense Monitor
A 0.0 5.5 0.0 0.0-5.5
B 0.0 3.3 0.0 0.0-5.5
$ glasgow voltage AB 5
E: g.cli: cannot set I/O port(s) AB voltage to 5.0 V (port B voltage limit is set to 3.3 V)

It is easy to miss the value in the Vlimit column. The display of
causes of the error avoids a source of frustration, and ensures that
voltage limit caused errors do not mislead the operator into thinking
that their device is faulty.
ad2150a4
Replace dependency `crc` with `amaranth.lib.crc`
by Ian Bobbitt 1 year 11 months
Replace dependency `crc` with `amaranth.lib.crc`

Fixes GlasgowEmbedded/glasgow#371
0e3b1931
CI: group all required workflows into one status c...
by whitequark 1 year 11 months
CI: group all required workflows into one status check.

This allows more flexibility in running workflows conditionally.
b5d1ef8d
applet.internal.selftest: ensure CLI exits with co...
by whitequark 1 year 11 months
applet.internal.selftest: ensure CLI exits with code 1 on failure.
619dd54e
Report a bug