Skip to content

Commit

Permalink
generate_textdata: add changes needed to authenticate gsheets with re…
Browse files Browse the repository at this point in the history
…nv in R 4.1 *

The approach taken allows to run this project non-interactively and without exposing
cached credentials in the project or in gargle's default cache directory (set the cache
directory and email appropriately through an environment variable)
  • Loading branch information
florisvdh committed Nov 22, 2023
1 parent 502c3a2 commit 9691ec2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 24 deletions.
9 changes: 9 additions & 0 deletions misc/generate_textdata/index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ output:
```{r setup, include=FALSE}
renv::restore()
options(stringsAsFactors = FALSE)
# Setup for googlesheets4 authentication. Set the appropriate env vars in
# .Renviron and make sure you ran gs4_auth() interactively with these settings
# for the first run (or to renew an expired Oauth token)
if (Sys.getenv("GARGLE_OAUTH_EMAIL") != "") {
options(gargle_oauth_email = Sys.getenv("GARGLE_OAUTH_EMAIL"))
}
if (Sys.getenv("GARGLE_OAUTH_CACHE") != "") {
options(gargle_oauth_cache = Sys.getenv("GARGLE_OAUTH_CACHE"))
}
library(tidyverse)
library(stringr)
library(knitr)
Expand Down
48 changes: 24 additions & 24 deletions misc/generate_textdata/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@
},
"cli": {
"Package": "cli",
"Version": "3.1.1",
"Version": "3.6.1",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "da5160e769a652e3ec7111d63883f9bc"
"Hash": "89e6d8219950eac806ae0c489052048a"
},
"clipr": {
"Package": "clipr",
Expand Down Expand Up @@ -215,10 +215,10 @@
},
"curl": {
"Package": "curl",
"Version": "4.3.2",
"Version": "5.1.0",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "022c42d49c28e95d69ca60446dbabf88"
"Hash": "9123f3ef96a2c1a93927d828b2fe7d4c"
},
"data.table": {
"Package": "data.table",
Expand Down Expand Up @@ -327,10 +327,10 @@
},
"gargle": {
"Package": "gargle",
"Version": "1.2.0",
"Version": "1.5.2",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "9d234e6a87a6f8181792de6dc4a00e39"
"Hash": "fc0b272e5847c58cd5da9b20eedbd026"
},
"generics": {
"Package": "generics",
Expand Down Expand Up @@ -390,17 +390,17 @@
},
"googledrive": {
"Package": "googledrive",
"Version": "2.0.0",
"Version": "2.1.1",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "c3a25adbbfbb03f12e6f88c5fb1f3024"
"Hash": "e99641edef03e2a5e87f0a0b1fcc97f4"
},
"googlesheets4": {
"Package": "googlesheets4",
"Version": "1.0.0",
"Version": "1.1.1",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "9a6564184dc4a81daea4f1d7ce357c6a"
"Hash": "d6db1667059d027da730decdc214b959"
},
"gtable": {
"Package": "gtable",
Expand Down Expand Up @@ -439,10 +439,10 @@
},
"httr": {
"Package": "httr",
"Version": "1.4.2",
"Version": "1.4.7",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "a525aba14184fec243f9eaec62fbed43"
"Hash": "ac107251d9d9fd72f0ca8049988f1d7f"
},
"ids": {
"Package": "ids",
Expand Down Expand Up @@ -502,10 +502,10 @@
},
"lifecycle": {
"Package": "lifecycle",
"Version": "1.0.1",
"Version": "1.0.4",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "a6b6d352e3ed897373ab19d8395c98d0"
"Hash": "b8552d117e1b808b09a832f589b79035"
},
"lubridate": {
"Package": "lubridate",
Expand Down Expand Up @@ -565,10 +565,10 @@
},
"openssl": {
"Package": "openssl",
"Version": "1.4.6",
"Version": "2.1.1",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "69fdf291af288f32fd4cd93315084ea8"
"Hash": "2a0dc8c6adfb6f032e4d4af82d258ab5"
},
"pander": {
"Package": "pander",
Expand All @@ -579,10 +579,10 @@
},
"pillar": {
"Package": "pillar",
"Version": "1.7.0",
"Version": "1.9.0",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "51dfc97e1b7069e9f7e6f83f3589c22e"
"Hash": "15da5a8412f317beeee6175fbc76f4bb"
},
"pkgbuild": {
"Package": "pkgbuild",
Expand Down Expand Up @@ -649,10 +649,10 @@
},
"purrr": {
"Package": "purrr",
"Version": "0.3.4",
"Version": "1.0.2",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "97def703420c8ab10d8f0e6c72101e02"
"Hash": "1cba04a4e9414bdefc9dcaa99649a8dc"
},
"rappdirs": {
"Package": "rappdirs",
Expand Down Expand Up @@ -719,10 +719,10 @@
},
"rlang": {
"Package": "rlang",
"Version": "1.0.1",
"Version": "1.1.2",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "3bf0219f19d9f5b3c682acbb3546a151"
"Hash": "50a6dbdc522936ca35afc5e2082ea91b"
},
"rmarkdown": {
"Package": "rmarkdown",
Expand Down Expand Up @@ -887,10 +887,10 @@
},
"vctrs": {
"Package": "vctrs",
"Version": "0.3.8",
"Version": "0.6.4",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "ecf749a1b39ea72bd9b51b76292261f1"
"Hash": "266c1ca411266ba8f365fcc726444b87"
},
"viridisLite": {
"Package": "viridisLite",
Expand Down

0 comments on commit 9691ec2

Please sign in to comment.