This code that determines a lock file path is duplicated in `hub.py`  Maybe refactor out to a function in `util.py` and use from both places.