Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install_deps uses wrong Bioc version #380

Closed
grst opened this issue Jun 7, 2019 · 6 comments
Closed

install_deps uses wrong Bioc version #380

grst opened this issue Jun 7, 2019 · 6 comments

Comments

@grst
Copy link

grst commented Jun 7, 2019

When using install_deps(dependencies = TRUE) on a package with Bioconductor dependencies in an older R version (e.g. 3.5.1), the installation fails as remotes seems to try to install packages from the most recent Bioconductor release which is incompatible with R 3.5.1.

>Rscript -e 'remotes::install_deps(dependencies=TRUE)'

BiocGenerics (NA -> fc7c3af4a...) [Bioc]
Downloading Bioconductor repo https://git.bioconductor.org/packages/BiocGenerics
'/usr/bin/git' clone --depth 1 --no-hardlinks --branch RELEASE_3_9 https://git.bioconductor.org/packages/BiocGenerics /home/sturm/tmp/RtmpzuopSG/file7ce5687e27cc
Cloning into '/home/sturm/tmp/RtmpzuopSG/file7ce5687e27cc'...
remote: Enumerating objects: 153, done.
remote: Counting objects: 100% (153/153), done.
remote: Compressing objects: 100% (150/150), done.
remote: Total 153 (delta 56), reused 0 (delta 0)
Receiving objects: 100% (153/153), 74.40 KiB | 440.00 KiB/s, done.
Resolving deltas: 100% (56/56), done.
Running `R CMD build`...
* checking for file ‘/home/sturm/tmp/RtmpzuopSG/file7ce5687e27cc/DESCRIPTION’ ... OK
* preparing ‘BiocGenerics’:
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building ‘BiocGenerics_0.30.0.tar.gz’
ERROR: this R is version 3.5.1, package 'BiocGenerics' requires R >=  3.6.0
Error in i.p(...) : 
  (converted from warning) installation of package ‘/home/sturm/tmp/RtmpzuopSG/file7ce532169184/BiocGenerics_0.30.0.tar.gz’ had non-zero exit status
Calls: <Anonymous> ... with_rprofile_user -> with_envvar -> force -> force -> i.p
Execution halted

Expected behavior

remotes always uses the most recent Bioconductor release that is compatible with the current version of R (in the case of 3.5.1, Bioc v3.7)

Steps to reproduce

Setup R 3.5.1

conda create -n test_remotes -c conda-forge r-base=3.5.1 r-remotes
conda activate test_remotes
> R --version
R version 3.5.1 (2018-07-02) -- "Feather Spray"```

create empty package:

Rscript -e "usethis::create_package("test.remotes")

Append the following lines to DESCRIPTION

Depends:
  BiocGenerics
Remotes:
  bioc::BiocGenerics

Run the installation in the conda environment:

Rscript -e 'remotes::install_deps(dependencies=TRUE)'
@jimhester
Copy link
Member

This is a common misconception of what the purpose of the bioc remotes is. This remote is for installing the current development version of a Bioconductor package. If you want the release version you don't need to use a Remote at all, just put the bioconductor package in your Imports Depends etc as normal.

@grst
Copy link
Author

grst commented Jun 7, 2019

Hmm, I stumbled upon this because remotes is used by travis to resolve all dependencies.
This works fine when testing against the development version of R, but, in that case expectedly, fails when testing other R versions.

If I don't put the Bioconductor packages in Remotes at all, it just doesn't find the packages.

Is that something I should report to travis? Or can you hint me at what's the proper way of doing it?

@jimhester
Copy link
Member

jimhester commented Jun 7, 2019

You need to add a BiocViews field to your DESCRIPTION file, this indicates your package is a Bioconductor package and the repos will then be set up appropriately, it can be empty, but when you submit your package to Bioconductor you will need to add some views, so you could probably do it now.

@grst
Copy link
Author

grst commented Jun 7, 2019

ok, that seems to work nicely for a package that only contains CRAN and Bioc dependencies (and no Remotes: section at all.

I have a package that depends on both github and Bioc packages. As soon as I add a Remotes section to my DESCRIPTION file, the Bioc packages are not downloaded any more.

@jimhester
Copy link
Member

The issue is actually not in your package. It seems to be that xCell does not have BiocViews, despite depending on Bioconductor packages

https://github.com/dviraran/xCell/blob/fe6d5e6b02993315270ecd808b3eb1af3af30261/DESCRIPTION#L27-L28

@grst
Copy link
Author

grst commented Jun 10, 2019

I see now. Thanks a lot for your help!

@grst grst closed this as completed Jun 10, 2019
grst added a commit to grst/xCell that referenced this issue Jun 10, 2019
This is required for packages like `devtools` or `remotes` to properly download bioconductor packages. 
See discussion in r-lib/remotes#380 (comment) and the
documentation here: https://bioconductor.org/developers/how-to/biocViews/
davidmasp added a commit to davidmasp/helperMut that referenced this issue Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants