Test "base" installation
#4745 fixed a bug where you would get traceback running cylc help all and cylc hub for a normal installation of pip install cylc-flow cylc-uiserver (i.e. not an [all] installation, which we normally do hence it took a while to notice the bug). Presumably you would have gotten the same bug if you'd done conda install cylc-uiserver-base instead of conda install cylc-uiserver.
Ergo we could do with some kind of automated test for the base installation.
~I tried writing unit tests for cylc-flow's entry point handling but the mocking/patching was too awkward~ Update: Oliver was able to come up with unit tests.
Perhaps we could have a GH Actions workflow that could do a base installation and test running cylc help all and a selection of commands that use optional dependencies to make sure they work and/or give the desired error message.
Note the case of cylc report-timings, which uses pandas for some things: pandas is an optional dependency, but cylc report-timings can still do some things without it, so it should still show up in cylc help all and still work for the things it can do without pandas. The imports of pandas in report_timings.py are specifically deferred.
Conversely, cylc hub totally needs jupyterhub so it should be skipped by cylc help all if jupyterhub is missing, and running cylc hub should give a one-line error message. The import of jupyterhub is unguarded, at the top of the file.
Pull requests welcome!
Yes, testing every possible install option is a pain, add to that editable vs non-editable installs, PIP and Python version and there's a matrix of potential problems.
I wonder if we could write a workflow which lists optional deps from the setup.cfg, installs them and tests importing entry points marked against them.
Might be a good workflow to add to the release process?