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
Hello! I really love this package, so firstly thanks for making something that brings me a little joy every day.
So, I recently used the neat dependency checkers in pak to determine if a dependency could be added for free, which was really handy, and I was wondering if something like this might be useful for other users of pak?
Here's a little demo for geotargets to help us determine if we could add withr or fs for free:
# on master/main branchcan_we_add_a_dep_for_free<-function(deps){
local_deps<-pak::pkg_deps(".")
are_deps_already_free<-deps%in%local_deps$ref
names(are_deps_already_free) <-depsif (are_deps_already_free) {
cli::cli_inform(
message= c(
"{.pkg {deps}} can be added for free:",
"Explanation:")
)
print(pak::local_deps_explain(deps=deps))
}
if (!are_deps_already_free){
cli::cli_inform(
message= c(
"{.pkg {deps}} can not be added for free :("
)
)
}
}
can_we_add_a_dep_for_free("withr")
#> ℹ Loading metadata database#> ✔ Loading metadata database ... done#> #> withr can be added for free:#> Explanation:#> geotargets -> targets -> tidyselect -> withr
can_we_add_a_dep_for_free("fs")
#> fs can not be added for free :(
Thanks! I agree that that's handy, but it does seem a bit specialized, and (well, apart from the nice UI that you added) it is essentially a one-liner:
(Btw. you need to use package, not ref, ref might be a reference, e.g. github::r-lib/fs, in which case the results can be incorrect.)
Even if we don't add it as a function, it would be really nice to add this tip somewhere, maybe the FAQ, or maybe elsewhere, so please allow me to keep this issue open for a bit.
Hello! I really love this package, so firstly thanks for making something that brings me a little joy every day.
So, I recently used the neat dependency checkers in
pak
to determine if a dependency could be added for free, which was really handy, and I was wondering if something like this might be useful for other users ofpak
?Here's a little demo for geotargets to help us determine if we could add
withr
orfs
for free:Created on 2024-10-28 with reprex v2.1.1
Session info
The text was updated successfully, but these errors were encountered: