rversions icon indicating copy to clipboard operation
rversions copied to clipboard

Rtools query in scope?

Open MichaelChirico opened this issue 1 year ago • 4 comments

I see that we can query the Rtools versions from the API directly:

https://api.r-hub.io/rversions

Would it be in-scope to surface those in this package somewhere? Or should we just ping the REST API if we need that?

MichaelChirico avatar Oct 18 '24 16:10 MichaelChirico

FWIW, this package works independently of that API. Feels weird to use the api for some things and go to the source for others.

gaborcsardi avatar Oct 18 '24 16:10 gaborcsardi

Oh, got it, I assumed they were the same from both being on r-hub.

Is there any plan to merge the backends somehow? If not then I would close here as out of scope, if yes this is "nice to have but blocked by the refactoring project for now".

MichaelChirico avatar Oct 18 '24 16:10 MichaelChirico

Is there any plan to merge the backends somehow?

That would mean switching to using the JSON API in the R package, that's the only way that makes sense. We could do that, I guess. Should we?

gaborcsardi avatar Oct 21 '24 15:10 gaborcsardi

Hmm, I'll trust your judgment here on benefit/cost -- understand it may not be a trivial lift. I don't know what the user base is of {rversions}, or how exactly it fits into the broader r-hub project.

For context, I linked above the issue where this came up -- trying to avoid replicating the logic of determining R versions in yet-another place, I originally suggested {rversions} but that still leaves resolution of the Rtools path. Using the JSON API instead should be fine, but {rversions} potentially adds an abstraction layer for the end user that can be nice.

MichaelChirico avatar Oct 21 '24 16:10 MichaelChirico

This is now supported:

❯ resolve("release", "windows")
# A data frame: 1 × 7
  version date                nickname          semver    url   type  rtools_url
  <chr>   <dttm>              <chr>             <pckg_vr> <chr> <chr> <chr>     
1 4.5.1   2025-06-13 07:12:01 Great Square Root 4.5.1     http… rele… https://g…
❯ resolve("release", "windows")$rtools_url
[1] "https://github.com/r-hub/rtools45/releases/download/latest/rtools45.exe"
❯ tail(rtools_versions())
# A data frame: 6 × 4
  version url                                                        first last 
* <chr>   <chr>                                                      <chr> <chr>
1 35      https://cran.rstudio.com/bin/windows/Rtools/Rtools35.exe   3.3.0 3.6.3
2 40      https://cran.rstudio.com/bin/windows/Rtools/rtools40-x86_… 4.0.0 4.2.…
3 42      https://github.com/r-hub/rtools42/releases/download/lates… 4.2.0 4.2.…
4 43      https://github.com/r-hub/rtools43/releases/download/lates… 4.3.0 4.3.…
5 44      https://github.com/r-hub/rtools44/releases/download/lates… 4.4.0 4.4.…
6 45      https://github.com/r-hub/rtools45/releases/download/lates… 4.5.0 100.…

gaborcsardi avatar Oct 08 '25 10:10 gaborcsardi