briefcase icon indicating copy to clipboard operation
briefcase copied to clipboard

Make `briefcase dev` update dependencies automatically

Open mhsmith opened this issue 3 years ago • 2 comments

Same as #807, but for briefcase dev. It currently installs dependencies only when there's no .dist-info directory, which usually means it'll only do it on the first run.

mhsmith avatar Sep 28 '22 09:09 mhsmith

This is a good idea from a UX point of view; forgetting to run dev -d is a bit of a pain. However, the naïve approach of "just turn on -d for every run" isn't ideal either, because running pip install on a list of dependencies that hasn't changed takes a non-trivial amount of time. briefcase dev is a command where execution time matters, so we need to be careful that any mechanism to ensure dependencies are installed doesn't massively slow down the execution experience. As with #807, it might be possible to do something with a hash of pyproject.toml - if you modify pyproject.toml, the hash changes, and briefcase dev tries to install dependencies.

There's also some overlap with #431 - ensuring that you haven't installed a local package and need to add something to your pyproject.toml. However, off the top of my head, I can't think of an obvious hashing target to use for this.

freakboy3742 avatar Sep 28 '22 22:09 freakboy3742

Last week we talked about the idea of making Briefcase inspect the environment using something like importlib.metadata, and comparing it with the requirements to see whether it needs to re-run pip. But that wouldn't be so simple for requirements that are local directories, sdists, wheels, or Git URLs. So using a hash of the requirements list is probably a better idea.

mhsmith avatar Feb 20 '23 14:02 mhsmith