pak
pak copied to clipboard
syntax typos with using `stopifnot()`?
These appear to be accidental but with the exception of pkg_deps_explain()
, they seem to work fine with multiple package names passed to pkg
https://github.com/r-lib/pak/blob/15b0b2e9d5d81d3853627a69edcb6d2118a6e36c/R/deps-explain.R#L27-L28
https://github.com/r-lib/pak/blob/15b0b2e9d5d81d3853627a69edcb6d2118a6e36c/R/package.R#L282-L283
https://github.com/r-lib/pak/blob/15b0b2e9d5d81d3853627a69edcb6d2118a6e36c/R/package.R#L334-L335
https://github.com/r-lib/pak/blob/15b0b2e9d5d81d3853627a69edcb6d2118a6e36c/R/package.R#L380-L381
Reprex. Something else is weird but not part of this issue.
library(pak)
pkgs <- c("pak", "rlang")
try(pkg_deps_explain(pkgs, "utils"))
#> i Loading metadata database i Loading metadata database
pkg_status(pkgs)
#> # A tibble: 2 x 27
#> library package title version depends suggests imports linkingto enhances
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 C:/Users~ pak Anothe~ 0.1.2.~ R (>= ~ "callr (~ tools,~ <NA> <NA>
#> 2 C:/Users~ rlang Functi~ 0.4.12 R (>= ~ "cli, co~ utils <NA> winch
#> # ... with 18 more variables: built <chr>, md5sum <chr>,
#> # needscompilation <lgl>, platform <chr>, license <chr>, priority <chr>,
#> # repository <chr>, biocviews <chr>, remotes <chr>, remotepkgref <chr>,
#> # remotetype <chr>, ref <chr>, type <chr>, status <chr>, rversion <chr>,
#> # sources <list>, repotype <chr>, deps <list>
x <- pkg_deps(pkgs)
#> i Loading metadata database i Loading metadata database
x
#> Error in eval(expr, envir, enclos): object 'x' not found
x <- pkg_deps_tree(pkgs)
#> i Loading metadata database i Loading metadata database
x
#> Error in eval(expr, envir, enclos): object 'x' not found
Created on 2021-11-19 by the reprex package (v2.0.1)
Session info
sessioninfo::session_info()
#> - Session info --------------------------------------------------------------
#> hash: woman factory worker: medium-light skin tone, woman teacher: light skin tone, flag: St. Vincent & Grenadines
#>
#> setting value
#> version R version 4.1.1 (2021-08-10)
#> os Windows 10 x64 (build 19043)
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate English_United States.1252
#> ctype English_United States.1252
#> tz America/New_York
#> date 2021-11-19
#> pandoc 2.11.4 @ C:/Program Files/RStudio/bin/pandoc/ (via rmarkdown)
#>
#> - Packages -------------------------------------------------------------------
#> package * version date (UTC) lib source
#> backports 1.3.0 2021-10-27 [1] CRAN (R 4.1.1)
#> cli 3.1.0 2021-10-27 [1] CRAN (R 4.1.1)
#> crayon 1.4.2 2021-10-29 [1] CRAN (R 4.1.1)
#> digest 0.6.28 2021-09-23 [1] CRAN (R 4.1.1)
#> ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.1.0)
#> evaluate 0.14 2019-05-28 [1] CRAN (R 4.1.0)
#> fansi 0.5.0 2021-05-25 [1] CRAN (R 4.1.0)
#> fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.1.0)
#> fs 1.5.0 2020-07-31 [1] CRAN (R 4.1.0)
#> glue 1.5.0 2021-11-07 [1] CRAN (R 4.1.1)
#> highr 0.9 2021-04-16 [1] CRAN (R 4.1.0)
#> htmltools 0.5.2 2021-08-25 [1] CRAN (R 4.1.1)
#> knitr 1.36 2021-09-29 [1] CRAN (R 4.1.1)
#> lifecycle 1.0.1 2021-09-24 [1] CRAN (R 4.1.1)
#> magrittr 2.0.1 2020-11-17 [1] CRAN (R 4.1.0)
#> pak * 0.1.2.9001 2021-10-20 [1] local
#> pillar 1.6.4 2021-10-18 [1] CRAN (R 4.1.1)
#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.1.0)
#> purrr 0.3.4 2020-04-17 [1] CRAN (R 4.1.0)
#> R.cache 0.15.0 2021-04-30 [1] CRAN (R 4.1.0)
#> R.methodsS3 1.8.1 2020-08-26 [1] CRAN (R 4.1.0)
#> R.oo 1.24.0 2020-08-26 [1] CRAN (R 4.1.0)
#> R.utils 2.11.0 2021-09-26 [1] CRAN (R 4.1.1)
#> reprex 2.0.1 2021-08-05 [1] CRAN (R 4.1.0)
#> rlang 0.4.12 2021-10-18 [1] CRAN (R 4.1.1)
#> rmarkdown 2.11 2021-09-14 [1] CRAN (R 4.1.0)
#> rstudioapi 0.13 2020-11-12 [1] CRAN (R 4.1.0)
#> sessioninfo 1.2.1 2021-11-02 [1] CRAN (R 4.1.1)
#> stringi 1.7.5 2021-10-04 [1] CRAN (R 4.1.1)
#> stringr 1.4.0 2019-02-10 [1] CRAN (R 4.1.0)
#> styler 1.6.2 2021-09-23 [1] CRAN (R 4.1.1)
#> tibble 3.1.6 2021-11-07 [1] CRAN (R 4.1.1)
#> utf8 1.2.2 2021-07-24 [1] CRAN (R 4.1.0)
#> vctrs 0.3.8 2021-04-29 [1] CRAN (R 4.1.0)
#> withr 2.4.2 2021-04-18 [1] CRAN (R 4.1.0)
#> xfun 0.28 2021-11-04 [1] CRAN (R 4.1.1)
#> yaml 2.2.1 2020-02-01 [1] CRAN (R 4.1.0)
#>
#> [1] C:/Users/jbarbone/Documents/R/win-library/4.1
#> [2] C:/Program Files/R/R-4.1.1/library
#>
#> ------------------------------------------------------------------------------
They are not accidental, I did not validates that they work for multiple packages, and there are no tests for this, either. But we can take a look at this.
Thanks @gaborcsardi. To clarify I meant to specifically ask if the length(pkg == 1)
was suppose to be length(pkg) == 1
.
Oh, right, sure, that's a bug of course. Thanks!