r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
330 stars 152 forks source link

Make remotes sources precedence optional #732

Closed maksymiuks closed 1 year ago

maksymiuks commented 1 year ago

Hi,

I'd like to suggest an enhancement to how remote sources are handled by the combine_remote_deps function https://github.com/r-lib/remotes/blob/main/R/deps.R#L150-L164. In particular, I think it would be beneficial to make this line:

https://github.com/r-lib/remotes/blob/main/R/deps.R#L161

conditional on some parameter or the env variable. The rationale is that sometimes as a developer, you want to check how the package behaves against CRAN sources, disregarding remotes. Right now it's hard to reproduce such a state using this function as remotes always take precedence over the CRAN forcing a developer to alter DESCRIPTION just for this one scenario (which could be tedious for instance in automated builds). Therefore I think keeping default behaviour as is but allowing to actually skip remotes if CRAN is present (or just don't include remote sources at all, will suffice as well) will make the lives of some developers easier.

Let me know what you think about this suggestion, happy to make a PR if you think its fine

gaborcsardi commented 1 year ago

Yes, a PR would be great.

maksymiuks commented 1 year ago

@gaborcsardi PR ready for the review https://github.com/r-lib/remotes/pull/733

maksymiuks commented 1 year ago

Feature merged, thanks for a quick response!