Recent changes in devtools and usethis have inconvenienced my workflow.
I often work developing more than one package - for example a statistical methods package that is reusable, and a project-specific package that handles loading data for the project I'm working on.
With old devtools, I could do:
create("methods") ; create("project") and then
I could also do
use_package("sp", pkg="methods") to add
sp to my methods package.
But now every time I want to use something in one of my packages I have to call
proj_set() because the
usethis::use_x() functions don't take a
proj_set("methods"); use_package("p1") proj_set("project") ; use_package("p2")
That's a whole lot more typing and doesn't make semantic sense because I'm not working on a "project" at that level - these are "packages".
Furthermore, having a default project set with
proj_set means that if I forget which "project" I've currently got set as default and type
use_package("fnord") I've added it to the wrong one. With the old
pkg= argument the package being modified was explicit, not based on some invisible global context.
I dont see why the
pkg argument was removed, or why its default (of ".") wasn't changed to something like
pkg=proj_get() - that would give the same behaviour as now for those that work with
proj_set(), but also allowed the flexibility to easily work with multiple packages anywhere on a file system.
So I think I'm going to have to write some wrapper functions that call
proj_set, do something, then set the project to NULL, which you can only do with more hacks because
proj_set(NULL) doesn't work and the value is in a locked binding so its unexported function time:
There's a lot more friction in package development due to these changes. The reason I used
devtools was because it was a lot less friction than existing methods at the time.
Comment and ideas welcome please....