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
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: BiocPkgTools
Type: Package
Title: Collection of simple tools for learning about Bioconductor Packages
Version: 1.31.7
Date: 2026-05-14
Version: 1.31.8
Date: 2026-06-25
Authors@R: c(
person("Shian", "Su", role=c("aut", "ctb"), email = "su.s@wehi.edu.au"),
person("Lori", "Shepherd", role="ctb", email = "Lori.Shepherd@roswellpark.org"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ SIGNIFICANT USER-VISIBLE CHANGES

BUG FIXES AND MINOR IMPROVEMENTS

o `pkgBiocRevDeps(recursive = TRUE)` no longer returns forward
(non-reverse) dependencies. Recursion now follows only strong
dependencies, avoiding the `Suggests` / `Enhances` explosion that pulled
in nearly the entire repository (#81).
o Switch `generateBiocPkgDOI` to use `httr2` instead of `httr`
o Switch `repositoryStats` to use `httr2` instead of `httr`
o Support `match.arg` for `event` argument in `generateBiocPkgDOI`
Expand Down
6 changes: 5 additions & 1 deletion R/pkgBiocDeps.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,12 @@ pkgBiocRevDeps <- function(
biocdb <- utils::available.packages(repos = repo)

if (recursive)
## Only recurse over strong dependencies. Recursing reverse
## dependencies over 'Suggests' / 'Enhances' explodes to nearly the
## entire repository (e.g. thousands of packages 'Suggests' knitr),
## which pulls in forward (non-reverse) dependencies. See issue #81.
res <- tools::package_dependencies(
pkg, all_db, reverse = TRUE, which = which, recursive = recursive
pkg, all_db, reverse = TRUE, which = which, recursive = "strong"
)[[pkg]]
else
res <- lapply(which, function(ofwhich) {
Expand Down
26 changes: 26 additions & 0 deletions tests/testthat/test-pkgBiocDeps.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
test_that("pkgBiocRevDeps(recursive = TRUE) returns only reverse deps", {
## Regression test for issue #81: recursive reverse dependencies must not
## leak forward (non-reverse) dependencies. Recursing reverse dependencies
## over 'Suggests' / 'Enhances' previously exploded to nearly the entire
## repository, pulling in forward dependencies of the queried package.
pkg <- "Rarr"

db <- utils::available.packages(repos = BiocManager::repositories())
skip_if_not(pkg %in% rownames(db), "Rarr not available in repositories")

## Forward dependencies that are not themselves reverse dependencies should
## never appear in the recursive reverse-dependency result.
fwd <- tools::package_dependencies(pkg, db, which = "all")[[pkg]]
rev1 <- tools::package_dependencies(
pkg, db, reverse = TRUE, which = "all"
)[[pkg]]
fwd_only <- setdiff(fwd, rev1)

res <- pkgBiocRevDeps(pkg, recursive = TRUE, only.bioc = FALSE)
rec <- as.character(res)

expect_false(any(fwd_only %in% rec))
## The explosion produced tens of thousands of packages; a sane recursive
## reverse-dependency set is a small fraction of the repository.
expect_lt(length(rec), nrow(db) / 2)
})
Loading