From 93720d3eea3483c5cb37e3ea1c0441f9cfe1e14d Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Wed, 2 Jun 2021 08:48:48 -0500 Subject: [PATCH] use a dedicated env var to decide whether to check DESCRIPTION: https://github.com/yihui/knitr/issues/1864#issuecomment-852405935 --- DESCRIPTION | 2 +- R/utils.R | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 135256e75b..cd076d7b75 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: knitr Type: Package Title: A General-Purpose Package for Dynamic Report Generation in R -Version: 1.33.4 +Version: 1.33.5 Authors@R: c( person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")), person("Abhraneel", "Sarma", role = "ctb"), diff --git a/R/utils.R b/R/utils.R index 515f963819..f08d212565 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1062,7 +1062,7 @@ test_desc_dep = function(pkg, dir = '.') { # TODO: remove this hack in the future when no CRAN/BioC packages have the issue test_vig_dep = function(pkg) { - if (skip_cran_bioc() || test_desc_dep(pkg, '..')) return() + if (no_test_vig_dep() || test_desc_dep(pkg, '..')) return() p = read.dcf(file.path('..', 'DESCRIPTION'), fields = 'Package')[1, 1] stop2( "The '", pkg, "' package should be installed and declared as a dependency of the '", p, @@ -1072,4 +1072,6 @@ test_vig_dep = function(pkg) { ) } -skip_cran_bioc = function() is_R_CMD_check() || Sys.getenv('BBS_HOME') != '' +no_test_vig_dep = function() { + is_R_CMD_check() || tolower(Sys.getenv('KNITR_NO_TEST_VIGNETTE_DEP')) == 'true' +}