gmbecker / switchr

An R package for managing and seamlessly switching between sets of installed R packages.
http://google.com AND http://blabla.com
59 stars 6 forks source link

publishManifest() unable to automatically detect GitHub packages #17

Open daattali opened 3 years ago

daattali commented 3 years ago

When installing a package from GitHub using remotes::install_github() (similarly with devtools) and then writing a manifest, the GitHub repo isn't automatically detected. This is manifested in two ways:

  1. If the package is on GitHub but not on CRAN/bioconductor, then the corresponding row in the manifest file just contains many NA values

  2. If the package is also on CRAN, then the manifest file writes CRAN as the source but uses the installed version, which is incorrect.

Reproducible example using switchr version 0.14.3 (latest CRAN release):

switchr::switchTo("testlib")
install.packages("remotes")
remotes::install_github("yihui/rmini")  # exapmle of a minimal package only on GitHub
remotes::install_github("ropensci/ezknitr")  # example of a minimal package on CRAN
switchr::publishManifest()

The resulting manifest file contains the following two lines. Note that the second one says version 0.6.1 even though CRAN only has version 0.6

"rmini",NA,NA,NA,".",NA,"0.0.4"
"ezknitr","https://cran.rstudio.com/src/contrib","CRAN","trunk",".",NA,"0.6.1"
gmbecker commented 3 years ago

So part of this is that you're mixing github installation mechanisms, right? If you install those github packages via switchr it should detect them correctly. But I will see what I can do.

On Mon, Feb 1, 2021 at 5:30 PM Dean Attali notifications@github.com wrote:

When installing a package from GitHub using remotes::install_github() (similarly with devtools) and then writing a manifest, the GitHub repo isn't automatically detected. This is manifested in two ways:

1.

If the package is on GitHub but not on CRAN/bioconductor, then the corresponding row in the manifest file just contains many NA values 2.

If the package is also on CRAN, then the manifest file writes CRAN as the source but uses the installed version, which is incorrect.

Reproducible example using switchr version 0.14.3 (latest CRAN release):

switchr::switchTo("testlib") install.packages("remotes") remotes::install_github("yihui/rmini") # exapmle of a minimal package only on GitHub remotes::install_github("ropensci/ezknitr") # example of a minimal package on CRAN switchr::publishManifest()

The resulting manifest file contains the following two lines. Note that the second one says version 0.6.1 even though CRAN only has version 0.6

"rmini",NA,NA,NA,".",NA,"0.0.4" "ezknitr","https://cran.rstudio.com/src/contrib","CRAN","trunk",".",NA,"0.6.1"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gmbecker/switchr/issues/17, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG53MOAWJTJQF7WTRPNN7TS45ITBANCNFSM4W5YVGVQ .

daattali commented 3 years ago

I haven't tried, but I imagine that would work. If it can pick up the source automatically that would be best, but it's fine if it remains as it currently is if the behaviour is documented

On Wed., Feb. 3, 2021, 15:10 Gabe Becker, notifications@github.com wrote:

So part of this is that you're mixing github installation mechanisms, right? If you install those github packages via switchr it should detect them correctly. But I will see what I can do.

On Mon, Feb 1, 2021 at 5:30 PM Dean Attali notifications@github.com wrote:

When installing a package from GitHub using remotes::install_github() (similarly with devtools) and then writing a manifest, the GitHub repo isn't automatically detected. This is manifested in two ways:

1.

If the package is on GitHub but not on CRAN/bioconductor, then the corresponding row in the manifest file just contains many NA values 2.

If the package is also on CRAN, then the manifest file writes CRAN as the source but uses the installed version, which is incorrect.

Reproducible example using switchr version 0.14.3 (latest CRAN release):

switchr::switchTo("testlib") install.packages("remotes") remotes::install_github("yihui/rmini") # exapmle of a minimal package only on GitHub remotes::install_github("ropensci/ezknitr") # example of a minimal package on CRAN switchr::publishManifest()

The resulting manifest file contains the following two lines. Note that the second one says version 0.6.1 even though CRAN only has version 0.6

"rmini",NA,NA,NA,".",NA,"0.0.4" "ezknitr","https://cran.rstudio.com/src/contrib ","CRAN","trunk",".",NA,"0.6.1"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gmbecker/switchr/issues/17, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAG53MOAWJTJQF7WTRPNN7TS45ITBANCNFSM4W5YVGVQ

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gmbecker/switchr/issues/17#issuecomment-772788945, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHIQFF5CUYM3RRV5RTL4YTS5GUSNANCNFSM4W5YVGVQ .