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
{{ message }}
Repository navigation
Package cli use of "Suggests" rather than "Imports" seems odd #810
Yea, had this too, but I would only add rlang to Imports, not any of the others packages to keep the dependencies as few as possible. A solution for the other pkgs is to call rlang::check_is_installed() in cli functions you’re using other deps in.
Right. rlang is an optional dependency of cli, and it is only needed for some features, namely cli_abort() and co. Other packaging systems, e.g. Rust crates, have ways to express this, but unfortunately the R package system does not.
I cannot currently add rlang as a hard dependency because pak uses cli, but pak does not work with rlang. I can try to document better that you'll also need to import rlang if you use cli_abort().
Do you see any other way to improve the situation? Maybe cli_abort() could check that the called package depends on rlang, but that could be overkill and/or fragile.
Activity
msberends commentedon Apr 2, 2026
Yea, had this too, but I would only add rlang to Imports, not any of the others packages to keep the dependencies as few as possible. A solution for the other pkgs is to call
rlang::check_is_installed()in cli functions you’re using other deps in.gaborcsardi commentedon Apr 2, 2026
What exactly is the issue?
msberends commentedon Apr 2, 2026
If you rely on cli, eg:
Then add
clitoImportsas devs should, then:So it only works if rlang was installed because users also installed tidyverse for example. I’m afraid this is a design flaw in the dependency tree.
gaborcsardi commentedon Apr 2, 2026
Right. rlang is an optional dependency of cli, and it is only needed for some features, namely
cli_abort()and co. Other packaging systems, e.g. Rust crates, have ways to express this, but unfortunately the R package system does not.I cannot currently add rlang as a hard dependency because pak uses cli, but pak does not work with rlang. I can try to document better that you'll also need to import rlang if you use
cli_abort().Do you see any other way to improve the situation? Maybe
cli_abort()could check that the called package depends on rlang, but that could be overkill and/or fragile.msberends commentedon Apr 3, 2026
I see.
Then documenting + checking within cli_inform (and friends) would be best I think. Checks deps of others packages is definitely overkill.
You could add a simple:
Or something like that?