From e5dad6029b1185e8f3114c0f46dde9848d144cdb Mon Sep 17 00:00:00 2001 From: "Chanyub.Park" Date: Wed, 3 Jan 2024 21:44:18 +0900 Subject: [PATCH] upgrade renv to 1.0.3 --- DESCRIPTION | 2 +- renv.lock | 1118 +++++++++++++++----------------------------- renv/.gitignore | 1 + renv/activate.R | 508 ++++++++++++++------ renv/settings.json | 19 + sendgridr.Rproj | 44 +- 6 files changed, 804 insertions(+), 888 deletions(-) create mode 100644 renv/settings.json diff --git a/DESCRIPTION b/DESCRIPTION index a7be146..0b8e84d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,7 +21,7 @@ Imports: emayili (>= 0.7), keyring Encoding: UTF-8 -RoxygenNote: 7.2.1 +RoxygenNote: 7.2.3 Depends: R (>= 3.4) Suggests: diff --git a/renv.lock b/renv.lock index 03782d6..a346ef5 100644 --- a/renv.lock +++ b/renv.lock @@ -1,297 +1,234 @@ { "R": { - "Version": "4.2.1", + "Version": "4.3.2", "Repositories": [ { "Name": "CRAN", - "URL": "https://cran.rstudio.com" + "URL": "https://packagemanager.posit.co/cran/latest" } ] }, "Packages": { - "MASS": { - "Package": "MASS", - "Version": "7.3-57", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "71476c1d88d1ebdf31580e5a257d5d31", - "Requirements": [] - }, - "Matrix": { - "Package": "Matrix", - "Version": "1.4-1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "699c47c606293bdfbc9fd78a93c9c8fe", - "Requirements": [ - "lattice" - ] - }, "R6": { "Package": "R6", "Version": "2.5.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "470851b6d5d0ac559e9d01bb352b4021", - "Requirements": [] - }, - "RColorBrewer": { - "Package": "RColorBrewer", - "Version": "1.1-3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "45f0398006e83a5b10b72a90663d8d8c", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "470851b6d5d0ac559e9d01bb352b4021" }, "Rcpp": { "Package": "Rcpp", - "Version": "1.0.8.3", + "Version": "1.0.11", "Source": "Repository", "Repository": "CRAN", - "Hash": "32e79b908fda56ee57fe518a8d37b864", - "Requirements": [] + "Requirements": [ + "methods", + "utils" + ], + "Hash": "ae6cbbe1492f4de79c45fce06f967ce8" }, "askpass": { "Package": "askpass", - "Version": "1.1", + "Version": "1.2.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "e8a22846fff485f0be3770c2da758713", "Requirements": [ "sys" - ] + ], + "Hash": "cad6cf7f1d5f6e906700b9d3e718c796" }, "assertthat": { "Package": "assertthat", "Version": "0.2.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "50c838a310445e954bc13f26f26a6ecf", - "Requirements": [] + "Requirements": [ + "tools" + ], + "Hash": "50c838a310445e954bc13f26f26a6ecf" }, "base64enc": { "Package": "base64enc", "Version": "0.1-3", "Source": "Repository", "Repository": "CRAN", - "Hash": "543776ae6848fde2f48ff3816d0628bc", - "Requirements": [] - }, - "brio": { - "Package": "brio", - "Version": "1.1.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "976cf154dfb043c012d87cddd8bca363", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "543776ae6848fde2f48ff3816d0628bc" }, "bslib": { "Package": "bslib", - "Version": "0.3.1", + "Version": "0.6.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "56ae7e1987b340186a8a5a157c2ec358", "Requirements": [ + "R", + "base64enc", + "cachem", + "grDevices", "htmltools", "jquerylib", "jsonlite", + "lifecycle", + "memoise", + "mime", "rlang", "sass" - ] + ], + "Hash": "c0d8599494bc7fb408cd206bbdd9cab0" }, "cachem": { "Package": "cachem", - "Version": "1.0.6", + "Version": "1.0.8", "Source": "Repository", "Repository": "CRAN", - "Hash": "648c5b3d71e6a37e3043617489a0a0e9", "Requirements": [ "fastmap", "rlang" - ] - }, - "callr": { - "Package": "callr", - "Version": "3.7.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "461aa75a11ce2400245190ef5d3995df", - "Requirements": [ - "R6", - "processx" - ] + ], + "Hash": "c35768291560ce302c0a6589f92e837d" }, "cli": { "Package": "cli", - "Version": "3.3.0", + "Version": "3.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "23abf173c2b783dcc43379ab9bba00ee", "Requirements": [ - "glue" - ] + "R", + "utils" + ], + "Hash": "1216ac65ac55ec0058a6f75d7ca0fd52" }, "clipr": { "Package": "clipr", "Version": "0.8.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "3f038e5ac7f41d4ac41ce658c85e3042", - "Requirements": [] - }, - "colorspace": { - "Package": "colorspace", - "Version": "2.0-3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "bb4341986bc8b914f0f0acf2e4a3f2f7", - "Requirements": [] + "Requirements": [ + "utils" + ], + "Hash": "3f038e5ac7f41d4ac41ce658c85e3042" }, "commonmark": { "Package": "commonmark", - "Version": "1.8.0", + "Version": "1.9.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "2ba81b120c1655ab696c935ef33ea716", - "Requirements": [] - }, - "covr": { - "Package": "covr", - "Version": "3.5.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6d80a9fc3c0c8473153b54fa54719dfd", - "Requirements": [ - "crayon", - "digest", - "httr", - "jsonlite", - "rex", - "withr", - "yaml" - ] + "Hash": "d691c61bff84bd63c383874d2d0c3307" }, "cpp11": { "Package": "cpp11", - "Version": "0.4.2", + "Version": "0.4.7", "Source": "Repository", "Repository": "CRAN", - "Hash": "fa53ce256cd280f468c080a58ea5ba8c", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "5a295d7d963cc5035284dcdbaf334f4e" }, "crayon": { "Package": "crayon", - "Version": "1.5.1", + "Version": "1.5.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "8dc45fd8a1ee067a92b85ef274e66d6a", - "Requirements": [] + "Requirements": [ + "grDevices", + "methods", + "utils" + ], + "Hash": "e8a1e41acf02548751f45c718d55aa6a" }, "credentials": { "Package": "credentials", - "Version": "1.3.2", + "Version": "2.0.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "93762d0a34d78e6a025efdbfb5c6bb41", "Requirements": [ "askpass", "curl", "jsonlite", "openssl", "sys" - ] + ], + "Hash": "c7844b32098dcbd1c59cbd8dddb4ecc6" }, "curl": { "Package": "curl", - "Version": "4.3.2", + "Version": "5.2.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "022c42d49c28e95d69ca60446dbabf88", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "ce88d13c0b10fe88a37d9c59dba2d7f9" }, "desc": { "Package": "desc", - "Version": "1.4.1", + "Version": "1.4.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "eebd27ee58fcc58714eedb7aa07d8ad1", "Requirements": [ + "R", "R6", "cli", - "rprojroot" - ] - }, - "diffobj": { - "Package": "diffobj", - "Version": "0.3.5", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "bcaa8b95f8d7d01a5dedfd959ce88ab8", - "Requirements": [ - "crayon" - ] + "utils" + ], + "Hash": "99b79fcbd6c4d1ce087f5c5c758b384f" }, "digest": { "Package": "digest", - "Version": "0.6.29", + "Version": "0.6.33", "Source": "Repository", "Repository": "CRAN", - "Hash": "cf6b206a045a684728c3267ef7596190", - "Requirements": [] - }, - "downlit": { - "Package": "downlit", - "Version": "0.4.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "ba63dc9ab5a31f3209892437e40c5f60", "Requirements": [ - "brio", - "desc", - "digest", - "evaluate", - "fansi", - "memoise", - "rlang", - "vctrs", - "yaml" - ] + "R", + "utils" + ], + "Hash": "b18a9cf3c003977b0cc49d5e76ebe48d" }, "dplyr": { "Package": "dplyr", - "Version": "1.0.9", + "Version": "1.1.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "f0bda1627a7f5d3f9a0b5add931596ac", "Requirements": [ + "R", "R6", + "cli", "generics", "glue", "lifecycle", "magrittr", + "methods", "pillar", "rlang", "tibble", "tidyselect", + "utils", "vctrs" - ] + ], + "Hash": "fedd9d00c2944ff00a0e2696ccf048ec" }, "ellipsis": { "Package": "ellipsis", "Version": "0.3.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "bb0eec2fe32e88d9e2836c2f73ea2077", "Requirements": [ + "R", "rlang" - ] + ], + "Hash": "bb0eec2fe32e88d9e2836c2f73ea2077" }, "emayili": { "Package": "emayili", - "Version": "0.7.10", + "Version": "0.7.18", "Source": "Repository", - "Repository": "CRAN", - "Hash": "98393be42a8c7ea8d045d3121041628d", + "Repository": "RSPM", "Requirements": [ "base64enc", "commonmark", @@ -313,70 +250,88 @@ "urltools", "xfun", "xml2" - ] + ], + "Hash": "1c0a342d7177b8f4ea7b8526a703d492" }, "evaluate": { "Package": "evaluate", - "Version": "0.15", + "Version": "0.23", "Source": "Repository", "Repository": "CRAN", - "Hash": "699a7a93d08c962d9f8950b2d7a227f1", - "Requirements": [] + "Requirements": [ + "R", + "methods" + ], + "Hash": "daf4a1246be12c1fa8c7705a0935c1a0" }, "fansi": { "Package": "fansi", - "Version": "1.0.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "83a8afdbe71839506baa9f90eebad7ec", - "Requirements": [] - }, - "farver": { - "Package": "farver", - "Version": "2.1.0", + "Version": "1.0.6", "Source": "Repository", "Repository": "CRAN", - "Hash": "c98eb5133d9cb9e1622b8691487f11bb", - "Requirements": [] + "Requirements": [ + "R", + "grDevices", + "utils" + ], + "Hash": "962174cf2aeb5b9eea581522286a911f" }, "fastmap": { "Package": "fastmap", - "Version": "1.1.0", + "Version": "1.1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "77bd60a6157420d4ffa93b27cf6a58b8", - "Requirements": [] + "Hash": "f7736a18de97dea803bde0a2daaafb27" }, "filelock": { "Package": "filelock", - "Version": "1.0.2", + "Version": "1.0.3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "192053c276525c8495ccfd523aa8f2d1" + }, + "fontawesome": { + "Package": "fontawesome", + "Version": "0.5.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "38ec653c2613bed60052ba3787bd8a2c", - "Requirements": [] + "Requirements": [ + "R", + "htmltools", + "rlang" + ], + "Hash": "c2efdd5f0bcd1ea861c2d4e2a883a67d" }, "fs": { "Package": "fs", - "Version": "1.5.2", + "Version": "1.6.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "7c89603d81793f0d5486d91ab1fc6f1d", - "Requirements": [] + "Requirements": [ + "R", + "methods" + ], + "Hash": "47b5f30c720c23999b913a1a635cf0bb" }, "generics": { "Package": "generics", - "Version": "0.1.2", + "Version": "0.1.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "177475892cf4a55865868527654a7741", - "Requirements": [] + "Requirements": [ + "R", + "methods" + ], + "Hash": "15e9634c0fcd294799e9b2e929ed1b86" }, "gert": { "Package": "gert", - "Version": "1.6.0", + "Version": "2.0.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "98c014c4c933f23ea5a0321a4d0b588b", "Requirements": [ "askpass", "credentials", @@ -384,214 +339,144 @@ "rstudioapi", "sys", "zip" - ] - }, - "ggfun": { - "Package": "ggfun", - "Version": "0.0.6", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "ec2bf075e5bd353fa502992a0f5f5f03", - "Requirements": [ - "ggplot2", - "rlang" - ] - }, - "ggimage": { - "Package": "ggimage", - "Version": "0.3.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "a7919e11761293f25eeb1562d3e4342a", - "Requirements": [ - "ggfun", - "ggplot2", - "ggplotify", - "jsonlite", - "magick", - "scales", - "tibble" - ] - }, - "ggplot2": { - "Package": "ggplot2", - "Version": "3.3.6", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "0fb26d0674c82705c6b701d1a61e02ea", - "Requirements": [ - "MASS", - "digest", - "glue", - "gtable", - "isoband", - "mgcv", - "rlang", - "scales", - "tibble", - "withr" - ] - }, - "ggplotify": { - "Package": "ggplotify", - "Version": "0.1.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "acbcedf783cdb8710168aa0edba42ac0", - "Requirements": [ - "ggplot2", - "gridGraphics", - "yulab.utils" - ] + ], + "Hash": "f70d3fe2d9e7654213a946963d1591eb" }, "gh": { "Package": "gh", - "Version": "1.3.0", + "Version": "1.4.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "38c2580abbda249bd6afeec00d14f531", "Requirements": [ + "R", "cli", "gitcreds", - "httr", + "httr2", "ini", - "jsonlite" - ] + "jsonlite", + "rlang" + ], + "Hash": "03533b1c875028233598f848fda44c4c" }, "gitcreds": { "Package": "gitcreds", - "Version": "0.1.1", + "Version": "0.1.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "f3aefccc1cc50de6338146b62f115de8", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "ab08ac61f3e1be454ae21911eb8bc2fe" }, "glue": { "Package": "glue", "Version": "1.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "4f2596dfb05dac67b9dc558e5c6fba2e", - "Requirements": [] - }, - "gridGraphics": { - "Package": "gridGraphics", - "Version": "0.5-1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "5b79228594f02385d4df4979284879ae", - "Requirements": [] - }, - "gtable": { - "Package": "gtable", - "Version": "0.3.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "ac5c6baf7822ce8732b343f14c072c4d", - "Requirements": [] - }, - "hexSticker": { - "Package": "hexSticker", - "Version": "0.4.9", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "c624f6eb9e15082a672b5e6277257567", "Requirements": [ - "ggimage", - "ggplot2", - "hexbin", - "showtext", - "sysfonts" - ] - }, - "hexbin": { - "Package": "hexbin", - "Version": "1.28.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "76314b69dc54f8c14204063a2fd6d74a", - "Requirements": [ - "lattice" - ] + "R", + "methods" + ], + "Hash": "4f2596dfb05dac67b9dc558e5c6fba2e" }, "highr": { "Package": "highr", - "Version": "0.9", + "Version": "0.10", "Source": "Repository", "Repository": "CRAN", - "Hash": "8eb36c8125038e648e5d111c0d7b2ed4", "Requirements": [ + "R", "xfun" - ] + ], + "Hash": "06230136b2d2b9ba5805e1963fa6e890" }, "htmltools": { "Package": "htmltools", - "Version": "0.5.2", + "Version": "0.5.7", "Source": "Repository", "Repository": "CRAN", - "Hash": "526c484233f42522278ab06fb185cb26", "Requirements": [ + "R", "base64enc", "digest", + "ellipsis", "fastmap", - "rlang" - ] + "grDevices", + "rlang", + "utils" + ], + "Hash": "2d7b3857980e0e0d0a1fd6f11928ab0f" }, "httr": { "Package": "httr", - "Version": "1.4.3", + "Version": "1.4.7", "Source": "Repository", "Repository": "CRAN", - "Hash": "88d1b310583777edf01ccd1216fb0b2b", "Requirements": [ + "R", "R6", "curl", "jsonlite", "mime", "openssl" - ] + ], + "Hash": "ac107251d9d9fd72f0ca8049988f1d7f" }, - "ini": { - "Package": "ini", - "Version": "0.3.1", + "httr2": { + "Package": "httr2", + "Version": "1.0.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "6154ec2223172bce8162d4153cda21f7", - "Requirements": [] + "Requirements": [ + "R", + "R6", + "cli", + "curl", + "glue", + "lifecycle", + "magrittr", + "openssl", + "rappdirs", + "rlang", + "vctrs", + "withr" + ], + "Hash": "e2b30f1fc039a0bab047dd52bb20ef71" }, - "isoband": { - "Package": "isoband", - "Version": "0.2.5", + "ini": { + "Package": "ini", + "Version": "0.3.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "7ab57a6de7f48a8dc84910d1eca42883", - "Requirements": [] + "Hash": "6154ec2223172bce8162d4153cda21f7" }, "jquerylib": { "Package": "jquerylib", "Version": "0.1.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "5aab57a3bd297eee1c1d862735972182", "Requirements": [ "htmltools" - ] + ], + "Hash": "5aab57a3bd297eee1c1d862735972182" }, "jsonlite": { "Package": "jsonlite", - "Version": "1.8.0", + "Version": "1.8.8", "Source": "Repository", "Repository": "CRAN", - "Hash": "d07e729b27b372429d42d24d503613a0", - "Requirements": [] + "Requirements": [ + "methods" + ], + "Hash": "e1b9c55281c5adc4dd113652d9e26768" }, "keyring": { "Package": "keyring", - "Version": "1.3.0", + "Version": "1.3.2", "Source": "Repository", - "Repository": "CRAN", - "Hash": "f97832aee679462739f7146fead53b11", + "Repository": "RSPM", "Requirements": [ + "R", "R6", "askpass", "assertthat", @@ -599,607 +484,395 @@ "openssl", "rappdirs", "sodium", + "tools", + "utils", "yaml" - ] + ], + "Hash": "5cd8cfb2e90c57110b7dd1785c599aba" }, "knitr": { "Package": "knitr", - "Version": "1.38", + "Version": "1.45", "Source": "Repository", "Repository": "CRAN", - "Hash": "10b3dc3c6acb925910edda5d0543b3a2", "Requirements": [ + "R", "evaluate", "highr", - "stringr", + "methods", + "tools", "xfun", "yaml" - ] - }, - "labeling": { - "Package": "labeling", - "Version": "0.4.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "3d5108641f47470611a32d0bdf357a72", - "Requirements": [] - }, - "lattice": { - "Package": "lattice", - "Version": "0.20-45", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b64cdbb2b340437c4ee047a1f4c4377b", - "Requirements": [] - }, - "lazyeval": { - "Package": "lazyeval", - "Version": "0.2.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "d908914ae53b04d4c0c0fd72ecc35370", - "Requirements": [] + ], + "Hash": "1ec462871063897135c1bcbe0fc8f07d" }, "lifecycle": { "Package": "lifecycle", - "Version": "1.0.1", + "Version": "1.0.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "a6b6d352e3ed897373ab19d8395c98d0", "Requirements": [ + "R", + "cli", "glue", "rlang" - ] + ], + "Hash": "b8552d117e1b808b09a832f589b79035" }, "logger": { "Package": "logger", "Version": "0.2.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "c269b06beb2bbadb0d058c0e6fa4ec3d", - "Requirements": [] - }, - "magick": { - "Package": "magick", - "Version": "2.7.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "56fbad418aa50939ed8c3028126af8d7", "Requirements": [ - "Rcpp", - "curl", - "magrittr" - ] + "utils" + ], + "Hash": "c269b06beb2bbadb0d058c0e6fa4ec3d" }, "magrittr": { "Package": "magrittr", "Version": "2.0.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "7ce2733a9826b3aeb1775d56fd305472", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "7ce2733a9826b3aeb1775d56fd305472" }, "memoise": { "Package": "memoise", "Version": "2.0.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c", "Requirements": [ "cachem", "rlang" - ] - }, - "mgcv": { - "Package": "mgcv", - "Version": "1.8-40", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "c6b2fdb18cf68ab613bd564363e1ba0d", - "Requirements": [ - "Matrix", - "nlme" - ] + ], + "Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c" }, "mime": { "Package": "mime", "Version": "0.12", "Source": "Repository", "Repository": "CRAN", - "Hash": "18e9c28c1d3ca1560ce30658b22ce104", - "Requirements": [] - }, - "munsell": { - "Package": "munsell", - "Version": "0.5.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6dfe8bf774944bd5595785e3229d8771", - "Requirements": [ - "colorspace" - ] - }, - "nlme": { - "Package": "nlme", - "Version": "3.1-157", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "dbca60742be0c9eddc5205e5c7ca1f44", "Requirements": [ - "lattice" - ] + "tools" + ], + "Hash": "18e9c28c1d3ca1560ce30658b22ce104" }, "openssl": { "Package": "openssl", - "Version": "2.0.2", + "Version": "2.1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "6d3bef2e305f55c705c674653c7d7d3d", "Requirements": [ "askpass" - ] + ], + "Hash": "2a0dc8c6adfb6f032e4d4af82d258ab5" }, "pillar": { "Package": "pillar", - "Version": "1.7.0", + "Version": "1.9.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "51dfc97e1b7069e9f7e6f83f3589c22e", "Requirements": [ "cli", - "crayon", - "ellipsis", "fansi", "glue", "lifecycle", "rlang", "utf8", + "utils", "vctrs" - ] + ], + "Hash": "15da5a8412f317beeee6175fbc76f4bb" }, "pkgconfig": { "Package": "pkgconfig", "Version": "2.0.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "01f28d4278f15c76cddbea05899c5d6f", - "Requirements": [] - }, - "pkgdown": { - "Package": "pkgdown", - "Version": "2.0.6", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "f958d0b2a5dabc5ffd414f062b1ffbe7", - "Requirements": [ - "bslib", - "callr", - "cli", - "desc", - "digest", - "downlit", - "fs", - "httr", - "jsonlite", - "magrittr", - "memoise", - "purrr", - "ragg", - "rlang", - "rmarkdown", - "tibble", - "whisker", - "withr", - "xml2", - "yaml" - ] - }, - "pkgload": { - "Package": "pkgload", - "Version": "1.3.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "4b20f937a363c78a5730265c1925f54a", "Requirements": [ - "cli", - "crayon", - "desc", - "fs", - "glue", - "rlang", - "rprojroot", - "withr" - ] - }, - "praise": { - "Package": "praise", - "Version": "1.0.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "a555924add98c99d2f411e37e7d25e9f", - "Requirements": [] - }, - "processx": { - "Package": "processx", - "Version": "3.5.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "8bbae1a548d0d3fdf6647bdd9d35bf6d", - "Requirements": [ - "R6", - "ps" - ] - }, - "ps": { - "Package": "ps", - "Version": "1.7.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "eef74b13f32cae6bb0d495e53317c44c", - "Requirements": [] + "utils" + ], + "Hash": "01f28d4278f15c76cddbea05899c5d6f" }, "purrr": { "Package": "purrr", - "Version": "0.3.4", + "Version": "1.0.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "97def703420c8ab10d8f0e6c72101e02", "Requirements": [ + "R", + "cli", + "lifecycle", "magrittr", - "rlang" - ] - }, - "ragg": { - "Package": "ragg", - "Version": "1.2.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "14932bb6f2739c771ca4ceaba6b4248e", - "Requirements": [ - "systemfonts", - "textshaping" - ] + "rlang", + "vctrs" + ], + "Hash": "1cba04a4e9414bdefc9dcaa99649a8dc" }, "rappdirs": { "Package": "rappdirs", "Version": "0.3.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "5e3c5dc0b071b21fa128676560dbe94d", - "Requirements": [] - }, - "rematch2": { - "Package": "rematch2", - "Version": "2.1.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "76c9e04c712a05848ae7a23d2f170a40", "Requirements": [ - "tibble" - ] + "R" + ], + "Hash": "5e3c5dc0b071b21fa128676560dbe94d" }, "renv": { "Package": "renv", - "Version": "0.15.5", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6a38294e7d12f5d8e656b08c5bd8ae34", - "Requirements": [] - }, - "rex": { - "Package": "rex", - "Version": "1.2.1", + "Version": "1.0.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "ae34cd56890607370665bee5bd17812f", "Requirements": [ - "lazyeval" - ] + "utils" + ], + "Hash": "41b847654f567341725473431dd0d5ab" }, "rlang": { "Package": "rlang", - "Version": "1.0.4", + "Version": "1.1.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "6539dd8c651e67e3b55b5ffea106362b", - "Requirements": [] + "Requirements": [ + "R", + "utils" + ], + "Hash": "50a6dbdc522936ca35afc5e2082ea91b" }, "rmarkdown": { "Package": "rmarkdown", - "Version": "2.13", + "Version": "2.25", "Source": "Repository", "Repository": "CRAN", - "Hash": "ac78f4d2e0289d4cba73b88af567b8b1", "Requirements": [ + "R", "bslib", "evaluate", + "fontawesome", "htmltools", "jquerylib", "jsonlite", "knitr", + "methods", "stringr", "tinytex", + "tools", + "utils", "xfun", "yaml" - ] + ], + "Hash": "d65e35823c817f09f4de424fcdfa812a" }, "rprojroot": { "Package": "rprojroot", - "Version": "2.0.3", + "Version": "2.0.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "1de7ab598047a87bba48434ba35d497d", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "4c8415e0ec1e29f3f4f6fc108bef0144" }, "rstudioapi": { "Package": "rstudioapi", - "Version": "0.13", + "Version": "0.15.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "06c85365a03fdaf699966cc1d3cf53ea", - "Requirements": [] + "Hash": "5564500e25cffad9e22244ced1379887" }, "rvest": { "Package": "rvest", - "Version": "1.0.2", + "Version": "1.0.3", "Source": "Repository", - "Repository": "CRAN", - "Hash": "bb099886deffecd6f9b298b7d4492943", + "Repository": "RSPM", "Requirements": [ + "R", + "cli", + "glue", "httr", "lifecycle", "magrittr", "rlang", "selectr", "tibble", + "withr", "xml2" - ] + ], + "Hash": "a4a5ac819a467808c60e36e92ddf195e" }, "sass": { "Package": "sass", - "Version": "0.4.1", + "Version": "0.4.8", "Source": "Repository", "Repository": "CRAN", - "Hash": "f37c0028d720bab3c513fd65d28c7234", "Requirements": [ "R6", "fs", "htmltools", "rappdirs", "rlang" - ] - }, - "scales": { - "Package": "scales", - "Version": "1.2.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6e8750cdd13477aa440d453da93d5cac", - "Requirements": [ - "R6", - "RColorBrewer", - "farver", - "labeling", - "lifecycle", - "munsell", - "rlang", - "viridisLite" - ] + ], + "Hash": "168f9353c76d4c4b0a0bbf72e2c2d035" }, "selectr": { "Package": "selectr", "Version": "0.4-2", "Source": "Repository", "Repository": "CRAN", - "Hash": "3838071b66e0c566d55cc26bd6e27bf4", "Requirements": [ + "R", "R6", + "methods", "stringr" - ] - }, - "showtext": { - "Package": "showtext", - "Version": "0.9-5", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b588dee88e238bf811e27f12edee9433", - "Requirements": [ - "showtextdb", - "sysfonts" - ] - }, - "showtextdb": { - "Package": "showtextdb", - "Version": "3.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "c12e756cf947e58b0f2c2a520521a5a8", - "Requirements": [ - "sysfonts" - ] + ], + "Hash": "3838071b66e0c566d55cc26bd6e27bf4" }, "sodium": { "Package": "sodium", - "Version": "1.2.1", + "Version": "1.3.1", "Source": "Repository", - "Repository": "CRAN", - "Hash": "3606bb09e0914edd4fc8313b500dcd5e", - "Requirements": [] + "Repository": "RSPM", + "Hash": "dd86d6fd2a01d4eb3777dfdee7076d56" }, "stringi": { "Package": "stringi", - "Version": "1.7.6", + "Version": "1.8.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "bba431031d30789535745a9627ac9271", - "Requirements": [] + "Requirements": [ + "R", + "stats", + "tools", + "utils" + ], + "Hash": "058aebddea264f4c99401515182e656a" }, "stringr": { "Package": "stringr", - "Version": "1.4.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "0759e6b6c0957edb1311028a49a35e76", - "Requirements": [ - "glue", - "magrittr", - "stringi" - ] - }, - "sys": { - "Package": "sys", - "Version": "3.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b227d13e29222b4574486cfcbde077fa", - "Requirements": [] - }, - "sysfonts": { - "Package": "sysfonts", - "Version": "0.8.8", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "7f4dac41a3e348ae12832167e6beb875", - "Requirements": [] - }, - "systemfonts": { - "Package": "systemfonts", - "Version": "1.0.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "90b28393209827327de889f49935140a", - "Requirements": [ - "cpp11" - ] - }, - "testthat": { - "Package": "testthat", - "Version": "3.1.4", + "Version": "1.5.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "f76c2a02d0fdc24aa7a47ea34261a6e3", "Requirements": [ - "R6", - "brio", - "callr", + "R", "cli", - "crayon", - "desc", - "digest", - "ellipsis", - "evaluate", - "jsonlite", + "glue", "lifecycle", "magrittr", - "pkgload", - "praise", - "processx", - "ps", "rlang", - "waldo", - "withr" - ] + "stringi", + "vctrs" + ], + "Hash": "960e2ae9e09656611e0b8214ad543207" }, - "textshaping": { - "Package": "textshaping", - "Version": "0.3.6", + "sys": { + "Package": "sys", + "Version": "3.4.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "1ab6223d3670fac7143202cb6a2d43d5", - "Requirements": [ - "cpp11", - "systemfonts" - ] + "Hash": "3a1be13d68d47a8cd0bfd74739ca1555" }, "tibble": { "Package": "tibble", - "Version": "3.1.6", + "Version": "3.2.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "8a8f02d1934dfd6431c671361510dd0b", "Requirements": [ - "ellipsis", + "R", "fansi", "lifecycle", "magrittr", + "methods", "pillar", "pkgconfig", "rlang", + "utils", "vctrs" - ] + ], + "Hash": "a84e2cc86d07289b3b6f5069df7a004c" }, "tidyr": { "Package": "tidyr", - "Version": "1.2.0", + "Version": "1.3.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "d8b95b7fee945d7da6888cf7eb71a49c", "Requirements": [ + "R", + "cli", "cpp11", "dplyr", - "ellipsis", "glue", "lifecycle", "magrittr", "purrr", "rlang", + "stringr", "tibble", "tidyselect", + "utils", "vctrs" - ] + ], + "Hash": "e47debdc7ce599b070c8e78e8ac0cfcf" }, "tidyselect": { "Package": "tidyselect", - "Version": "1.1.2", + "Version": "1.2.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "17f6da8cfd7002760a859915ce7eef8f", "Requirements": [ - "ellipsis", + "R", + "cli", "glue", - "purrr", + "lifecycle", "rlang", - "vctrs" - ] + "vctrs", + "withr" + ], + "Hash": "79540e5fcd9e0435af547d885f184fd5" }, "tinytex": { "Package": "tinytex", - "Version": "0.38", + "Version": "0.49", "Source": "Repository", "Repository": "CRAN", - "Hash": "759d047596ac173433985deddf313450", "Requirements": [ "xfun" - ] + ], + "Hash": "5ac22900ae0f386e54f1c307eca7d843" }, "triebeard": { "Package": "triebeard", - "Version": "0.3.0", + "Version": "0.4.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "847a9d113b78baca4a9a8639609ea228", "Requirements": [ "Rcpp" - ] + ], + "Hash": "642507a148b0dd9b5620177e0a044413" }, "urltools": { "Package": "urltools", "Version": "1.7.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "e86a704261a105f4703f653e05defa3e", "Requirements": [ + "R", "Rcpp", + "methods", "triebeard" - ] + ], + "Hash": "e86a704261a105f4703f653e05defa3e" }, "usethis": { "Package": "usethis", - "Version": "2.1.6", + "Version": "2.2.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "a67a22c201832b12c036cc059f1d137d", "Requirements": [ + "R", "cli", "clipr", "crayon", @@ -1216,110 +889,95 @@ "rlang", "rprojroot", "rstudioapi", + "stats", + "utils", "whisker", "withr", "yaml" - ] + ], + "Hash": "60e51f0b94d0324dc19e44110098fa9f" }, "utf8": { "Package": "utf8", - "Version": "1.2.2", + "Version": "1.2.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "c9c462b759a5cc844ae25b5942654d13", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "62b65c52671e6665f803ff02954446e9" }, "vctrs": { "Package": "vctrs", - "Version": "0.4.1", + "Version": "0.6.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "8b54f22e2a58c4f275479c92ce041a57", "Requirements": [ + "R", "cli", "glue", + "lifecycle", "rlang" - ] - }, - "viridisLite": { - "Package": "viridisLite", - "Version": "0.4.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "55e157e2aa88161bdb0754218470d204", - "Requirements": [] - }, - "waldo": { - "Package": "waldo", - "Version": "0.4.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "035fba89d0c86e2113120f93301b98ad", - "Requirements": [ - "cli", - "diffobj", - "fansi", - "glue", - "rematch2", - "rlang", - "tibble" - ] + ], + "Hash": "c03fa420630029418f7e6da3667aac4a" }, "whisker": { "Package": "whisker", - "Version": "0.4", + "Version": "0.4.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "ca970b96d894e90397ed20637a0c1bbe", - "Requirements": [] + "Hash": "c6abfa47a46d281a7d5159d0a8891e88" }, "withr": { "Package": "withr", - "Version": "2.5.0", + "Version": "2.5.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "c0e49a9760983e81e55cdd9be92e7182", - "Requirements": [] + "Requirements": [ + "R", + "grDevices", + "graphics", + "stats" + ], + "Hash": "4b25e70111b7d644322e9513f403a272" }, "xfun": { "Package": "xfun", - "Version": "0.30", + "Version": "0.41", "Source": "Repository", "Repository": "CRAN", - "Hash": "e83f48136b041845e50a6658feffb197", - "Requirements": [] + "Requirements": [ + "stats", + "tools" + ], + "Hash": "460a5e0fe46a80ef87424ad216028014" }, "xml2": { "Package": "xml2", - "Version": "1.3.3", + "Version": "1.3.6", "Source": "Repository", - "Repository": "CRAN", - "Hash": "40682ed6a969ea5abfd351eb67833adc", - "Requirements": [] + "Repository": "RSPM", + "Requirements": [ + "R", + "cli", + "methods", + "rlang" + ], + "Hash": "1d0336142f4cd25d8d23cd3ba7a8fb61" }, "yaml": { "Package": "yaml", - "Version": "2.3.5", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "458bb38374d73bf83b1bb85e353da200", - "Requirements": [] - }, - "yulab.utils": { - "Package": "yulab.utils", - "Version": "0.0.4", + "Version": "2.3.8", "Source": "Repository", "Repository": "CRAN", - "Hash": "922e11dcf40bb5dfcf3fe5e714d0dc35", - "Requirements": [] + "Hash": "29240487a071f535f5e5d5a323b7afbd" }, "zip": { "Package": "zip", - "Version": "2.2.0", + "Version": "2.3.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "c7eef2996ac270a18c2715c997a727c5", - "Requirements": [] + "Hash": "d98c94dacb7e0efcf83b0a133a705504" } } } diff --git a/renv/.gitignore b/renv/.gitignore index 275e4ca..22a0d01 100644 --- a/renv/.gitignore +++ b/renv/.gitignore @@ -1,3 +1,4 @@ +sandbox/ library/ local/ cellar/ diff --git a/renv/activate.R b/renv/activate.R index 72c0818..cb5401f 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -2,11 +2,27 @@ local({ # the requested version of renv - version <- "0.15.5" + version <- "1.0.3" + attr(version, "sha") <- NULL # the project directory project <- getwd() + # use start-up diagnostics if enabled + diagnostics <- Sys.getenv("RENV_STARTUP_DIAGNOSTICS", unset = "FALSE") + if (diagnostics) { + start <- Sys.time() + profile <- tempfile("renv-startup-", fileext = ".Rprof") + utils::Rprof(profile) + on.exit({ + utils::Rprof(NULL) + elapsed <- signif(difftime(Sys.time(), start, units = "auto"), digits = 2L) + writeLines(sprintf("- renv took %s to run the autoloader.", format(elapsed))) + writeLines(sprintf("- Profile: %s", profile)) + print(utils::summaryRprof(profile)) + }, add = TRUE) + } + # figure out whether the autoloader is enabled enabled <- local({ @@ -60,21 +76,75 @@ local({ # load bootstrap tools `%||%` <- function(x, y) { - if (is.environment(x) || length(x)) x else y + if (is.null(x)) y else x + } + + catf <- function(fmt, ..., appendLF = TRUE) { + + quiet <- getOption("renv.bootstrap.quiet", default = FALSE) + if (quiet) + return(invisible()) + + msg <- sprintf(fmt, ...) + cat(msg, file = stdout(), sep = if (appendLF) "\n" else "") + + invisible(msg) + + } + + header <- function(label, + ..., + prefix = "#", + suffix = "-", + n = min(getOption("width"), 78)) + { + label <- sprintf(label, ...) + n <- max(n - nchar(label) - nchar(prefix) - 2L, 8L) + if (n <= 0) + return(paste(prefix, label)) + + tail <- paste(rep.int(suffix, n), collapse = "") + paste0(prefix, " ", label, " ", tail) + + } + + startswith <- function(string, prefix) { + substring(string, 1, nchar(prefix)) == prefix } bootstrap <- function(version, library) { + friendly <- renv_bootstrap_version_friendly(version) + section <- header(sprintf("Bootstrapping renv %s", friendly)) + catf(section) + # attempt to download renv - tarball <- tryCatch(renv_bootstrap_download(version), error = identity) - if (inherits(tarball, "error")) - stop("failed to download renv ", version) + catf("- Downloading renv ... ", appendLF = FALSE) + withCallingHandlers( + tarball <- renv_bootstrap_download(version), + error = function(err) { + catf("FAILED") + stop("failed to download:\n", conditionMessage(err)) + } + ) + catf("OK") + on.exit(unlink(tarball), add = TRUE) # now attempt to install - status <- tryCatch(renv_bootstrap_install(version, tarball, library), error = identity) - if (inherits(status, "error")) - stop("failed to install renv ", version) + catf("- Installing renv ... ", appendLF = FALSE) + withCallingHandlers( + status <- renv_bootstrap_install(version, tarball, library), + error = function(err) { + catf("FAILED") + stop("failed to install:\n", conditionMessage(err)) + } + ) + catf("OK") + # add empty line to break up bootstrapping from normal output + catf("") + + return(invisible()) } renv_bootstrap_tests_running <- function() { @@ -83,28 +153,32 @@ local({ renv_bootstrap_repos <- function() { + # get CRAN repository + cran <- getOption("renv.repos.cran", "https://cloud.r-project.org") + # check for repos override repos <- Sys.getenv("RENV_CONFIG_REPOS_OVERRIDE", unset = NA) - if (!is.na(repos)) + if (!is.na(repos)) { + + # check for RSPM; if set, use a fallback repository for renv + rspm <- Sys.getenv("RSPM", unset = NA) + if (identical(rspm, repos)) + repos <- c(RSPM = rspm, CRAN = cran) + return(repos) + } + # check for lockfile repositories repos <- tryCatch(renv_bootstrap_repos_lockfile(), error = identity) if (!inherits(repos, "error") && length(repos)) return(repos) - # if we're testing, re-use the test repositories - if (renv_bootstrap_tests_running()) - return(getOption("renv.tests.repos")) - # retrieve current repos repos <- getOption("repos") # ensure @CRAN@ entries are resolved - repos[repos == "@CRAN@"] <- getOption( - "renv.repos.cran", - "https://cloud.r-project.org" - ) + repos[repos == "@CRAN@"] <- cran # add in renv.bootstrap.repos if set default <- c(FALLBACK = "https://cloud.r-project.org") @@ -143,33 +217,34 @@ local({ renv_bootstrap_download <- function(version) { - # if the renv version number has 4 components, assume it must - # be retrieved via github - nv <- numeric_version(version) - components <- unclass(nv)[[1]] - - # if this appears to be a development version of 'renv', we'll - # try to restore from github - dev <- length(components) == 4L - - # begin collecting different methods for finding renv - methods <- c( - renv_bootstrap_download_tarball, - if (dev) - renv_bootstrap_download_github - else c( - renv_bootstrap_download_cran_latest, - renv_bootstrap_download_cran_archive + sha <- attr(version, "sha", exact = TRUE) + + methods <- if (!is.null(sha)) { + + # attempting to bootstrap a development version of renv + c( + function() renv_bootstrap_download_tarball(sha), + function() renv_bootstrap_download_github(sha) + ) + + } else { + + # attempting to bootstrap a release version of renv + c( + function() renv_bootstrap_download_tarball(version), + function() renv_bootstrap_download_cran_latest(version), + function() renv_bootstrap_download_cran_archive(version) ) - ) + + } for (method in methods) { - path <- tryCatch(method(version), error = identity) + path <- tryCatch(method(), error = identity) if (is.character(path) && file.exists(path)) return(path) } - stop("failed to download renv ", version) + stop("All download methods failed") } @@ -185,43 +260,75 @@ local({ if (fixup) mode <- "w+b" - utils::download.file( + args <- list( url = url, destfile = destfile, mode = mode, quiet = TRUE ) + if ("headers" %in% names(formals(utils::download.file))) + args$headers <- renv_bootstrap_download_custom_headers(url) + + do.call(utils::download.file, args) + } - renv_bootstrap_download_cran_latest <- function(version) { + renv_bootstrap_download_custom_headers <- function(url) { - spec <- renv_bootstrap_download_cran_latest_find(version) + headers <- getOption("renv.download.headers") + if (is.null(headers)) + return(character()) + + if (!is.function(headers)) + stopf("'renv.download.headers' is not a function") + + headers <- headers(url) + if (length(headers) == 0L) + return(character()) + + if (is.list(headers)) + headers <- unlist(headers, recursive = FALSE, use.names = TRUE) - message("* Downloading renv ", version, " ... ", appendLF = FALSE) + ok <- + is.character(headers) && + is.character(names(headers)) && + all(nzchar(names(headers))) + if (!ok) + stop("invocation of 'renv.download.headers' did not return a named character vector") + + headers + + } + + renv_bootstrap_download_cran_latest <- function(version) { + + spec <- renv_bootstrap_download_cran_latest_find(version) type <- spec$type repos <- spec$repos - info <- tryCatch( - utils::download.packages( - pkgs = "renv", - destdir = tempdir(), - repos = repos, - type = type, - quiet = TRUE - ), + baseurl <- utils::contrib.url(repos = repos, type = type) + ext <- if (identical(type, "source")) + ".tar.gz" + else if (Sys.info()[["sysname"]] == "Windows") + ".zip" + else + ".tgz" + name <- sprintf("renv_%s%s", version, ext) + url <- paste(baseurl, name, sep = "/") + + destfile <- file.path(tempdir(), name) + status <- tryCatch( + renv_bootstrap_download_impl(url, destfile), condition = identity ) - if (inherits(info, "condition")) { - message("FAILED") + if (inherits(status, "condition")) return(FALSE) - } # report success and return - message("OK (downloaded ", type, ")") - info[1, 2] + destfile } @@ -277,8 +384,6 @@ local({ urls <- file.path(repos, "src/contrib/Archive/renv", name) destfile <- file.path(tempdir(), name) - message("* Downloading renv ", version, " ... ", appendLF = FALSE) - for (url in urls) { status <- tryCatch( @@ -286,14 +391,11 @@ local({ condition = identity ) - if (identical(status, 0L)) { - message("OK") + if (identical(status, 0L)) return(destfile) - } } - message("FAILED") return(FALSE) } @@ -307,8 +409,7 @@ local({ return() # allow directories - info <- file.info(tarball, extra_cols = FALSE) - if (identical(info$isdir, TRUE)) { + if (dir.exists(tarball)) { name <- sprintf("renv_%s.tar.gz", version) tarball <- file.path(tarball, name) } @@ -317,7 +418,7 @@ local({ if (!file.exists(tarball)) { # let the user know we weren't able to honour their request - fmt <- "* RENV_BOOTSTRAP_TARBALL is set (%s) but does not exist." + fmt <- "- RENV_BOOTSTRAP_TARBALL is set (%s) but does not exist." msg <- sprintf(fmt, tarball) warning(msg) @@ -326,10 +427,7 @@ local({ } - fmt <- "* Bootstrapping with tarball at path '%s'." - msg <- sprintf(fmt, tarball) - message(msg) - + catf("- Using local tarball '%s'.", tarball) tarball } @@ -356,8 +454,6 @@ local({ on.exit(do.call(base::options, saved), add = TRUE) } - message("* Downloading renv ", version, " from GitHub ... ", appendLF = FALSE) - url <- file.path("https://api.github.com/repos/rstudio/renv/tarball", version) name <- sprintf("renv_%s.tar.gz", version) destfile <- file.path(tempdir(), name) @@ -367,26 +463,105 @@ local({ condition = identity ) - if (!identical(status, 0L)) { - message("FAILED") + if (!identical(status, 0L)) return(FALSE) - } - message("OK") + renv_bootstrap_download_augment(destfile) + return(destfile) } + # Add Sha to DESCRIPTION. This is stop gap until #890, after which we + # can use renv::install() to fully capture metadata. + renv_bootstrap_download_augment <- function(destfile) { + sha <- renv_bootstrap_git_extract_sha1_tar(destfile) + if (is.null(sha)) { + return() + } + + # Untar + tempdir <- tempfile("renv-github-") + on.exit(unlink(tempdir, recursive = TRUE), add = TRUE) + untar(destfile, exdir = tempdir) + pkgdir <- dir(tempdir, full.names = TRUE)[[1]] + + # Modify description + desc_path <- file.path(pkgdir, "DESCRIPTION") + desc_lines <- readLines(desc_path) + remotes_fields <- c( + "RemoteType: github", + "RemoteHost: api.github.com", + "RemoteRepo: renv", + "RemoteUsername: rstudio", + "RemotePkgRef: rstudio/renv", + paste("RemoteRef: ", sha), + paste("RemoteSha: ", sha) + ) + writeLines(c(desc_lines[desc_lines != ""], remotes_fields), con = desc_path) + + # Re-tar + local({ + old <- setwd(tempdir) + on.exit(setwd(old), add = TRUE) + + tar(destfile, compression = "gzip") + }) + invisible() + } + + # Extract the commit hash from a git archive. Git archives include the SHA1 + # hash as the comment field of the tarball pax extended header + # (see https://www.kernel.org/pub/software/scm/git/docs/git-archive.html) + # For GitHub archives this should be the first header after the default one + # (512 byte) header. + renv_bootstrap_git_extract_sha1_tar <- function(bundle) { + + # open the bundle for reading + # We use gzcon for everything because (from ?gzcon) + # > Reading from a connection which does not supply a 'gzip' magic + # > header is equivalent to reading from the original connection + conn <- gzcon(file(bundle, open = "rb", raw = TRUE)) + on.exit(close(conn)) + + # The default pax header is 512 bytes long and the first pax extended header + # with the comment should be 51 bytes long + # `52 comment=` (11 chars) + 40 byte SHA1 hash + len <- 0x200 + 0x33 + res <- rawToChar(readBin(conn, "raw", n = len)[0x201:len]) + + if (grepl("^52 comment=", res)) { + sub("52 comment=", "", res) + } else { + NULL + } + } + renv_bootstrap_install <- function(version, tarball, library) { # attempt to install it into project library - message("* Installing renv ", version, " ... ", appendLF = FALSE) dir.create(library, showWarnings = FALSE, recursive = TRUE) + output <- renv_bootstrap_install_impl(library, tarball) + + # check for successful install + status <- attr(output, "status") + if (is.null(status) || identical(status, 0L)) + return(status) + + # an error occurred; report it + header <- "installation of renv failed" + lines <- paste(rep.int("=", nchar(header)), collapse = "") + text <- paste(c(header, lines, output), collapse = "\n") + stop(text) + + } + + renv_bootstrap_install_impl <- function(library, tarball) { # invoke using system2 so we can capture and report output bin <- R.home("bin") exe <- if (Sys.info()[["sysname"]] == "Windows") "R.exe" else "R" - r <- file.path(bin, exe) + R <- file.path(bin, exe) args <- c( "--vanilla", "CMD", "INSTALL", "--no-multiarch", @@ -394,19 +569,7 @@ local({ shQuote(path.expand(tarball)) ) - output <- system2(r, args, stdout = TRUE, stderr = TRUE) - message("Done!") - - # check for successful install - status <- attr(output, "status") - if (is.numeric(status) && !identical(status, 0L)) { - header <- "Error installing renv:" - lines <- paste(rep.int("=", nchar(header)), collapse = "") - text <- c(header, lines, output) - writeLines(text, con = stderr()) - } - - status + system2(R, args, stdout = TRUE, stderr = TRUE) } @@ -616,34 +779,62 @@ local({ } - renv_bootstrap_validate_version <- function(version) { + renv_bootstrap_validate_version <- function(version, description = NULL) { - loadedversion <- utils::packageDescription("renv", fields = "Version") - if (version == loadedversion) - return(TRUE) + # resolve description file + # + # avoid passing lib.loc to `packageDescription()` below, since R will + # use the loaded version of the package by default anyhow. note that + # this function should only be called after 'renv' is loaded + # https://github.com/rstudio/renv/issues/1625 + description <- description %||% packageDescription("renv") - # assume four-component versions are from GitHub; three-component - # versions are from CRAN - components <- strsplit(loadedversion, "[.-]")[[1]] - remote <- if (length(components) == 4L) - paste("rstudio/renv", loadedversion, sep = "@") + # check whether requested version 'version' matches loaded version of renv + sha <- attr(version, "sha", exact = TRUE) + valid <- if (!is.null(sha)) + renv_bootstrap_validate_version_dev(sha, description) else - paste("renv", loadedversion, sep = "@") + renv_bootstrap_validate_version_release(version, description) + + if (valid) + return(TRUE) + + # the loaded version of renv doesn't match the requested version; + # give the user instructions on how to proceed + remote <- if (!is.null(description[["RemoteSha"]])) { + paste("rstudio/renv", description[["RemoteSha"]], sep = "@") + } else { + paste("renv", description[["Version"]], sep = "@") + } + + # display both loaded version + sha if available + friendly <- renv_bootstrap_version_friendly( + version = description[["Version"]], + sha = description[["RemoteSha"]] + ) fmt <- paste( "renv %1$s was loaded from project library, but this project is configured to use renv %2$s.", - "Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile.", - "Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library.", + "- Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile.", + "- Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library.", sep = "\n" ) - - msg <- sprintf(fmt, loadedversion, version, remote) - warning(msg, call. = FALSE) + catf(fmt, friendly, renv_bootstrap_version_friendly(version), remote) FALSE } + renv_bootstrap_validate_version_dev <- function(version, description) { + expected <- description[["RemoteSha"]] + is.character(expected) && startswith(expected, version) + } + + renv_bootstrap_validate_version_release <- function(version, description) { + expected <- description[["Version"]] + is.character(expected) && identical(expected, version) + } + renv_bootstrap_hash_text <- function(text) { hashfile <- tempfile("renv-hash-") @@ -663,6 +854,12 @@ local({ # warn if the version of renv loaded does not match renv_bootstrap_validate_version(version) + # execute renv load hooks, if any + hooks <- getHook("renv::autoload") + for (hook in hooks) + if (is.function(hook)) + tryCatch(hook(), error = warnify) + # load the project renv::load(project) @@ -678,7 +875,7 @@ local({ return(profile) # check for a profile file (nothing to do if it doesn't exist) - path <- renv_bootstrap_paths_renv("profile", profile = FALSE) + path <- renv_bootstrap_paths_renv("profile", profile = FALSE, project = project) if (!file.exists(path)) return(NULL) @@ -802,12 +999,78 @@ local({ } + renv_bootstrap_version_friendly <- function(version, shafmt = NULL, sha = NULL) { + sha <- sha %||% attr(version, "sha", exact = TRUE) + parts <- c(version, sprintf(shafmt %||% " [sha: %s]", substring(sha, 1L, 7L))) + paste(parts, collapse = "") + } + + renv_bootstrap_exec <- function(project, libpath, version) { + if (!renv_bootstrap_load(project, libpath, version)) + renv_bootstrap_run(version, libpath) + } + + renv_bootstrap_run <- function(version, libpath) { + + # perform bootstrap + bootstrap(version, libpath) + + # exit early if we're just testing bootstrap + if (!is.na(Sys.getenv("RENV_BOOTSTRAP_INSTALL_ONLY", unset = NA))) + return(TRUE) + + # try again to load + if (requireNamespace("renv", lib.loc = libpath, quietly = TRUE)) { + return(renv::load(project = getwd())) + } + + # failed to download or load renv; warn the user + msg <- c( + "Failed to find an renv installation: the project will not be loaded.", + "Use `renv::activate()` to re-initialize the project." + ) + + warning(paste(msg, collapse = "\n"), call. = FALSE) + + } renv_json_read <- function(file = NULL, text = NULL) { + jlerr <- NULL + + # if jsonlite is loaded, use that instead + if ("jsonlite" %in% loadedNamespaces()) { + + json <- catch(renv_json_read_jsonlite(file, text)) + if (!inherits(json, "error")) + return(json) + + jlerr <- json + + } + + # otherwise, fall back to the default JSON reader + json <- catch(renv_json_read_default(file, text)) + if (!inherits(json, "error")) + return(json) + + # report an error + if (!is.null(jlerr)) + stop(jlerr) + else + stop(json) + + } + + renv_json_read_jsonlite <- function(file = NULL, text = NULL) { text <- paste(text %||% read(file), collapse = "\n") + jsonlite::fromJSON(txt = text, simplifyVector = FALSE) + } + + renv_json_read_default <- function(file = NULL, text = NULL) { # find strings in the JSON + text <- paste(text %||% read(file), collapse = "\n") pattern <- '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' locs <- gregexpr(pattern, text, perl = TRUE)[[1]] @@ -838,8 +1101,9 @@ local({ # transform the JSON into something the R parser understands transformed <- replaced - transformed <- gsub("[[{]", "list(", transformed) - transformed <- gsub("[]}]", ")", transformed) + transformed <- gsub("{}", "`names<-`(list(), character())", transformed, fixed = TRUE) + transformed <- gsub("[[{]", "list(", transformed, perl = TRUE) + transformed <- gsub("[]}]", ")", transformed, perl = TRUE) transformed <- gsub(":", "=", transformed, fixed = TRUE) text <- paste(transformed, collapse = "\n") @@ -908,35 +1172,9 @@ local({ # construct full libpath libpath <- file.path(root, prefix) - # attempt to load - if (renv_bootstrap_load(project, libpath, version)) - return(TRUE) - - # load failed; inform user we're about to bootstrap - prefix <- paste("# Bootstrapping renv", version) - postfix <- paste(rep.int("-", 77L - nchar(prefix)), collapse = "") - header <- paste(prefix, postfix) - message(header) - - # perform bootstrap - bootstrap(version, libpath) - - # exit early if we're just testing bootstrap - if (!is.na(Sys.getenv("RENV_BOOTSTRAP_INSTALL_ONLY", unset = NA))) - return(TRUE) - - # try again to load - if (requireNamespace("renv", lib.loc = libpath, quietly = TRUE)) { - message("* Successfully installed and loaded renv ", version, ".") - return(renv::load()) - } - - # failed to download or load renv; warn the user - msg <- c( - "Failed to find an renv installation: the project will not be loaded.", - "Use `renv::activate()` to re-initialize the project." - ) + # run bootstrap code + renv_bootstrap_exec(project, libpath, version) - warning(paste(msg, collapse = "\n"), call. = FALSE) + invisible() }) diff --git a/renv/settings.json b/renv/settings.json new file mode 100644 index 0000000..74c1d4b --- /dev/null +++ b/renv/settings.json @@ -0,0 +1,19 @@ +{ + "bioconductor.version": null, + "external.libraries": [], + "ignored.packages": [], + "package.dependency.fields": [ + "Imports", + "Depends", + "LinkingTo" + ], + "ppm.enabled": null, + "ppm.ignored.urls": [], + "r.version": null, + "snapshot.type": "explicit", + "use.cache": true, + "vcs.ignore.cellar": true, + "vcs.ignore.library": true, + "vcs.ignore.local": true, + "vcs.manage.ignores": true +} diff --git a/sendgridr.Rproj b/sendgridr.Rproj index 571e32d..0ee12cd 100644 --- a/sendgridr.Rproj +++ b/sendgridr.Rproj @@ -1,22 +1,22 @@ -Version: 1.0 - -RestoreWorkspace: No -SaveWorkspace: No -AlwaysSaveHistory: Default - -EnableCodeIndexing: Yes -UseSpacesForTab: Yes -NumSpacesForTab: 2 -Encoding: UTF-8 - -RnwWeave: Sweave -LaTeX: pdfLaTeX - -AutoAppendNewline: Yes -StripTrailingWhitespace: Yes - -BuildType: Package -PackageUseDevtools: Yes -PackageInstallArgs: --no-multiarch --with-keep.source -PackageCheckArgs: --as-cran -PackageRoxygenize: rd,collate,namespace +Version: 1.0 + +RestoreWorkspace: No +SaveWorkspace: No +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX + +AutoAppendNewline: Yes +StripTrailingWhitespace: Yes + +BuildType: Package +PackageUseDevtools: Yes +PackageInstallArgs: --no-multiarch --with-keep.source +PackageCheckArgs: --as-cran +PackageRoxygenize: rd,collate,namespace