Some of the packaging / testing guides like Simon Willison's use editable install to test, locally which is understandable (kind-of) but also on CI which it seems a lot less so?
What are the advantages of using an editable install on CI, or when using something like tox
to test locally in isolated environments?
You shouldn't, really. Editable installs are convenient, but can lead to erroneous results in testing. As noted in the PyPA docs (original emphasis):
Editable installs are not a perfect replacement for regular installs in a test environment. When in doubt, please test your projects as installed via a regular wheel. There are tools in the Python ecosystem, like tox or nox, that can help you with that (when used with appropriate configuration).
The behavior of tox
(specifically, tox
v4 or later using isolated environments) should be preferred. There is no particular advantage to editable installs, except perhaps that you won't need another test dependency like tox
and you won't have to configure tox. The big downside is that you may run into conditions (of which are numerous) where you have tests pass when run as an editable install, but fail to work properly when a user installs it.