From c28699c0e8efaa2e480cfe4dde2b33cb2f34caf3 Mon Sep 17 00:00:00 2001 From: elimillera Date: Wed, 20 Dec 2023 17:55:48 +0000 Subject: [PATCH] Updates with CRAN fixes --- DESCRIPTION | 2 +- NEWS.md | 4 ++++ R/pkg_metric_na.R | 1 - R/pkg_ref_class.R | 6 ++---- cran-comments.md | 5 ++--- man/as_pkg_metric_na.Rd | 2 -- man/pkg_assess.Rd | 26 +++++++++++++------------- man/pkg_ref.Rd | 6 ++---- tests/testthat/setup_test_packages.R | 8 +++++--- tests/testthat/test_pkg_ref.R | 2 ++ 10 files changed, 31 insertions(+), 31 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index bd73b525..67731ce4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,7 +3,7 @@ Type: Package Title: Risk Metrics to Evaluating R Packages Description: Facilities for assessing R packages against a number of metrics to help quantify their robustness. -Version: 0.2.3 +Version: 0.2.4 Authors@R: c( person("R Validation Hub", role = c("aut"), email = "psi.aims.r.validation@gmail.com"), person("Doug", "Kelkhoff", role = c("aut"), email = "doug.kelkhoff@gmail.com"), diff --git a/NEWS.md b/NEWS.md index 04976a8b..30c55b18 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# riskmetric 0.2.4 + +- Fix CRAN errors. + # riskmetric 0.2.3 - Fix issue with CRAN package documentation flags. (#311) diff --git a/R/pkg_metric_na.R b/R/pkg_metric_na.R index a88569cf..e146b1e6 100644 --- a/R/pkg_metric_na.R +++ b/R/pkg_metric_na.R @@ -3,7 +3,6 @@ #' @param x a \code{pkg_metric} object to wrap in a \code{pkg_metric_na} #' subclass #' @param message an optional message explaining why a metric is not applicable. -#' @param a \code{pkg_metric} object after wrap in a \code{pkg_metric_na} #' @return a \code{pkg_metric} object after wrap in a \code{pkg_metric_na} #' @keywords internal as_pkg_metric_na <- function(x, message = NULL) { diff --git a/R/pkg_ref_class.R b/R/pkg_ref_class.R index e9b80e9d..d2522f13 100644 --- a/R/pkg_ref_class.R +++ b/R/pkg_ref_class.R @@ -24,14 +24,14 @@ #' #' \itemize{ #' \item{\strong{\code{pkg_ref}}}{ A default class for general metadata -#' collection. +#' collection.} #' \itemize{ #' \item{\strong{\code{pkg_source}}}{ A reference to a source code directory.} #' \item{\strong{\code{pkg_install}}}{ A reference to a package installation #' location in a package library. A specific library can be passed by passing #' the path to the library as the parameter `lib.loc`} #' \item{\strong{\code{pkg_remote}}}{ A reference to package metadata on a -#' remote server. +#' remote server.} #' \itemize{ #' \item{\strong{\code{pkg_cran_remote}}}{ A reference to package #' information pulled from the CRAN repository.} @@ -42,8 +42,6 @@ #' } #' } #' } -#' } -#' } #' #' @section Package Cohorts: #' diff --git a/cran-comments.md b/cran-comments.md index 54b4e964..62365b2d 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,7 +1,6 @@ -## riskmetric 0.2.2 +## riskmetric 0.2.4 -- Bug fixes -- Fixes issue with S3 method consistency. +Resolved issues with CRAN checks. Tested on Ubuntu Jammy, GitHub Action, and RHub. diff --git a/man/as_pkg_metric_na.Rd b/man/as_pkg_metric_na.Rd index d068babb..bb128055 100644 --- a/man/as_pkg_metric_na.Rd +++ b/man/as_pkg_metric_na.Rd @@ -11,8 +11,6 @@ as_pkg_metric_na(x, message = NULL) subclass} \item{message}{an optional message explaining why a metric is not applicable.} - -\item{a}{\code{pkg_metric} object after wrap in a \code{pkg_metric_na}} } \value{ a \code{pkg_metric} object after wrap in a \code{pkg_metric_na} diff --git a/man/pkg_assess.Rd b/man/pkg_assess.Rd index a5b7733c..fd7c810b 100644 --- a/man/pkg_assess.Rd +++ b/man/pkg_assess.Rd @@ -43,25 +43,25 @@ assessment applied. \section{Assessment function catalog}{ \describe{ -\item{\code{\link{assess_last_30_bugs_status}}}{vector indicating whether BugReports status is closed} \item{\code{\link{assess_covr_coverage}}}{Package unit test coverage} -\item{\code{\link{assess_size_codebase}}}{number of lines of code base} -\item{\code{\link{assess_export_help}}}{exported objects have documentation} -\item{\code{\link{assess_r_cmd_check}}}{Package check results} -\item{\code{\link{assess_dependencies}}}{Package dependency footprint} -\item{\code{\link{assess_reverse_dependencies}}}{List of reverse dependencies a package has} -\item{\code{\link{assess_license}}}{software is released with an acceptable license} -\item{\code{\link{assess_has_maintainer}}}{a vector of associated maintainers} +\item{\code{\link{assess_has_news}}}{number of discovered NEWS files} \item{\code{\link{assess_remote_checks}}}{Number of OS flavors that passed/warned/errored on R CMD check} +\item{\code{\link{assess_news_current}}}{NEWS file contains entry for current version number} +\item{\code{\link{assess_r_cmd_check}}}{Package check results} \item{\code{\link{assess_exported_namespace}}}{Objects exported by package} -\item{\code{\link{assess_has_website}}}{a vector of associated website urls} -\item{\code{\link{assess_downloads_1yr}}}{number of downloads in the past year} -\item{\code{\link{assess_has_news}}}{number of discovered NEWS files} \item{\code{\link{assess_has_vignettes}}}{number of discovered vignettes files} -\item{\code{\link{assess_has_examples}}}{proportion of discovered function files with examples} +\item{\code{\link{assess_export_help}}}{exported objects have documentation} +\item{\code{\link{assess_has_website}}}{a vector of associated website urls} +\item{\code{\link{assess_has_maintainer}}}{a vector of associated maintainers} +\item{\code{\link{assess_last_30_bugs_status}}}{vector indicating whether BugReports status is closed} +\item{\code{\link{assess_size_codebase}}}{number of lines of code base} \item{\code{\link{assess_has_source_control}}}{a vector of associated source control urls} \item{\code{\link{assess_has_bug_reports_url}}}{presence of a bug reports url in repository} -\item{\code{\link{assess_news_current}}}{NEWS file contains entry for current version number} +\item{\code{\link{assess_downloads_1yr}}}{number of downloads in the past year} +\item{\code{\link{assess_reverse_dependencies}}}{List of reverse dependencies a package has} +\item{\code{\link{assess_has_examples}}}{proportion of discovered function files with examples} +\item{\code{\link{assess_dependencies}}}{Package dependency footprint} +\item{\code{\link{assess_license}}}{software is released with an acceptable license} } } diff --git a/man/pkg_ref.Rd b/man/pkg_ref.Rd index 7902b7e2..d5362bee 100644 --- a/man/pkg_ref.Rd +++ b/man/pkg_ref.Rd @@ -72,14 +72,14 @@ repository, or testing a specific library. \itemize{ \item{\strong{\code{pkg_ref}}}{ A default class for general metadata -collection. +collection.} \itemize{ \item{\strong{\code{pkg_source}}}{ A reference to a source code directory.} \item{\strong{\code{pkg_install}}}{ A reference to a package installation location in a package library. A specific library can be passed by passing the path to the library as the parameter `lib.loc`} \item{\strong{\code{pkg_remote}}}{ A reference to package metadata on a - remote server. + remote server.} \itemize{ \item{\strong{\code{pkg_cran_remote}}}{ A reference to package information pulled from the CRAN repository.} @@ -91,8 +91,6 @@ collection. } } } -} -} \section{Package Cohorts}{ diff --git a/tests/testthat/setup_test_packages.R b/tests/testthat/setup_test_packages.R index 09bc5d98..791a21bb 100755 --- a/tests/testthat/setup_test_packages.R +++ b/tests/testthat/setup_test_packages.R @@ -6,10 +6,12 @@ # evaluation process. Errors are better tested in metric-specific unit tests. # create a temporary library for installed test packages +options(repos = "fake-cran.fake-r-project.org") templib <- tempfile("riskmetric_test_lib_") +oldLibs <- .libPaths() dir.create(templib) -withr::with_libpaths(templib, { +withr::with_libpaths(c(templib, oldLibs), { devtools::install( file.path(test_path(), "test_packages", "pkgsourcegood"), quiet = TRUE, @@ -60,14 +62,14 @@ score_stdlibs_install <- pkg_score( error_handler = score_error_zero) # a representative "good" quality package available on CRAN, but not installed -pkg_ref_cran_remote_good <- pkg_cran("pkgcranremotegood") +pkg_ref_cran_remote_good <- pkg_cran("pkgcranremotegood", repos = "fake-cran.fake-r-project.org") assess_cran_remote_good <- pkg_assess(pkg_ref_cran_remote_good) score_cran_remote_good <- pkg_score( assess_cran_remote_good, error_handler = score_error_zero) # a representative "bad" quality package available on CRAN, but not installed -pkg_ref_cran_remote_bad <- pkg_cran("pkgcranremotebad") +pkg_ref_cran_remote_bad <- pkg_cran("pkgcranremotebad", repos = "fake-cran.fake-r-project.org") assess_cran_remote_bad <- pkg_assess(pkg_ref_cran_remote_bad) score_cran_remote_bad <- pkg_score( assess_cran_remote_bad, diff --git a/tests/testthat/test_pkg_ref.R b/tests/testthat/test_pkg_ref.R index 8b2f1967..0ee31132 100644 --- a/tests/testthat/test_pkg_ref.R +++ b/tests/testthat/test_pkg_ref.R @@ -1,3 +1,5 @@ +options(repos = "fake-cran.fake-r-project.org") + test_that("get_pkg_ref_classes appropriately captures full class chain", { skip_on_cran()