Skip to content
Merged
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
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: multiverse.internals
Title: Internal Infrastructure for R-multiverse
Description: R-multiverse requires this internal infrastructure package to
automate contribution reviews and populate universes.
Version: 1.0.8
Version: 1.0.9
License: MIT + file LICENSE
URL:
https://r-multiverse.org/multiverse.internals/,
Expand All @@ -28,7 +28,7 @@ Authors@R: c(
role = "cph"
))
Depends:
R (>= 4.4.0)
R (>= 4.5.0)
Imports:
base64enc,
desc,
Expand All @@ -40,6 +40,7 @@ Imports:
R.utils,
rversions,
stats,
tools,
utils,
vctrs,
yaml
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ importFrom(pkgsearch,cran_package)
importFrom(rversions,r_versions)
importFrom(stats,aggregate)
importFrom(stats,setNames)
importFrom(tools,analyze_license)
importFrom(utils,available.packages)
importFrom(utils,compareVersion)
importFrom(utils,contrib.url)
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# multiverse.internals 1.0.9

* Use `tools::analyze_license()` to determine if a package in a registration request has an open-source license. This is much more consistent and reliable than checking a manual list of license specification strings.
* Fix `meta_snapshot()` tests (check against the correct versions of R for the year 2025).
* Fix `rclone_includes()` tests: use the upcoming snapshot R version.

# multiverse.internals 1.0.8

