Closed joethorley closed 1 year ago
I think we need a bit more than this because leaflet.extras
would also match leafletXextras
etc (not very likely, but a suggestion that we shouldn't be using regexps here).
@gaborcsardi do you think we could switch to tools::dependsOnPkgs(package, dependencies = dependencies, installed = allpkgs, recursive = FALSE)
here?
We have now better tools for this, we could start using them, e.g. pkgcache::meta_cache_revdeps()
.
Maybe that's at the root of some of the strangeness in #319
Hmmm, but I can't get them to line up:
pkgcache <- pkgcache::meta_cache_revdeps("tidyr", dependencies = TRUE, recursive = FALSE)$package
#> ℹ Loading metadata database
#> ✔ Loading metadata database ... done
#>
length(pkgcache)
#> [1] 4087
revdepcheck <- revdepcheck::cran_revdeps("tidyr")
length(revdepcheck)
#> [1] 1750
Created on 2023-01-24 with reprex v2.0.2
pkgcache includes binaries and sources separately, and by default includes bioc as well. It is something like this:
cache <- pkgcache::cranlike_metadata_cache$new(platforms = "source", bioc = FALSE)
revdeps <- cache$revdeps("tidyr", dependencies = TRUE, recursive = FALSE)
revdeps[c("package", "version")]
We should probably also specify repos
in cranlike_metadata_cache$new()
, to avoid people's custom repos, and only use CRAN.
Ah, yeah, in parallel I realised that cran_revdeps()
depends on getOption("repos")
which seems bad.
I am fairly sure that it is OK, it uses its own get_repos()
which is more careful. So I would pass revdepcheck:::get_repos(FALSE)
to pkgcache, and also bioc = bioc
.
Not really: lbergelson/revdepcheck@patch-1/R/deps.R#L35-L36
I am not sure what you mean, sorry. Is that fork relevant, or that's just accidental?
Ooops, accidental. Anyway, I'm going to close this PR and open a new one that uses pkgcache.
Previously dependencies of leaflet.extras were being included (extras only has 4 depedencies)
Created on 2022-10-29 with reprex v2.0.2
Now with this pull request the correct 4 dependencies are returned
Created on 2022-10-29 with reprex v2.0.2