Closed bbimber closed 3 years ago
FWIW, if some hook is enabled, some code like this would work in a github workflow.
BiocManager::install(version = "${{ matrix.config.bioc }}", ask = FALSE);
cat(append = TRUE, file = "~/.Rprofile", "options(repos = BiocManager::repositories());")
cat(append = TRUE, file = "~/.Rprofile", "Sys.setenv(R_BIOC_VERSION=BiocManager::version());");
if (BiocManager::version() == BiocManager:::.version_bioc('devel')) {cat(append = TRUE, file = "~/.Rprofile", "options(Bioc_git_branch = 'devel');") }
You should set a BiocViews:
field in your DESCRIPTION
, and then the Bioconductor packages will be automatically installed from the Bioconductor repositories returned by BiocManager
. You generally don't need to use an explicit bioc remote unless you are developing multiple Bioconductor packages in tandem.
@jimhester OK, I will try this. I'm not sure if I'm doing something in a sub-optimal way, but getting a non-bioconductor R package that depends on various bioconductor modules to properly install across differing bioc versions and to install with various entry points (i.e. install_deps(), install_github(), etc), has been challenging. In addition to what my package declares, I've has problems when my package depends on some other package that depends on a bioconductor package.
On another thread you posted something to the effect of "using bioc:: without specifying a branch is designed to always use bioconductor release". Running automated testing across a matrix of bioconductor releases seems like a reasonable use case, and some scheme to reliably force remotes to completely use a given bioconductor version would be really helpful.
I'm going to give your suggestion of adding BioViews a try. In parallel I think I'm going to try two other things:
Drop the remote "bioc::" from my package. I am already setting "options(repos = BiocManager::repositories());", so I really dont want remotes to try anything special when handling bioconductor packages. This will force the version to match what I have installed. This will probably break if I depend on a package that uses "bioc::" though. This of course means my package wont install correctly if someone else tries install_github() without updating 'repos'
With R_BIOC_VERSION, I get remotes 90% of the way there. The problem seems to be when bioconductor's git has a newer version than what's in bioc-devel. If I could just disable remotes from checking git, this would also probably do what I want.
I have an R package with testing via github actions. I would like to have one test running on bioconductor release and one on devel. My workflow does a number of things:
and then my DESCRIPTION lists the Bioconductor repos without specifying a branch (since this would make it hard to test across bioc releases), such as:
Remotes: bioc::DropletUtils
This is extremely close to working as I want; however, i figured out that when remote downloads package source from the bioconductor git, it's still using release. Such as here, or here.
Is there another hook to change that? Otherwise, would it make sense for the latter to support something like:
This requires two settings (the environment variable and options()), but I didnt immediately see how to effectively translate the numeric version number (which is what R_BIOC_VERSION provides) to devel/HEAD when that version is develop.
Is there some existing solution I'm missing? Thanks in advance.