* Subsume `meta_checks()` into `meta_packages()`.
Expand Down
40 changes: 5 additions & 35 deletions R/assert_package_description.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ assert_parsed_description <- function(name, description) {
)
}
authors_r <- try(
eval(parse(text = description$get("Authors@R"))),
suppressWarnings(eval(parse(text = description$get("Authors@R")))),
silent = TRUE
)
if (inherits(authors_r, "try-error")) {
Expand All @@ -107,7 +107,10 @@ assert_parsed_description <- function(name, description) {
)
}
license <- description$get("License")
if (!(license %in% trusted_licenses)) {
license_data <- tools::analyze_license(license)
license_okay <- isTRUE(license_data$is_canonical) &&
(isTRUE(license_data$is_FOSS) || isTRUE(license_data$is_verified))
if (!license_okay) {
return(
paste(
"Detected license",
Expand Down Expand Up @@ -150,36 +153,3 @@ assert_license_local <- function(name, path, text) {
)
}
}

trusted_licenses <- c(
"Apache License (== 2.0)",
"Apache License (>= 2.0)",
"Artistic-2.0",
"Artistic License 2.0",
"BSD_2_clause + file LICENCE",
"BSD_3_clause + file LICENCE",
"BSD_2_clause + file LICENSE",
"BSD_3_clause + file LICENSE",
"GPL-2",
"GPL-3",
"GPL (== 2)",
"GPL (== 2)",
"GPL (== 2.0)",
"GPL (== 3)",
"GPL (== 3.0)",
"GPL (>= 2)",
"GPL (>= 2)",
"GPL (>= 2.0)",
"GPL (>= 3)",
"GPL (>= 3.0)",
"LGPL-2",
"LGPL-3",
"LGPL (== 2)",
"LGPL (== 2.1)",
"LGPL (== 3)",
"LGPL (>= 2)",
"LGPL (>= 2.1)",
"LGPL (>= 3)",
"MIT + file LICENCE",
"MIT + file LICENSE"
)
1 change: 1 addition & 0 deletions R/package.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' @importFrom R.utils gzip
#' @importFrom rversions r_versions
#' @importFrom stats aggregate setNames
#' @importFrom tools analyze_license
#' @importFrom utils available.packages compareVersion contrib.url tail unzip
#' @importFrom vctrs vec_rbind vec_slice
#' @importFrom yaml read_yaml
Expand Down
16 changes: 8 additions & 8 deletions tests/testthat/test-meta_snapshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ test_that("meta_snapshot() is correct", {
dependency_freeze = "2025-04-15",
candidate_freeze = "2025-05-15",
snapshot = "2025-06-15",
r = "4.4"
r = "4.5"
)
}
for (month in c("05", "06")) {
Expand All @@ -83,7 +83,7 @@ test_that("meta_snapshot() is correct", {
dependency_freeze = "2025-04-15",
candidate_freeze = "2025-05-15",
snapshot = "2025-06-15",
r = "4.4"
r = "4.5"
)
}
}
Expand All @@ -93,7 +93,7 @@ test_that("meta_snapshot() is correct", {
dependency_freeze = "2025-04-15",
candidate_freeze = "2025-05-15",
snapshot = "2025-06-15",
r = "4.4"
r = "4.5"
)
}
for (day in c(middle, last)) {
Expand All @@ -102,7 +102,7 @@ test_that("meta_snapshot() is correct", {
dependency_freeze = "2025-07-15",
candidate_freeze = "2025-08-15",
snapshot = "2025-09-15",
r = "4.4"
r = "4.5"
)
}
for (month in c("08", "09")) {
Expand All @@ -112,7 +112,7 @@ test_that("meta_snapshot() is correct", {
dependency_freeze = "2025-07-15",
candidate_freeze = "2025-08-15",
snapshot = "2025-09-15",
r = "4.4"
r = "4.5"
)
}
}
Expand All @@ -122,7 +122,7 @@ test_that("meta_snapshot() is correct", {
dependency_freeze = "2025-07-15",
candidate_freeze = "2025-08-15",
snapshot = "2025-09-15",
r = "4.4"
r = "4.5"
)
}
for (day in c(middle, last)) {
Expand All @@ -131,7 +131,7 @@ test_that("meta_snapshot() is correct", {
dependency_freeze = "2025-10-15",
candidate_freeze = "2025-11-15",
snapshot = "2025-12-15",
r = "4.4"
r = "4.5"
)
}
for (month in c("11", "12")) {
Expand All @@ -141,7 +141,7 @@ test_that("meta_snapshot() is correct", {
dependency_freeze = "2025-10-15",
candidate_freeze = "2025-11-15",
snapshot = "2025-12-15",
r = "4.4"
r = "4.5"
)
}
}
Expand Down
34 changes: 20 additions & 14 deletions tests/testthat/test-rclone_includes.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,33 @@ test_that("rclone_includes()", {
expect_equal(
sort(include_packages),
sort(
c(
"src/contrib/staged_2.0.5.tar.gz",
"src/contrib/removed-no-issue_2.0.6.tar.gz",
"bin/macosx/*/contrib/4.4/staged_2.0.5.tgz",
"bin/macosx/*/contrib/4.4/removed-no-issue_2.0.6.tgz",
"bin/windows/contrib/4.4/staged_2.0.5.zip",
"bin/windows/contrib/4.4/removed-no-issue_2.0.6.zip"
sprintf(
c(
"src/contrib/staged_2.0.5.tar.gz",
"src/contrib/removed-no-issue_2.0.6.tar.gz",
"bin/macosx/*/contrib/%s/staged_2.0.5.tgz",
"bin/macosx/*/contrib/%s/removed-no-issue_2.0.6.tgz",
"bin/windows/contrib/%s/staged_2.0.5.zip",
"bin/windows/contrib/%s/removed-no-issue_2.0.6.zip"
),
meta_snapshot()$r
)
)
)
include_meta <- readLines(file_meta)
expect_equal(
sort(include_meta),
sort(
c(
"src/contrib/PACKAGES",
"src/contrib/PACKAGES.gz",
"bin/macosx/*/contrib/4.4/PACKAGES",
"bin/macosx/*/contrib/4.4/PACKAGES.gz",
"bin/windows/contrib/4.4/PACKAGES",
"bin/windows/contrib/4.4/PACKAGES.gz"
sprintf(
c(
"src/contrib/PACKAGES",
"src/contrib/PACKAGES.gz",
"bin/macosx/*/contrib/%s/PACKAGES",
"bin/macosx/*/contrib/%s/PACKAGES.gz",
"bin/windows/contrib/%s/PACKAGES",
"bin/windows/contrib/%s/PACKAGES.gz"
),
meta_snapshot()$r
)
)
)
Expand Down