You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the second tools::package_dependencies call, we surely need direct (non-reverse) dependencies. Non-recursive also seems enough. The question is what to use for which. Right now it’s c("Depends", "Imports", "LinkingTo", "Suggests") at all times. Is it too strict? Is it too permissive? Should it be controllable by user?
If we ask to delete a single package that’s being used, what do we do? Right now, I do nothing (Test#2). Should we delete anyway? (That’s bad, the repo state is broken.) Should we message about that? (“Tried to delete pkg_name, but won’t do”). Add user interaction?
What should be the overall default behavior when treating dependencies? Remove dependencies at all (deps = TRUE)? If so, what about reverse and recursive? I see two useful scenarios: remove pkgs and unused dependencies (reverse = FALSE, see Test#5), or remove pkgs and all packages that depend on them (reverse = TRUE, see Test#6).
The text was updated successfully, but these errors were encountered:
When deleting, I’m doing my best to be sure we don’t delete anything that’s being used by other packages. To do that, I use two calls to
tools::package_dependencies
here:https://github.com/tonytonov/miniCRAN/blob/1e5f0bc6914540715913037c98a1f9ed4bd3957c/R/deletePackages.R#L25 – what to delete;
https://github.com/tonytonov/miniCRAN/blob/1e5f0bc6914540715913037c98a1f9ed4bd3957c/R/deletePackages.R#L35 – what to not delete.
The first call is governed by caller’s arguments and forms a preliminary list for deletion. The second always checks for non-breaking conditions and keeps packages that are used by any other package that is not in the preliminary list.
This is all a bit difficult to imagine, so I created a test suite based on a small dependency tree:
https://github.com/tonytonov/miniCRAN/blob/1e5f0bc6914540715913037c98a1f9ed4bd3957c/tests/testthat/test-8-deletePackage.R#L30-L38
The tree is not that big (and I could have missed some cases), but now all tests result in a consistent (non-broken) dependency state.
So, questions:
tools::package_dependencies
call, we surely need direct (non-reverse) dependencies. Non-recursive also seems enough. The question is what to use forwhich
. Right now it’sc("Depends", "Imports", "LinkingTo", "Suggests")
at all times. Is it too strict? Is it too permissive? Should it be controllable by user?deps = TRUE
)? If so, what aboutreverse
andrecursive
? I see two useful scenarios: remove pkgs and unused dependencies (reverse = FALSE
, see Test#5), or remove pkgs and all packages that depend on them (reverse = TRUE
, see Test#6).The text was updated successfully, but these errors were encountered: