r-lib / usethis

Set up commonly used πŸ“¦ components
https://usethis.r-lib.org/
Other
854 stars 284 forks source link

tidyeval template: import .env from rlang #122

Closed ijlyttle closed 6 years ago

ijlyttle commented 6 years ago

I don't have a strong opinion on this but I notice that (as of today) rlang does not export .env - so I think (as of today) the template should not import it.

I gather that this remains an open question (tidyverse/rlang#269), just going for consistency now.

Also making a PR for this.

ijlyttle commented 6 years ago

Just saw the CRAN release - I should have also pointed out that the backquotes around := appear to cause a warning - this is fixed in the PR.

This is using the CRAN version (1.1.0) of usethis.

Also noting I get this template.Rproj error, but this may be because I have (by habit) already created the directory and RStudio project. Can open separate issue if need be.

> create_package(".")
Changing active project to tempusethis
βœ” Creating 'R/'
βœ” Creating 'man/'
βœ” Writing 'DESCRIPTION'
βœ” Writing 'NAMESPACE'
Error: Could not find template 'template.Rproj'

> use_roxygen_md()
βœ” Setting Roxygen field in DESCRIPTION to 'list(markdown = TRUE)'
βœ” Setting RoxygenNote field in DESCRIPTION to '6.0.1'
● Re-document

> document()
Updating tempusethis documentation
Loading tempusethis
Writing NAMESPACE

> use_tidy_eval()
βœ” Adding 'rlang' to Imports field in DESCRIPTION
βœ” Writing 'R/utils-tidy-eval.R'
● Run document()

> document()
Updating tempusethis documentation
Loading tempusethis
Writing NAMESPACE
Writing tidyeval.Rd

> load_all()
Loading tempusethis
Warning messages:
1: object β€˜`:=`’ is not exported by 'namespace:rlang' 
2: object β€˜.env’ is not exported by 'namespace:rlang' 
ijlyttle commented 6 years ago

It looks like you have identified the create_package() behaviour in #127

jennybc commented 6 years ago

Yes, I confirm that the error re: template.Rproj has been resolved in dev version.