Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning in devtools::check() after using golem::use_utils_server() #678

Closed
JMPivette opened this issue May 27, 2021 · 5 comments
Closed

Comments

@JMPivette
Copy link

After using golem::use_utils_server() I get a warning when running devtools::check():

> checking dependencies in R code ... WARNING
  '::' or ':::' import not declared from: 'rlang'

It looks like devtools::check() doesn't like this line:

rv <- shiny::reactiveValues

If I change this line with rv <- function(...) shiny::reactiveValues(...) then the warning disappears.

I don't really understand why this warning appears in the first place.
I am using R v4.0.2, golem v0.3.1 and devtools v2.4.1

@JMPivette JMPivette changed the title Warning in devtools::check() after using golem::use_utils_server() Warning in devtools::check() after using golem::use_utils_server() May 27, 2021
@ColinFay
Copy link
Member

ColinFay commented Jun 4, 2021

Hey,

Thanks for reporting that.

Is this something you see systematically in your apps (i.e. every time you create a golem ?) or is it only this time?

@JMPivette
Copy link
Author

Hey
It's systematic. I noticed it on my last 2 projects using golem.

Then to find the cause of the warning, I created a blank golem project and ran devtools::check() after each command line in 01_start.R

The problem is reproducible (well at least on my computer..):

  • Create a golem project in RStudio
  • Run all steps from 01_start.R
  • Run devtools::check()

@ColinFay
Copy link
Member

ColinFay commented Jun 4, 2021

Reprex :

colin:tmp colin$ cd /tmp

colin:tmp colin$ Rscript -e "golem::create_golem('plop')"
[...] # Removed output

colin:tmp colin$ cd plop/

colin:plop colin$ Rscript -e "devtools::check()"
[...] # Removed output
── R CMD check results ──────────────────────────────────── plop 0.0.0.9000 ────
Duration: 1m 59.4s

❯ checking DESCRIPTION meta-information ... WARNING
  Spécification de licence non standard :
    What license is it under?
  Standardizable: FALSE

0 errors ✔ | 1 warning ✖ | 0 notes ✔
Erreur : R CMD check found WARNINGs

colin:plop colin$ Rscript -e "golem::use_utils_server()"
[...] # Removed output
── R CMD check results ──────────────────────────────────── plop 0.0.0.9000 ────
Duration: 1m 11.7s

❯ checking DESCRIPTION meta-information ... WARNING
  Spécification de licence non standard :
    What license is it under?
  Standardizable: FALSE

❯ checking dependencies in R code ... WARNING
  '::' or ':::' import not declared from: ‘rlang’

0 errors ✔ | 2 warnings ✖ | 0 notes ✔
Erreur : R CMD check found WARNINGs

This happens only with utils_server, but this doesn't make sense as there is no rlang there 🤔

@ColinFay
Copy link
Member

ColinFay commented Jun 4, 2021

Ah, I think I get it.

> rv <- shiny::reactiveValues
> rv
function (...) 
{
    args <- list(...)
    if ((length(args) > 0) && (is.null(names(args)) || any(names(args) == 
        ""))) 
        rlang::abort("All arguments passed to reactiveValues() must be named.")
    values <- .createReactiveValues(ReactiveValues$new())
    .subset2(values, "impl")$mset(args)
    values
}
<bytecode: 0x7ff791ca7378>
<environment: namespace:shiny>

will take the body of the functions, so when the app compiles, it has rlang::.

@ColinFay
Copy link
Member

ColinFay commented Jun 4, 2021

Fixed via https://github.com/ThinkR-open/golem/pull/688/files

Thanks again for your feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants