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

WISH: install_*() to return name of package installed #55

Closed
HenrikBengtsson opened this issue Feb 23, 2017 · 5 comments
Closed

WISH: install_*() to return name of package installed #55

HenrikBengtsson opened this issue Feb 23, 2017 · 5 comments

Comments

@HenrikBengtsson
Copy link
Contributor

Not all GitHub repositories are named the same way as the R package they install, e.g.

> res <- remotes::install_github("satijalab/seurat")
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo satijalab/seurat@master
Installing package into '/home/hb/R/x86_64-pc-linux-gnu-library/3.3'
(as 'lib' is unspecified)
* installing *source* packageSeurat...
** libs
[...]
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (Seurat)

> res
[1] TRUE

Note, this installs package Seurat (capitalized).

Would it make sense to have the function return the name of the package installed instead of TRUE? (Not sure if remotes ever knows about the package name or not).

Also, and just guessing, but I don't think you can ever get anything else than TRUE returned. For instance, if the repos doesn't exist, you get an error:

> res <- remotes::install_github("satijalab/non_existing_repos")
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo satijalab/non_existing_repos@master
Error in utils::download.file(url, path, method = download_method(), quiet = quiet,  : 
  cannot download all files
@HenrikBengtsson HenrikBengtsson changed the title WISH:install_*() to return name of package installed WISH: install_*() to return name of package installed Feb 23, 2017
@gaborcsardi
Copy link
Member

👍

Great idea! I think it should (ideally) even return some more elaborate structure that includes what exactly happened during install.

But the thing is, we will rewrite the dependency resolution and package download process (hopefully) soon, so I will not add this feature now.

@jeroen
Copy link
Member

jeroen commented May 5, 2017

@gaborcsardi @HenrikBengtsson what would be a temporary workaround that gives me the name of the package installed by install_github() with the current version of devtools / remotes ?

@gaborcsardi
Copy link
Member

gaborcsardi commented May 5, 2017

I am afraid that you need to download it:

p <- devtools:::github_remote("wesm/feather/R")
pkg <- devtools:::remote_download(p)

and then unzip DESCRIPTION and look inside with desc or read.dcf.

@jeroen
Copy link
Member

jeroen commented May 5, 2017

Can I feed pkg back to install to avoid downloading twice?

@gaborcsardi
Copy link
Member

gaborcsardi commented May 5, 2017 via email

jimhester added a commit to jimhester/remotes that referenced this issue Aug 28, 2018
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

3 participants