Skip to content

Commit

Permalink
Fix #69
Browse files Browse the repository at this point in the history
  • Loading branch information
chainsawriot committed Feb 23, 2023
1 parent ddba1e6 commit 4aa1ae3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Imports:
pkgsearch,
remotes,
utils,
gh
gh,
vctrs
Depends:
R (>= 3.5.0)
VignetteBuilder: knitr
13 changes: 7 additions & 6 deletions R/memo_misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ NULL
suffixes <- c("bioc", "data/annotation", "data/experiment", "workflow")
output <- data.frame()
for (suffix in suffixes) {
view_url <- paste0("http://bioconductor.org/packages/", bioc_version, "/", suffix, "/VIEWS")
con <- url(view_url)
tryCatch({
con <- url(paste0("http://bioconductor.org/packages/", bioc_version, "/", suffix, "/VIEWS"))
on.exit(close(con))
raw_bioc_pkgs_metadata <- suppressWarnings(read.dcf(con))
bioc_pkgs_metadata <- as.data.frame(raw_bioc_pkgs_metadata)[, c("Package", "Version", "Depends","LinkingTo","Imports","Suggests","Enhances")]
output <- rbind(output, bioc_pkgs_metadata)
raw_metadata <- suppressWarnings(read.dcf(con))
metadata <- as.data.frame(raw_metadata)
output <- vctrs::vec_rbind(output, metadata)
close(con)
}, error = function(e) {
#pass
close(con)
})
}
output
Expand Down
12 changes: 11 additions & 1 deletion tests/testthat/test_resolve.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,18 @@ test_that("issue 68, correct querying of bioc packages from major releases", {
skip_on_cran()
expect_equal(.query_biocver("2007-04-27")$version, "2.0")
expect_false(is.numeric(.query_biocver("2007-04-27")$version))
expect_error(.query_snapshot_dependencies_bioc("affy", "2014-10-15"), NA)
expect_error(.query_snapshot_dependencies_bioc("affy", "2007-04-15")) ## pre 2.0
expect_error(.query_snapshot_dependencies_bioc("affy", "2007-04-27"), NA)
expect_error(.query_snapshot_dependencies_bioc("affy", "2014-10-15"), NA)
expect_equal(length(resolve("bioc::affy", snapshot_date = "2007-04-27")$ranglets), 1)
expect_equal(length(resolve("bioc::affy", snapshot_date = "2014-10-15")$ranglets), 1)
})

test_that("issue 69, complete bioc information", {
skip_if_offline()
skip_on_cran()
expect_true(nrow(.memo_search_bioc("3.3")) > 1211)
expect_true("affydata" %in% .memo_search_bioc("3.3")$Package)
expect_equal(.normalize_pkg("affydata", "3.3"), "bioc::affydata")
expect_equal(length(resolve("bioc::affydata", snapshot_date = "2016-06-15")$ranglets), 1)
})

0 comments on commit 4aa1ae3

Please sign in to comment.