-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
renv
is having issues with remote packages
#2040
Comments
Can you share the output of
in the package's DESCRIPTION file. |
Hi @kevinushey, No, this package was built from the start using a main branch. You can find both packages and the DESCRIPTION file on GitHub at the following links: |
However, I would add that this issue is recurrent with several other remote packages, not just mine. It’s worth looking into. |
Can you please share the output of |
The following works for me in an renv::install("danielvartan/prettycheck@517e473c1ffeccac6184b20639c8429a317dff60") Then, modify the installed package's DESCRIPTION file, so that RemoteRef reads 'main': path <- system.file("DESCRIPTION", package = "prettycheck")
desc <- readLines(path)
line <- grep("^RemoteRef:", desc)
desc[line] <- "RemoteRef: main"
writeLines(desc, con = path) Then update it with: renv::update(packages = "prettycheck") Here's the full installation log I see. > renv::install("danielvartan/prettycheck@517e473c1ffeccac6184b20639c8429a317dff60")
# Downloading packages -------------------------------------------------------
- Downloading prettycheck from GitHub ... OK [31.1 Kb in 0.34s]
Successfully downloaded 1 package in 2.8 seconds.
The following package(s) will be installed:
- prettycheck [danielvartan/prettycheck@517e473c1ffeccac6184b20639c8429a317dff60]
These packages will be installed into "~/scratch/example/renv/library/macos/R-4.4/aarch64-apple-darwin20".
Do you want to proceed? [Y/n]:
# Installing packages --------------------------------------------------------
- Installing prettycheck ... OK [built from source and cached in 1.6s]
Successfully installed 1 package in 1.7 seconds.
> path <- system.file("DESCRIPTION", package = "prettycheck")
> desc <- readLines(path)
> line <- grep("^RemoteRef:", desc)
> desc[line] <- "RemoteRef: main"
> writeLines(desc, con = path)
> renv::update(packages = "prettycheck")
- Checking for updated packages ... Done!
The following package(s) will be updated:
# GitHub ---------------------------------------------------------------------
- prettycheck [danielvartan/prettycheck@main: 517e473c -> dbe83404]
Do you want to proceed? [Y/n]: y
# Downloading packages -------------------------------------------------------
- Downloading prettycheck from GitHub ... OK [31.1 Kb in 0.36s]
Successfully downloaded 1 package in 2.4 seconds.
The following package(s) will be installed:
- prettycheck [danielvartan/prettycheck]
These packages will be installed into "~/scratch/example/renv/library/macos/R-4.4/aarch64-apple-darwin20".
Do you want to proceed? [Y/n]: y
# Installing packages --------------------------------------------------------
- Installing prettycheck ... OK [built from source and cached in 1.6s]
Successfully installed 1 package in 1.6 seconds. |
Here you go. packageDescription("prettycheck")
#> Package: prettycheck
#> Title: Pretty assertive programming
#> Version: 0.0.0.9000
#> Authors@R: c( person( given = "Daniel", family = "Vartanian", role =
#> c("aut", "cre", "ccp", "cph"), email = "danvartan@gmail.com",
#> comment = c(ORCID = "0000-0001-7782-759X") ) )
#> Description: Provides a set of functions that produce pretty and
#> informative error messages.
#> License: MIT + file LICENSE
#> URL: https://github.com/danielvartan/prettycheck/
#> BugReports: https://github.com/danielvartan/prettycheck/issues/
#> Depends: R (>= 4.3)
#> Imports: checkmate (>= 2.3.2), cli (>= 3.6.3), curl (>= 5.2.3),
#> data.table (>= 1.16.2), fastmatch (>= 1.1.4), glue (>= 1.8.0),
#> hms (>= 1.1.3), lifecycle (>= 1.0.4), lubridate (>= 1.9.3),
#> magrittr (>= 2.0.3), rlang (>= 1.1.4), rutils, stringr (>=
#> 1.5.1), tibble (>= 3.2.1), utils (>= 4.3)
#> Suggests: covr (>= 3.6.4), knitr (>= 1.48), mockr (>= 0.2.1), spelling
#> (>= 2.3.1), testthat (>= 3.2.1.1)
#> Remotes: github::danielvartan/rutils
#> Config/testthat/edition: 3
#> Encoding: UTF-8
#> Language: en-US
#> Roxygen: list(markdown = TRUE)
#> RoxygenNote: 7.3.2
#> Collate: 'make_check.R' 'a_collate.R' 'access.R' 'any.R' 'array.R'
#> .....
#> NeedsCompilation: no
#> Packaged: 2024-10-18 03:02:46 UTC; Daniel
#> Author: Daniel Vartanian [aut, cre, ccp, cph]
#> (<https://orcid.org/0000-0001-7782-759X>)
#> Maintainer: Daniel Vartanian <danvartan@gmail.com>
#> Built: R 4.4.1; ; 2024-10-18 03:02:47 UTC; windows
#>
#> -- File: C:/Users/Daniel/AppData/Local/R/win-library/4.4/prettycheck/Meta/package.rds Created on 2024-11-22 with reprex v2.1.1 |
Hi @kevinushey, I don't see how adding |
Here's what I see for my installation.
|
I see you are using a Mac, maybe this is a Windows issue. Below is my I also updated my sessionInfo()
#> R version 4.4.1 (2024-06-14 ucrt)
#> Platform: x86_64-w64-mingw32/x64
#> Running under: Windows 11 x64 (build 26100)
#>
#> Matrix products: default
#>
#>
#> locale:
#> [1] LC_COLLATE=Portuguese_Brazil.utf8 LC_CTYPE=Portuguese_Brazil.utf8
#> [3] LC_MONETARY=Portuguese_Brazil.utf8 LC_NUMERIC=C
#> [5] LC_TIME=Portuguese_Brazil.utf8
#>
#> time zone: America/Sao_Paulo
#> tzcode source: internal
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
#> [1] digest_0.6.37 fastmap_1.2.0 xfun_0.48 glue_1.8.0
#> [5] knitr_1.48 htmltools_0.5.8.1 rmarkdown_2.28 lifecycle_1.0.4
#> [9] cli_3.6.3 reprex_2.1.1 withr_3.0.1 compiler_4.4.1
#> [13] rstudioapi_0.16.0 tools_4.4.1 evaluate_1.0.1 yaml_2.3.10
#> [17] rlang_1.1.4 fs_1.6.4 Created on 2024-11-22 with reprex v2.1.1 |
I think the ideal way to test this issue is to install a GitHub package with It seems that |
Additionally, repeat the steps above, then delete the |
I see something similar on Windows, though.
gives me
Again, please note that |
For remote packages, I use the |
As I said before, I still don't understand how adding |
Thanks, that helps me understand the issue.
Unfortunately, the |
Ah, I see – makes sense now. I hope this issue helps with the implementation. Thank you for your assistance, @kevinushey! |
I just wanted to point out that the issue also exists on Ubuntu. I have this problem with a package of my own and renv itself (which I installed from GitHub): renv::update()
#> - Checking for updated packages ... Done!
#>
#> One or more errors occurred while finding updates for the following GitHub packages:
#> - renv: error downloading 'https://api.github.com/repos/rstudio/renv/commits/master' [error code 22]
#> - simpleTaxonomy: error downloading 'https://api.github.com/repos/stibu81/simpleTaxonomy/commits/master' [error code 22]
#> Ensure that these packages were installed from an accessible GitHub remote.
#>
#> - All packages appear to be up-to-date. The packages from GitHub have been installed with If I install my package with If there is anything else I could try out that would be helpful, please let me know. |
Thanks. I believe I understand the issue now; it's related to
when installing packages in this way, and |
Explicitly specifying the branch when installing with pak did not help. But the new commit seems to solve the problem. Thanks! |
Phew, glad to hear it. Thanks for testing and reporting back! |
Hi there,
It seems that
renv
encounters issues when attempting to update remote packages from GitHub usingrenv::update()
. The problem arises becauserenv
is looking for amaster
branch, while many repositories today usemain
as the default branch. The process should not depend on the naming convention of the main branch.Here is the error message I encountered:
The correct URLs should be:
https://api.github.com/repos/danielvartan/prettycheck/commits/main
https://api.github.com/repos/danielvartan/rutils/commits/main
renv
should automatically adapt to the default branch, whether it ismain
,master
, or otherwise.Thank you for looking into this!
The text was updated successfully, but these errors were encountered: