r-lib / usethis

Set up commonly used 📦 components
https://usethis.r-lib.org/
Other
861 stars 285 forks source link

Issues with use_tidy_eval() #484

Closed jmgirard closed 5 years ago

jmgirard commented 6 years ago

Three issues. Maybe the first two were intentional, but it doesn't seem so.

  1. The function overwrites the dependency version for rlang to be >= 0.1.2 which is older than the version I already had in there (from use_tidy_versions()).
  2. The function overwrites the dependency version for roxygen2 to be *.
  3. When using "Install and Restart" after running this function, I get the following warnings:
Rd warning: /circumplex/man/tidyeval.Rd:23: file link 'syms' in package 'rlang' does not exist and so has been treated as a topic
Rd warning: /circumplex/man/tidyeval.Rd:25: file link 'expr' in package 'rlang' does not exist and so has been treated as a topic
Rd warning: /circumplex/man/tidyeval.Rd:25: file link 'quo' in package 'rlang' does not exist and so has been treated as a topic
Rd warning: /circumplex/man/tidyeval.Rd:28: file link 'exprs' in package 'rlang' does not exist and so has been treated as a topic
Rd warning: /circumplex/man/tidyeval.Rd:29: file link 'quos' in package 'rlang' does not exist and so has been treated as a topic
Rd warning: /circumplex/man/tidyeval.Rd:31: file link 'enexpr' in package 'rlang' does not exist and so has been treated as a topic
Rd warning: /circumplex/man/tidyeval.Rd:31: file link 'enquo' in package 'rlang' does not exist and so has been treated as a topic
Rd warning: /circumplex/man/tidyeval.Rd:35: file link 'enexprs' in package 'rlang' does not exist and so has been treated as a topic
Rd warning: /circumplex/man/tidyeval.Rd:35: file link 'enquos' in package 'rlang' does not exist and so has been treated as a topic
jennybc commented 6 years ago

The minimum version of rlang is hard-wired inside use_tidy_eval():

use_dependency("rlang", "Imports", ">= 0.1.2")

I will defer to @lionel- whether that's a good plan going forward. use_tidy_versions(), on the other hand, will use the currently installed version, which could be overly conservative. It will probably always be true that one needs to apply some judgement in these cases. I doubt we can ever get it perfectly right.

I just tried it and don't see any change re: roxygen2. Are you sure that didn't come from use_tidy_versions()?

I can't reproduce what you're seeing with "Install and Restart". How does the help look at this point? What if you try to access the help on those functions through ?rlang::enquo in the Console?

jmgirard commented 6 years ago

Thanks for the quick reply. Here is what is displayed in my console for (1) and (2).

image

Interestingly, ?rlang::enquo correctly routes to the quotation help page.

jennybc commented 6 years ago

Did you indeed run devtools::document()?

jmgirard commented 6 years ago

Yes, I did. :)

jmgirard commented 6 years ago

On a related note, I'm wondering if utils-tidy-eval.R should import := as well. It's not a huge deal to add this if needed, but it might make sense to include.

lionel- commented 6 years ago

Would it make sense to always depend on latest rlang, to push things forward? For instance 0.3.0 has an important fix for .data[[ subsetting. In any case 0.1.2 is too old, it still has the old !! precedence.

jmgirard commented 6 years ago

Using the latest version might obviate this, but in general it seems like a reasonable approach might be to compare the version that usethis wants to the version that is currently listed in description and take the newer of the two. Overwriting the currently listed version with an older one (as it currently works) could introduce problems if the newer version actually is needed for other non-usethis reasons.

hadley commented 5 years ago

Extracted out this bug in to a new issue: https://github.com/r-lib/usethis/issues/498