Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: REDCapExporter
Title: Automated Construction of R Data Packages from REDCap Projects
Version: 0.3.5
Version: 0.3.6
Authors@R: c(
person(given = "Peter", family = "DeWitt", email = "peter.dewitt@cuanschutz.edu", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-6391-0795"))
)
Expand Down Expand Up @@ -32,4 +32,4 @@ Suggests:
roxygen2,
secret
VignetteBuilder: knitr, rmarkdown
Config/roxygen2/version: 8.0.0
Config/roxygen2/version: 8.1.0
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Version 0.3.6

## Improvements

* Use the installed `roxygen2` version in DESCRIPTION files generated for data
packages, and omit the roxygen2 configuration field when `roxygen2` is not
available.

## Testing Change

* Make `test-build_r_pkg.R` robust to future `roxygen2` version changes.

# Version 0.3.5

The primary objective of these patches is to make the package more robust to not
Expand Down
10 changes: 9 additions & 1 deletion R/write.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ write_description_file <- function(access_time, user, roles, project_info, path)
formatC(lubridate::minute(access_time), width = 2, flag = 0),
sep = ".")

roxygen2_config <- if (requireNamespace("roxygen2", quietly = TRUE)) {
paste0("Config/roxygen2/version: ",
as.character(utils::packageVersion("roxygen2")),
"\n")
} else {
""
}

cat("Package: ", paste0("rcd", project_info$project_id), "\n",
"Title: ", project_info$project_title, "\n",
"Version: ", pkg_version, "\n",
Expand All @@ -40,7 +48,7 @@ write_description_file <- function(access_time, user, roles, project_info, path)
"LazyData: true\n",
"Suggests:\n knitr,\n roxygen2\n",
"VignetteBuilder: knitr\n",
"Config/roxygen2/version: 8.0.0\n",
roxygen2_config,
sep = "", file = paste(path, "DESCRIPTION", sep = "/"), append = FALSE)

invisible()
Expand Down
11 changes: 11 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Version 0.3.6

Make generated data package DESCRIPTION files and tests robust to changes in
the installed `roxygen2` version.

## Testing

- Local macOS, R 4.6.1
- R CMD check --as-cran REDCapExporter_0.3.6.tar.gz
- Status: pending

# Version 0.3.5

Reduce number of suggested packages and make the package more robust to missing
Expand Down
10 changes: 8 additions & 2 deletions tests/test-build_r_pkg.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ d <- read.dcf(file.path(pkgdir, "DESCRIPTION"))
stopifnot(
d[1, "Package"] == "rcd14465",
grepl("\\d{4}\\.\\d{2}\\.\\d{2}\\.\\d{2}\\.\\d{2}", d[1, "Version"]),
all(c("knitr", "roxygen2") %in% trimws(strsplit(d[1, "Suggests"], ",")[[1]])),
d[1, "Config/roxygen2/version"] == "8.0.0"
all(c("knitr", "roxygen2") %in% trimws(strsplit(d[1, "Suggests"], ",")[[1]]))
)

if (requireNamespace("roxygen2", quietly = TRUE)) {
stopifnot(
"Config/roxygen2/version" %in% colnames(d),
!is.na(numeric_version(d[1, "Config/roxygen2/version"]))
)
}

# check the file structure of the built package
x <- list.files(
path = pkgdir,
Expand Down
Loading